repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
pycam/python-basic
python_basic_1_2.ipynb
unlicense
i = -7 j = 123 print(i, j) """ Explanation: An introduction to solving biological problems with Python Day 1 - Session 2: Simple data types Simple data types: Integers, Floats, Strings and Booleans Comments Arithmetic Exercises 1.2.1 Saving code in files Exercises 1.2.2 Simple data types Python (and computers in gen...
sjsrey/pysal
notebooks/explore/pointpats/Quadrat_statistics.ipynb
bsd-3-clause
import pysal.lib as ps import numpy as np from pysal.explore.pointpats import PointPattern, as_window from pysal.explore.pointpats import PoissonPointProcess as csr %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Quadrat Based Statistical Method for Planar Point Patterns Authors: Serge Rey s&#...
ReactiveX/RxPY
notebooks/reactivex.io/Marble Diagrams.ipynb
mit
%run startup.py """ Explanation: Marble Diagrams with RxPY This is a fantastic feature to produce and visualize streams and to verify how various operators work on them. Have also a look at rxmarbles for interactive visualisations. ONE DASH IS <font size="40px">100</font> MILLISECONDS! End of explanation """ rst(O.f...
rflamary/POT
docs/source/auto_examples/plot_UOT_1D.ipynb
mit
# Author: Hicham Janati <hicham.janati@inria.fr> # # License: MIT License import numpy as np import matplotlib.pylab as pl import ot import ot.plot from ot.datasets import make_1D_gauss as gauss """ Explanation: 1D Unbalanced optimal transport This example illustrates the computation of Unbalanced Optimal transport u...
mne-tools/mne-tools.github.io
dev/_downloads/c822037c0666a082e89228795c70bde1/10_background_stats.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause from functools import partial import numpy as np from scipy import stats import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa, analysis:ignore import mne from mne.stats import (ttest_1samp_no_p, bonferroni_correctio...
mayank-johri/LearnSeleniumUsingPython
Section 3 - Machine Learning/libs/core_libs/scipy/SciPy.ipynb
gpl-3.0
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt """ Explanation: SciPy SciPy is a collection of mathematical algorithms and convenience functions built on the Numpy extension of Python. It adds significant power to the interactive Python session by providing the user with high-level comman...
adityaka/misc_scripts
python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_05/Final/Operations.ipynb
bsd-3-clause
pd.set_option('display.precision', 2) sample_df_2.describe() """ Explanation: descriptive statistics End of explanation """ sample_df_2.mean() """ Explanation: column mean End of explanation """ sample_df_2.mean(1) """ Explanation: row mean documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pan...
JackDi/phys202-2015-work
assignments/assignment04/TheoryAndPracticeEx01.ipynb
mit
from IPython.display import Image """ Explanation: Theory and Practice of Visualization Exercise 1 Imports End of explanation """ # Add your filename and uncomment the following line: Image(filename='good data viz.png') """ Explanation: Graphical excellence and integrity Find a data-focused visualization on one of ...
openai/openai-python
examples/finetuning/olympics-3-train-qa.ipynb
mit
import openai import pandas as pd df = pd.read_csv('olympics-data/olympics_qa.csv') olympics_search_fileid = "file-c3shd8wqF3vSCKaukW4Jr1TT" df.head() """ Explanation: 3. Train a fine-tuning model specialized for Q&A This notebook will utilize the dataset of context, question and answer pairs to additionally create ad...
hvillanua/deep-learning
tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
AssembleSoftware/IoTPy
examples/ExamplesOfIncrementalKmeans.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns; sns.set() # for plot styling import numpy as np import threading import time from sklearn.datasets.samples_generator import make_blobs from sklearn.cluster import KMeans import sys sys.path.append("../") from IoTPy.core.stream import Stream, St...
james4424/nest-simulator
doc/model_details/aeif_models_implementation.ipynb
gpl-2.0
import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (15, 6) """ Explanation: NEST implementation of the aeif models Hans Ekkehard Plesser and Tanguy Fardet, 2016-09-09 This notebook provides a reference solution for the Adaptive Expo...
yangw1234/BigDL
docs/readthedocs/source/doc/Serving/Example/cluster-serving-http-example.ipynb
apache-2.0
import tensorflow as tf import os import PIL tf.__version__ # Obtain data from url:"https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip" zip_file = tf.keras.utils.get_file(origin="https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip", fname="...
smharper/openmc
examples/jupyter/cad-based-geometry.ipynb
mit
import urllib.request fuel_pin_url = 'https://tinyurl.com/y3ugwz6w' # 1.2 MB teapot_url = 'https://tinyurl.com/y4mcmc3u' # 29 MB def download(url): """ Helper function for retrieving dagmc models """ u = urllib.request.urlopen(url) if u.status != 200: raise RuntimeError("Failed to dow...
evanmason/OceanData_NoteBooks
Read_CORA_dataset.ipynb
gpl-3.0
datafile = "/home/ctroupin/DataOceano/Coriolis/CORA/NetCDF/OA_CORA4.1_20131215_dat_PSAL.nc" """ Explanation: Salinity from CORA dataset The data can be obtained from Coriolis FTP at ftp://ftp1.ifremer.fr/Core/INSITU_GLO_TS_REP_OBSERVATIONS_013_001_b. As an illustration, we will work with the OA data for December 2013....
gsentveld/lunch_and_learn
notebooks/Get_zip_files.ipynb
mit
import os from dotenv import load_dotenv, find_dotenv # find .env automagically by walking up directories until it's found dotenv_path = find_dotenv() # load up the entries as environment variables load_dotenv(dotenv_path) """ Explanation: Using environment variables saved in a .env file <code>dotenv</code> is a pac...
lit-mod-viz/middlemarch-critical-histories
notebooks/bpo-analysis.ipynb
gpl-3.0
import spacy import pandas as pd %matplotlib inline from ast import literal_eval import numpy as np import re import json from nltk.corpus import names from collections import Counter from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [16, 6] plt.style.use('ggplot') nlp = spacy.load('en') with open...
OpenGenus/cosmos
code/artificial_intelligence/src/autoenncoder/Convolutional_Autoencoder.ipynb
gpl-3.0
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
hetland/python4geosciences
materials/ST_images.ipynb
mit
import requests # from webscraping import numpy as np %matplotlib inline import matplotlib.pyplot as plt import matplotlib import cmocean import cartopy from PIL import Image # this is the pillow package from skimage import color from scipy import ndimage from io import BytesIO """ Explanation: Images Images are ju...
hbutler/InverseCCP
2 - Generate coupon probabilities - part 2.ipynb
mit
n = 20 #number of coupons mu = 1/n #this is the mean coupon probability sigma = mu/2 #this is the std dev parameter we will play around with - it seems to make sense to express it in terms of the mean x = np.arange(n)+0.5 #arange goes from 0 to n-1, and I want it to go from 1 to n p_x = stat.norm.ppf(x/(n), mu, sigma) ...
gfeiden/Notebook
Projects/mlt_calib/float_Y_float_alpha.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt data = np.genfromtxt('data/run05_kde_props_tmp3.txt') data = np.array([x for x in data if x[30] > -0.5]) # remove stars that our outside of the model grid """ Explanation: Float $Y_i$ & Float $\alpha_{MLT}$ First, we load the appropriate libraries ...
jmhsi/justin_tinker
data_science/courses/deeplearning2/neural-sr.ipynb
apache-2.0
%matplotlib inline import importlib import utils2; importlib.reload(utils2) from utils2 import * from scipy.optimize import fmin_l_bfgs_b from scipy.misc import imsave from keras import metrics from vgg16_avg import VGG16_Avg from bcolz_array_iterator import BcolzArrayIterator limit_mem() path = '/data/jhoward/ima...
zrhans/python
exemplos/dapp-bc/Estacoes-ATMOS-Copy1.ipynb
gpl-2.0
import sys import numpy as np import pandas as pd print(sys.version) # Versao do python - Opcional print(np.__version__) # VErsao do modulo numpy - Opcional import matplotlib import matplotlib.pyplot as plt %matplotlib inline import datetime import time #?pd.date_range #rng = pd.date_range('1/1/2011', periods=90, freq...
harmsm/pythonic-science
chapters/01_simulation/01_scipy-stats.ipynb
unlicense
x = np.arange(-10,10,0.2) y = np.cos(x) noisy_y = y + np.random.normal(0,0.3,len(y)) plt.plot(x,y) plt.plot(x,noisy_y) """ Explanation: <cont style="margin:auto"> <img src="https://s-media-cache-ak0.pinimg.com/originals/33/07/24/330724abbfde900c94af94ed0fbc5f9f.jpg" height="85%" width="85%" /> </font> <ul> <li><...
bjshaw/phys202-2015-work
assignments/assignment03/NumpyEx01.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import antipackage import github.ellisonbg.misc.vizarray as va """ Explanation: Numpy Exercise 1 Imports End of explanation """ def checkerboard(size): """Return a 2d checkboard of 0.0 and 1.0 as a NumPy array""" che...
mne-tools/mne-tools.github.io
0.19/_downloads/36ac16a286b47b66f1b51a959c65b5b9/plot_stats_cluster_time_frequency_repeated_measures_anova.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.stats import f_...
kabrapratik28/Stanford_courses
cs231n/2016/assignment3/ImageGradients.ipynb
apache-2.0
# As usual, a bit of setup import time, os, json import numpy as np import skimage.io import matplotlib.pyplot as plt from cs231n.classifiers.pretrained_cnn import PretrainedCNN from cs231n.data_utils import load_tiny_imagenet from cs231n.image_utils import blur_image, deprocess_image %matplotlib inline plt.rcParams...
zzsza/TIL
scikit-learn/Chapter 2. Supervised Learning.ipynb
mit
import mglearn import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline X, y = mglearn.datasets.make_forge() print(X) print(y) mglearn.discrete_scatter(X[:,0], X[:, 1], y) plt.legend(["class 0", "class 1"], loc=4) plt.xlabel("1st feature") plt.ylabel("2nd feature") print("X.shape :...
drericstrong/Blog
20161212_Predicting Abalone Rings Part 2.ipynb
agpl-3.0
import pandas as pd import numpy as np import seaborn as sns from scipy import stats import matplotlib.pyplot as plt from sklearn import linear_model from sklearn.decomposition import PCA from sklearn.metrics import r2_score, mean_absolute_error from sklearn.model_selection import train_test_split %matplotlib inline ab...
antoniomezzacapo/qiskit-tutorial
qiskit/basics/getting_started_with_qiskit_terra.ipynb
apache-2.0
import numpy as np from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit import execute """ Explanation: <img src="../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> G...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/launching_into_ml/solutions/TrainingWithXGBoostInCMLE.ipynb
apache-2.0
%env PROJECT_ID <YOUR_PROJECT_ID> %env BUCKET_ID <YOUR_BUCKET_ID> %env REGION us-central1 %env TRAINER_PACKAGE_PATH ./census_training %env MAIN_TRAINER_MODULE census_training.train %env JOB_DIR gs://<YOUR_BUCKET_ID>/xgb_job_dir %env RUNTIME_VERSION 2.5 %env PYTHON_VERSION 3.7 ! mkdir census_training """ Explanation: X...
GoogleCloudPlatform/vertex-ai-samples
community-content/tf_agents_bandits_movie_recommendation_with_kfp_and_vertex_sdk/step_by_step_sdk_tf_agents_bandits_movie_recommendation/step_by_step_sdk_tf_agents_bandits_movie_recommendation.ipynb
apache-2.0
import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = "--user" ! pip3 install {...
mari-linhares/tensorflow-workshop
code_samples/RNN/weather_prediction/.ipynb_checkpoints/model-checkpoint.ipynb
apache-2.0
#!/usr/bin/env python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
vrbala/timeseries-analysis
Analysis.ipynb
gpl-2.0
import pandas as pd import os os.listdir('.') """ Explanation: Problem Given the time series of CPU consumption (cpu time) of a process, can we predict eta for a similar process in future? And can we answer questions like 1) is the process running slower (consuming less CPU) than how it is supposed to be? 2) Given the...
ajhenrikson/phys202-2015-work
assignments/assignment05/InteractEx01.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 01 Import End of explanation """ def print_sum(a, b): """Print the sum of the arguments a and b.""" ...
jmschrei/pomegranate
tutorials/C_Feature_Tutorial_2_Out_Of_Core_Learning.ipynb
mit
%matplotlib inline import time import pandas import random import numpy import matplotlib.pyplot as plt import seaborn; seaborn.set_style('whitegrid') import itertools from pomegranate import * random.seed(0) numpy.random.seed(0) numpy.set_printoptions(suppress=True) %load_ext watermark %watermark -m -n -p numpy,sci...
tensorflow/cloud
g3doc/tutorials/hp_tuning_wide_and_deep_model.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
authman/DAT210x
Module3/Module3 - Lab3.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt import matplotlib # Look pretty... # matplotlib.style.use('ggplot') plt.style.use('ggplot') """ Explanation: DAT210x - Programming with Python for DS Module3 - Lab3 End of explanation """ # .. your code here .. """ Explanation: Load up the wheat seeds dataset in...
nntisapeh/intro_programming
notebooks/introducing_functions.ipynb
mit
# Let's define a function. def function_name(argument_1, argument_2): # Do whatever we want this function to do, # using argument_1 and argument_2 # Use function_name to call the function. function_name(value_1, value_2) """ Explanation: Introducing Functions One of the core principles of any programming language ...
rayjustinhuang/DataAnalysisandMachineLearning
Natural Language Processing - SMS Spam Detection.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set() import nltk messages = pd.read_csv('SMS Spam Collection/SMSSpamCollection',sep='\t',names=['Label','Message']) messages.head() messages['Length'] = messages['Message'].apply(len) messages.head...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-1/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-1', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-1 Topic: Atmos Sub-Topics: Dynamical Core, R...
arcyfelix/Courses
18-11-22-Deep-Learning-with-PyTorch/02-Introduction to PyTorch/Part 3 - Training Neural Networks.ipynb
apache-2.0
import torch from torch import nn import torch.nn.functional as F from torchvision import datasets, transforms # Define a transform to normalize the data transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5, 0.5, 0.5), ...
kabrapratik28/Stanford_courses
cs231n/assignment3/StyleTransfer-PyTorch.ipynb
apache-2.0
import torch import torch.nn as nn from torch.autograd import Variable import torchvision import torchvision.transforms as T import PIL import numpy as np from scipy.misc import imread from collections import namedtuple import matplotlib.pyplot as plt from cs231n.image_utils import SQUEEZENET_MEAN, SQUEEZENET_STD %m...
AnyBody-Research-Group/AnyPyTools
docs/Tutorial/03_Working_with_output_from_Anybody.ipynb
mit
from anypytools import AnyMacro, AnyPyProcess, macro_commands as mc macro_list = [ [ mc.Load("Knee.any"), mc.SetValue("Main.MyModel.PatellaLigament.DriverPos", 0.02 + i * 0.01), mc.OperationRun("Main.MyStudy.InverseDynamics"), mc.Dump("Main.MyStudy.Output.Abscissa.t"), ...
roaminsight/roamresearch
BlogPosts/Modern_TensorFlow/modern-tensorflow.ipynb
apache-2.0
__author__ = 'Guillaume Genthial' __date__ = '2018-09-22' """ Explanation: Good practices in Modern Tensorflow for NLP End of explanation """ from distutils.version import LooseVersion import sys if LooseVersion(sys.version) < LooseVersion('3.4'): raise Exception('You need python>=3.4, but you have {}'.format(s...
the-new-sky/Kadot
RaD/new_word_vectorization.ipynb
mit
tokenizer = lambda txt: txt.split(' ') tokenizer("Say hello to faster vectorisation !") """ Explanation: Faster co-occurence vectorization The goal of this notebook is to write a faster way to implement the co-ocurence matrix vectorizer. To begin, let's write a toy tokenizer. End of explanation """ from urllib.requ...
tritemio/multispot_paper
out_notebooks/Multi-spot vs usALEX FRET histogram comparison-out-12d.ipynb
mit
data_id = '17d' ph_sel_name = "None" data_id = "12d" """ Explanation: Executed: Mon Mar 27 22:24:18 2017 Duration: 12 seconds. End of explanation """ from fretbursts import * sns = init_notebook() import os import pandas as pd from IPython.display import display, Math import lmfit print('lmfit version:', lmfit._...
JoeriHermans/tensorflow-scripts
scripts/adverserial-bayesian-optimization/abo.ipynb
gpl-3.0
!date """ Explanation: Adverserial Bayesian Optimization Joeri R. Hermans and Gilles Louppe End of explanation """ import torch import numpy as np import math import random import torch.nn.functional as F import matplotlib.pyplot as plt from sklearn import gaussian_process from sklearn.gaussian_process.kernels impor...
karlstroetmann/Algorithms
Python/Chapter-07/2-3-Trees-Visualization.ipynb
gpl-2.0
import graphviz as gv """ Explanation: 2-3 Trees This notebook contains the code to visualize 2-3 trees. End of explanation """ class TwoThreeTree: sNodeCount = 0 def __init__(self): TwoThreeTree.sNodeCount += 1 self.mID = TwoThreeTree.sNodeCount def getID(self): ret...
IST256/learn-python
content/lessons/06-Strings/Slides.ipynb
mit
def doit(a,b): return a+b x = 4 y = 3 z = doit(x,x) print(z) """ Explanation: IST256 Lesson 06 Strings Zybook Ch6 P4E Ch6 Links Participation: https://poll.ist256.com <= AZURE IS DOWN! Ask in your Zoom Chat Agenda Homework 05 Quick Review of the Solution Strings - Strings are immutable sequence of character...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/statespace_dfm_coincident.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt np.set_printoptions(precision=4, suppress=True, linewidth=120) from pandas_datareader.data import DataReader # Get the datasets from FRED start = '1979-01-01' end = '2014-12-01' indprod = DataReade...
quantumlib/ReCirq
recirq/otoc/loschmidt/tilted_square_lattice/analysis-walkthrough.ipynb
apache-2.0
%matplotlib inline from matplotlib import pyplot as plt # Set up reasonable defaults for figure fonts import matplotlib matplotlib.rcParams.update(**{ 'axes.titlesize': 14, 'axes.labelsize': 14, 'xtick.labelsize': 12, 'ytick.labelsize': 12, 'legend.fontsize': 12, 'legend.title_fontsize': 12, ...
tpin3694/tpin3694.github.io
machine-learning/f1_score.ipynb
mit
# Load libraries from sklearn.model_selection import cross_val_score from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_classification """ Explanation: Title: F1 Score Slug: f1_score Summary: How to evaluate a Python machine learning using F1 score. Date: 2017-09-15 12:00 Category:...
tensorflow/docs-l10n
site/en-snapshot/probability/examples/TensorFlow_Distributions_Tutorial.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
wenduowang/git_home
python/MSBA/intro/HW3/.ipynb_checkpoints/HW3_wenduowang_20160728-checkpoint.ipynb
gpl-3.0
gold = pd.read_table("gold.txt", names=["url", "category"]).dropna() labels = pd.read_table("labels.txt", names=["turk", "url", "category"]).dropna() """ Explanation: Question 1: Read in data Read in the data from "gold.txt" and "labels.txt". Since there are no headers in the files, names parameter should be set expli...
UltronAI/Deep-Learning
CS231n/assignment1/knn.ipynb
mit
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt from __future__ import print_function # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inlin...
pligor/predicting-future-product-prices
04_time_series_prediction/14_price_history_seq2seq-native.ipynb
agpl-3.0
from __future__ import division import tensorflow as tf from os import path import numpy as np import pandas as pd import csv from sklearn.model_selection import StratifiedShuffleSplit from time import time from matplotlib import pyplot as plt import seaborn as sns from mylibs.jupyter_notebook_helper import show_graph ...
deculler/DataScienceTableDemos
ProbabilityBirthdaySurprise.ipynb
bsd-2-clause
# HIDDEN from datascience import * %matplotlib inline import matplotlib.pyplot as plots plots.style.use('fivethirtyeight') import numpy as np # datascience version number of last run of this notebook version.__version__ """ Explanation: This notebook illustrates the use of tables in conveying the combination of infere...
Caranarq/01_Dmine
Datasets/Pigoo/Pigoo_Desagregacion.ipynb
gpl-3.0
# Librerias utilizadas import pandas as pd import sys import urllib module_path = r'D:\PCCS\01_Dmine\Scripts' if module_path not in sys.path: sys.path.append(module_path) from SUN.asignar_sun import asignar_sun from SUN_integridad.SUN_integridad import SUN_integridad from SUN.CargaSunPrincipal import getsun # Con...
feroda/lessons-python4beginners
P4B - Capitolo 1.ipynb
agpl-3.0
# This is hello_who.py def hello(who): print("Hello {}!".format(who)) if __name__ == "__main__": hello("mamma") """ Explanation: Python2 for beginners (P4B) <p style="text-align: center;">Luca Ferroni <luca@befair.it></p> <p style="text-align: center;">http://www.befair.it<br />**Software Libero per i terr...
tensorflow/docs-l10n
site/ja/hub/tutorials/semantic_approximate_nearest_neighbors.ipynb
apache-2.0
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
dh7/ML-Tutorial-Notebooks
rnn_face_tests/LFW Model Face V0.3.ipynb
bsd-2-clause
%matplotlib notebook import matplotlib import matplotlib.pyplot as plt from IPython.display import Image """ Explanation: RNN for pictures genaration This notebook is an experiment. I tryed to generate a picture pixel by pixel using an RNN. each pixel can be black or white. WIP Import needed for Jupiter End of expla...
mne-tools/mne-tools.github.io
0.18/_downloads/b7f6f07283b8cae86edea831b037ebca/plot_object_raw.ipynb
bsd-3-clause
import mne import os.path as op from matplotlib import pyplot as plt """ Explanation: The :class:~mne.io.Raw data structure: continuous data Continuous data is stored in objects of type :class:~mne.io.Raw. The core data structure is simply a 2D numpy array (channels × samples) (in memory or loaded on demand) combined ...
pybel/pybel-notebooks
integration/Parsing CBN Database JSON Graph Format.ipynb
apache-2.0
import json import requests import os import time import networkx as nx import pybel from pybel.constants import * import pybel_tools from pybel_tools.visualization import to_jupyter pybel.__version__ pybel_tools.__version__ time.asctime() """ Explanation: Parsing the Causal Biological Network Database Author: Ch...
wchapman/wchapman.github.io
assets/2015-10-10-SPyNN-DynamicalSystems/2015-10-10-SPyNN-DynamicalSystems.ipynb
mit
# Setup the environment import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Set Izhikevich parameters k = 0.75; C = 200; v_r = -60 v_t = -45; a = 0.01; b = 15 ; c = -50 d = 100; v_peak = 100 # T = 500; dt = 0.01 t = np.arange(0,T,dt,dtype=np.float) v = v_r; u = 0 #initial state # lists to appen...
emmajagu/contiamo-client-python
demo-notebooks/purchase-frequency.ipynb
mit
import pandas as pd import contiamo """ Explanation: Purchase frequency In this notebook we create a table grouping transaction information by customers’ purchase frequency. This is done with functions from the pandas librairie such as df.groupby() and df.cut(). End of explanation """ transactions = %contiamo query ...
limpapud/data_science_tutorials_projects
DataScience_Tutorials/AZ/Pandas_SQL.ipynb
mit
import pandas as pd """ Explanation: Pandas ilə SQLvari sorğuların yazılması SQL ilə heç olmasa qismən tanışlığı olan adam "SQL-in əsasların bir neçə saat ərzində öyrənib ilk sorğuları yazmaq olar" cümləsi ilə razılaşar (hər halda mən bu cür fikirləşirəm). Python ilə də eynən, bu dil ən sadə və proqramlaşdırmanı öyrə...
piyueh/SEM-Toolbox
solutions/chapter02/exercise03.ipynb
mit
import numpy import re from matplotlib import pyplot from matplotlib import colors from IPython.display import Latex, Math, display % matplotlib inline import os, sys sys.path.append(os.path.split(os.path.split(os.getcwd())[0])[0]) import utils.poly as poly import utils.quadrature as quad import utils.elems.one_d as ...
gklambauer/SelfNormalizingNetworks
SelfNormalizingNetworks_MLP_MNIST.ipynb
gpl-3.0
import tensorflow as tf import numpy as np from sklearn.preprocessing import StandardScaler from __future__ import absolute_import, division, print_function import numbers from tensorflow.contrib import layers from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_shape from tensorf...
ThomasProctor/Slide-Rule-Data-Intensive
pycon-pandas-tutorial-master/Exercises-2.ipynb
mit
titles['title'].value_counts()[:10] """ Explanation: What are the ten most common movie names of all time? End of explanation """ titles[(titles['year']<1940)&(titles['year']>=1930)]['year'].value_counts() """ Explanation: Which three years of the 1930s saw the most films released? End of explanation """ dec=((ti...
fcollonval/coursera_data_visualization
KMeansCluster.ipynb
mit
# Magic command to insert the graph directly in the notebook %matplotlib inline # Load a useful Python libraries for handling data import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from IPython.display import Markdown, display from sklearn.cross_validation import train_test_s...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/06_structured/2_sample.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.1 # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'...
hglanz/phys202-2015-work
assignments/assignment05/MatplotlibEx03.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 3 Imports End of explanation """ def well2d(x, y, nx, ny, L=1.0): """Compute the 2d quantum well wave function.""" psi = (2 / L) * np.sin(nx * np.pi * x / L) * np.sin( ny * np.pi * y / L) return psi...
sdpython/ensae_teaching_cs
_doc/notebooks/sklearn_ensae_course/07_application_to_face_recognition.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot as plt """ Explanation: 2A.ML101.7: Example from Image Processing Here we'll take a look at a simple facial recognition example. Source: Course on machine learning with scikit-learn by Gaël Varoquaux End of explanation """ from sklearn import datase...
4dsolutions/Python5
Polyhedrons.ipynb
mit
from qrays import Vector # see Chapter 6 class Polyhedron: def __init__(self, name, volume, faces : set, vertexes : dict, center = Vector((0,0,0))): self.name = name self.vertexes = vertexes self.volume = volume self.faces = faces self.edges = ...
SciTools/courses
course_content/iris_course/3.Subcube_Extraction.ipynb
gpl-3.0
import iris """ Explanation: Iris introduction course 3. Subcube Extraction Learning outcome: by the end of this section, you will be able to use various Iris facilities to extract sub-sections of a dataset. Duration: 1 hour Overview:<br> 3.1 Indexing<br> 3.2 Constraints and Extraction<br> 3.3 Iterating Over a Cube<br...
darkomen/TFG
ipython_notebooks/06_regulador_experto/.ipynb_checkpoints/ensayo6-checkpoint.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Abrimos el fichero csv con los datos...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_movement_compensation.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from os import path as op import mne from mne.preprocessing import maxwell_filter print(__doc__) data_path = op.join(mne.datasets.misc.data_path(verbose=True), 'movement') pos = mne.chpi.read_head_pos(op.join(data_path, 'simulated_quats.p...
jinzekid/codehub
python/day6/2.3 Python语言基础.ipynb
gpl-3.0
a = 5; b = 6; c = 7 """ Explanation: 2.3 Python语言基础 1 语言语义(Language Semantics) 缩进,而不是括号 Python使用空格(tabs or spaces)来组织代码结构,而不是像R,C++,Java那样用括号。 建议使用四个空格来作为默认的缩进,设置tab键为四个空格 另外可以用分号隔开多个语句: End of explanation """ result = f(x, y, z) """ Explanation: 所有事物都是对象(object) 在python中,number,string,data structure,function,class...
vallis/libstempo
demo/libstempo-demo.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' from __future__ import print_function import sys, math, numpy as N, matplotlib.pyplot as P """ Explanation: libstempo tutorial: basic functionality Michele Vallisneri, vallis@vallis.org; latest revision: 2016/10/12 for v2.3 revision End of explanation ...
rubensfernando/mba-analytics-big-data
Python/2016-07-25/aula3-parte3-dataframe.ipynb
mit
import pandas as pd import numpy as np """ Explanation: DataFrame Como vimos DataFrame é um array 2D com rótulos. Os tipos das colunas podem ser heterogêneas (de diversos tipos). Ele tem as seguintes propriedades: Conceitualmente é semelhante a uma tabela ou planilha de dados. Colunas podem ser de diferentes tipos: f...
tschinz/iPython_Workspace
02_WP/General/PrintHead_Calculations.ipynb
gpl-2.0
import numpy as np resolutions = [150, 360, 600, 1200, 2400, 4800] # dpi inch2cm = 2.54 # cm/inch nbrOfSubpixels = 32 # Calulation Pixel Pinch pixel_pitch = np.empty(shape=[len(resolutions)], dtype=np.float64) # um for i in range(len(resolutions)): pixel_pitch[i] = (inch2cm/resolutions[i])*10000 # Calcula...
prabhath6/Data-analysis-of-titanic-using-python
Titanic Intro project.ipynb
mit
# plotting library import matplotlib.pyplot as plt import seaborn as sns import numpy as np %matplotlib inline # quick look at the sex of people on the titanic """ we will use factor plot for this which takes a coloum name and divide on the basis of the avaliable data. """ sns.factorplot('Sex', data=titanic_df) #...
bgalbraith/bandits
notebooks/Stochastic Bandits - Value Estimation.ipynb
apache-2.0
%matplotlib inline import os import sys module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) import bandits as bd """ Explanation: Stochastic Multi-Armed Bandits - Value Estimation These examples come from Chapter 2 of Reinforcement Learning: An Introducti...
giosans/Fundamentals-of-Digital-Image-and-Video-Processing-course
week8.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt p = np.arange(1,1000)/1000. H = -p*np.log2(p) - (1-p)*np.log2(1-p) fig=plt.figure(figsize=(4, 4)) ax1=plt.subplot(1, 1, 1) plt.plot(p,H) plt.title('Entropy with a two values alphabet') plt.ylabel('H') plt.xlabel('p') """ Explanation: week8 Lossle...
thehackerwithin/berkeley
code_examples/SQL/SQL_Tutorial-0.ipynb
bsd-3-clause
# imports import io # we'll need this way later import os import sqlite3 # this is the module that binds to SQLite import numpy as np # never know when you might need NumPy, oh, right, always! import pandas as pd # you'll see why we can use this later DBFILE = 'sqlite3.db' # this will be our database BASEDIR = %p...
hparik11/Deep-Learning-Nanodegree-Foundation-Repository
tensorboard/Anna_KaRNNa_Summaries.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
zzsza/TIL
python/sacred_tutorial(experiment-support).ipynb
mit
from numpy.random import permutation from sklearn import svm, datasets from sacred import Experiment ex = Experiment('iris_rbf_svm', interactive=True) # jupyter notebook일 경우 interactive=True, python 스크립트라면 없어도 됨 @ex.config def cfg(): C = 1.0 gamma = 0.7 # ex.automain은 python 스크립트일 때 사용 @ex.main def run(C, gam...
whitead/numerical_stats
project/type3_examples/aa_sequences.ipynb
gpl-3.0
!pip install biopython import Bio from Bio.pairwise2 import format_alignment for a in Bio.pairwise2.align.globalxx("ACCGT", "ACG"): print(format_alignment(*a)) """ Explanation: Analyzing Genetic Mutations in Ribosomal Protein S12 A Statistical Analysis CHE 116 Numerical Methods and Statistics Dominic Giambra Abs...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/HvassLabsTutorials/03_PrettyTensor.ipynb
apache-2.0
from IPython.display import Image Image('images/02_network_flowchart.png') """ Explanation: TensorFlow Tutorial #03 PrettyTensor by Magnus Erik Hvass Pedersen / GitHub / Videos on YouTube Introduction The previous tutorial showed how to implement a Convolutional Neural Network in TensorFlow, which required low-level k...
iRipVanWinkle/ml
Data Science UA - September 2017/Lecture 04 - Overview of Linear Algebra and Matrix Computations/Nonlinear_Equations.ipynb
mit
import numpy as np x1 = np.linspace(-4,4,100) # 100 linearly spaced numbers y1 = -x1**3+1 y2 = np.linspace(-4,4,100) # 100 linearly spaced numbers x2 = y2**3+1 import matplotlib.pyplot as plt %matplotlib inline # compose plot plt.plot(x1,y1) plt.plot(x2,y2) plt.xlim(-4.0, 4.0) plt.ylim(-4.0, 4.0) plt.xlabel("x") pl...
jsharpna/DavisSML
lectures/lecture5/lecture5.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt ## Explore Turkish stock exchange dataset tse = pd.read_excel('../../data/data_akbilgic.xlsx',skiprows=1) tse = tse.rename(columns={'ISE':'TLISE','ISE.1':'USDISE'}) def const_wave(T,a,b): wave = np.zeros(T) s1 = (b-a) // 2 s2 = (b-a)...
therealAJ/python-sandbox
data-science/learning/ud1/DataScience/TopPages.ipynb
gpl-3.0
import re format_pat= re.compile( r"(?P<host>[\d\.]+)\s" r"(?P<identity>\S*)\s" r"(?P<user>\S*)\s" r"\[(?P<time>.*?)\]\s" r'"(?P<request>.*?)"\s' r"(?P<status>\d+)\s" r"(?P<bytes>\S*)\s" r'"(?P<referer>.*?)"\s' r'"(?P<user_agent>.*?)"\s*' ) """ Explanation: Cleaning Your Data Let'...
monicathieu/cu-psych-r-tutorial
content/tutorials/python/3-datamanipulation/.ipynb_checkpoints/index-checkpoint.ipynb
mit
# load packages we will be using for this lesson import pandas as pd """ Explanation: title: "Data Manipulation in Python" subtitle: "CU Psych Scientific Computing Workshop" weight: 1301 tags: ["core", "python"] Goals of this Lesson Students will learn: How to group and categorize data in Python How to generative de...
nbokulich/short-read-tax-assignment
ipynb/runtime/analysis.ipynb
bsd-3-clause
from os.path import expandvars from tax_credit.plotting_functions import (lmplot_from_data_frame, calculate_linear_regress) import pandas as pd """ Explanation: Evaluate computational runtimes The purpose of this notebook is to analyze and plot computational runtimes generated for a list of taxonomy assignment methods...
vinitsamel/udacitydeeplearning
batch-norm/Batch_Normalization_Lesson.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) "...
farfan92/SpringBoard-
statistics project 3/sliderule_dsi_inferential_statistics_exercise_3.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt import bokeh.plotting as bkp from mpl_toolkits.axes_grid1 import make_axes_locatable %matplotlib inline # read in readmissions data provided hospital_read_df = pd.read_csv('data/cms_hospital_readmissions.csv') """ Explanation: Hospital readmission...
ellisonbg/leafletwidget
examples/LegendControl.ipynb
mit
from ipyleaflet import Map, LegendControl mymap = Map(center=(-10,-45), zoom=4) mymap """ Explanation: Legend: How to use step 1: create an ipyleaflet map End of explanation """ a_legend = LegendControl({"low":"#FAA", "medium":"#A55", "High":"#500"}, name="Legend", position="bottomright") mymap.add_control(a_lege...
jseabold/statsmodels
examples/notebooks/gee_nested_simulation.ipynb
bsd-3-clause
import numpy as np import pandas as pd import statsmodels.api as sm """ Explanation: GEE nested covariance structure simulation study This notebook is a simulation study that illustrates and evaluates the performance of the GEE nested covariance structure. A nested covariance structure is based on a nested sequence of...
phoebe-project/phoebe2-docs
development/tutorials/ebv_Av_Rv.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Extinction (ebv, Av, & Rv) Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ import phoeb...