repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/cmip6/models/sandbox-2/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-2', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-2 Topic: Ocean Sub-Topics: Timestepping Framework, A...
quantopian/research_public
notebooks/lectures/PCA/notebook.ipynb
apache-2.0
from numpy import linalg as LA import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Principal Component Analysis by Rene Zhang and Max Margenot Part of the Quantopian Lecture Series: www.quantopian.com/lectures https://github.com/quantopian/research_public Applications in many fie...
GoogleCloudPlatform/training-data-analyst
courses/ai-for-finance/solution/arima_model.ipynb
apache-2.0
!pip install --user statsmodels %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime %config InlineBackend.figure_format = 'retina' """ Explanation: Building an ARIMA Model for a Financial Dataset In this notebook, you will build an ARIMA model for AAPL stock clo...
NYUDataBootcamp/Projects
MBA_S16/Gurmen-Manos-Shaikh-College.ipynb
mit
import pandas as pd # data package import matplotlib.pyplot as plt # graphics import sys # system module, used to get Python version import os # operating system tools (check files) import datetime as dt # date tools, used to note current date import ...
thom056/ada-parliament-ML
01-Scraping/05-FormatPersonInfo.ipynb
gpl-2.0
import pandas as pd import numpy as np import glob import os # There's a lot of columns in the DF. # Therefore, we add this option so that we can see more columns pd.options.display.max_columns = 100 """ Explanation: 05 - Format Personal Information From the scraped data from MemberCouncil, we want to format a file c...
blakeflei/IntroScientificPythonWithJupyter
09 - Ordinary Differential Equation (ODE) Examples.ipynb
bsd-3-clause
# Python imports import numpy as np import matplotlib.pyplot as plt %matplotlib inline from scipy.misc import derivative from scipy import integrate """ Explanation: Integration and derivatives: Many systems are represented dynamically and present the need for some simple calculus. Derivatives and integrals are impor...
andsor/pypercolate
docs/hpc-performance/pypercolate-hpc-performance.ipynb
isc
# configure plotting %config InlineBackend.rc = {'figure.dpi': 300, 'savefig.dpi': 300, \ 'figure.figsize': (6, 3), 'font.size': 12, \ 'figure.facecolor': (1, 1, 1, 0)} %matplotlib inline import timeit import matplotlib.pyplot as plt import memory_profiler impor...
mne-tools/mne-tools.github.io
0.19/_downloads/5f84ce88b4773e5ca1f9b3502aef334a/plot_eeg_erp.ipynb
bsd-3-clause
import mne from mne.datasets import sample """ Explanation: EEG processing and Event Related Potentials (ERPs) For a generic introduction to the computation of ERP and ERF see tut_epoching_and_averaging. :depth: 1 End of explanation """ data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_au...
mathnathan/notebooks
JSD_Example.ipynb
mit
from PIL import Image import numpy as np luke = Image.open("/home/nathan/Downloads/Luke_Van_Poppering.jpeg") luke.thumbnail((300,300)) # Thanks for this, John.... john = Image.open("/home/nathan/Downloads/John_Abascal.jpg") john.thumbnail((300,300)) luke john """ Explanation: Calculate Jensen-Shannon Divergence Bet...
DBWangGroupUNSW/COMP6714
GradientDescend.ipynb
mit
import torch torch.manual_seed(42) # fix the seed; easy to debug """ Explanation: Gradient Descend We will construct a simple linear model and see how Gradient Descend algorithm helps us to find the best parameters. End of explanation """ u = torch.randint(10, (5, 1)) v = torch.randint(10, (5, 1)) print(u) print(v)...
zczapran/datascienceintensive
naive_bayes/Mini_Project_Naive_Bayes.ipynb
mit
%matplotlib inline import numpy as np import scipy as sp import matplotlib as mpl import matplotlib.cm as cm import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from six.moves import range # Setup Pandas pd.set_option('display.width', 500) pd.set_option('display.max_columns', 100) pd.set_option('...
mercye/foundations-homework
05/Spotify_graded.ipynb
mit
import requests # query = 'lil' type = 'artist' number of responses(limit) = '50' market = 'US' response = requests.get('https://api.spotify.com/v1/search?q=lil&type=artist&limit=50&market=US') # data is a string, use json data = response.json() # print(type(data)) # print(data.keys()) # print(type(data['artists']))...
GoogleCloudPlatform/training-data-analyst
courses/dataflow/demos/beam_notebooks/beam_notebooks_demo.ipynb
apache-2.0
# Python's regular expression library import re # Beam and interactive Beam imports import apache_beam as beam from apache_beam.runners.interactive.interactive_runner import InteractiveRunner import apache_beam.runners.interactive.interactive_beam as ib # Dataframe API imports from apache_beam.dataframe.convert impor...
Vvkmnn/books
AutomateTheBoringStuffWithPython/lesson17.ipynb
gpl-3.0
eggs = { 'name': 'Zophie', 'species': 'cat', 'age': 8 } ham = { 'species': 'cat', 'name': 'Zophie', 'age': 8 } print(eggs) print(ham) """ Explanation: Lesson 17: The Dictionary Data Type Switched to the Jupyter Notebook for REPL convenience. Dictionaries use key pairs to store values...
amercer1/titanic_data_exploration
titanic_walkthrough.ipynb
bsd-3-clause
df = pd.read_csv("data/train.csv") df.head() df.tail() """ Explanation: Lets load in the dataset End of explanation """ df.dtypes df.info() df.describe() """ Explanation: Lets see the types that were imported on our behalf End of explanation """ df.shape """ Explanation: See the shape of the dataset End of ex...
kingb12/languagemodelRNN
old_comparisons/noing10_LSTM_v_BOW.ipynb
mit
report_files = ["/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing10_200_512_04drb/encdec_noing10_200_512_04drb.json", "/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing10_bow_200_512_04drb/encdec_noing10_bow_200_512_04drb.json"] log_files = ["/Users/bking/IdeaProjects/...
jamesfolberth/NGC_STEM_camp_AWS
notebooks/machineLearning_notebooks/01_Naive_Bayes/Day 3 - Probability and Statistics - Morning.ipynb
bsd-3-clause
import matplotlib.pyplot as plt plt.style.use('seaborn-whitegrid') import numpy as np fig = plt.figure() ax = plt.axes() x = np.array((5,3,7,4,2)) ax.scatter(x,np.zeros(len(x)), s=75, label = 'Values') ax.scatter(4.2,0, s=75, label = 'Mean') ax.legend() """ Explanation: Introduction to Probability and Statistics! In...
gloriakang/vax-sentiment
to_do/vax_temp/test.ipynb
mit
import pandas as pd import numpy as np import networkx as nx from copy import deepcopy import matplotlib.pyplot as plt %matplotlib inline from matplotlib.backends.backend_pdf import PdfPages from glob import glob fileName = 'article0' def getFiles(fileName): matches = glob('*'+fileName+'*') bigFile = matches...
PDBeurope/PDBe_Programming
search_interface/notebooks/Timeline.ipynb
apache-2.0
import pandas PDBE_SOLR_URL = "http://www.ebi.ac.uk/pdbe/search/pdb" # or https://www.ebi.ac.uk/pdbe/search/pdb/select?rows=0&q=status:REL&wt=json from mysolr import Solr solr = Solr(PDBE_SOLR_URL, version=4) response = solr.search(**{ "rows" : 0, # "fl" : "deposition_year", "q" : '...
jgrizou/explauto
notebook/Learning the IK of the arm of a simulated Poppy using Explauto.ipynb
gpl-3.0
from poppy.creatures import PoppyHumanoid poppy = PoppyHumanoid(simulator='vrep') """ Explanation: Learning the IK of the arm of a Poppy robot using Explauto Explauto comes with a PoppyEnvironment which links a Poppy robot to the explauto framework. Those robots, also developed in the Flowers team, were designed as ...
IanHawke/maths-with-python
06-numpy-plotting.ipynb
mit
x = [1, 2, 3] y = [4, 9, 16] print(x+y) """ Explanation: Scientific Python A lot of computational algorithms are expressed using Linear Algebra terminology - vectors and matrices. This is thanks to the wide range of methods within Linear Algebra for solving the sort of problems that computers are good at solving! With...
Naereen/notebooks
Extending_lolviz_with_a_unified_display_function_that_chooses_the_best_one_based_on_the_datatype.ipynb
mit
%load_ext watermark %watermark -v -m -p lolviz import lolviz """ Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Extending-lolviz-with-a-unified-display-function-that-chooses-the-best-one-based-on-the-datatype" data-toc-modified-id="Extend...
NYUDataBootcamp/Projects
UG_S17/Madhok-Rinkacs-Yao-USFlightDelays.ipynb
mit
import sys # system module import pandas as pd # data package import matplotlib.pyplot as plt # graphics module import datetime as dt # date and time module import numpy as np import seaborn as sns %matplotlib inline sns.set_style('whitegr...
jsub10/MLCourse
Notebooks/Ensemble-Prediction-Techniques.ipynb
mit
import numpy as np from scipy import stats import matplotlib.pyplot as plt %matplotlib inline def clf_preds(accuracy, truth_vector): # accuracy of classifier # truth_vector is the actual value of the target preds = [] for i in range(len(truth)): pred = np.random.choice([truth[i], 1-truth[i]], p...
RittmanResearch/maybrain
docs/06 - The algorithms Package.ipynb
apache-2.0
%matplotlib inline import networkx as nx import matplotlib.pyplot as plt from maybrain import utils from maybrain import resources as rr from maybrain import brain as mbt from maybrain import algorithms as mba from maybrain import constants as ct from maybrain.plotting import histograms as hh a = mbt.Brain() a.import...
jld23/saspy
sas_tabulate_example.ipynb
apache-2.0
import saspy sas = saspy.SASsession(cfgname='default') cars = sas.sasdata('cars', 'sashelp') cars.head() """ Explanation: SASPy Tabulation for Descriptive Statistics This notebook demonstrates the usage of a powerful set of tools for descriptive statistics and nesting data in SASPy, powered by the TABULATE procedure....
metpy/MetPy
v0.11/_downloads/591c50ddf519b58966833b985f7ca28b/Parse_Angles.ipynb
bsd-3-clause
import metpy.calc as mpcalc """ Explanation: Parse angles Demonstrate how to convert direction strings to angles. The code below shows how to parse directional text into angles. It also demonstrates the function's flexibility in handling various string formatting. End of explanation """ dir_str = 'SOUTH SOUTH EAST'...
shirtsgroup/physical-validation
doc/examples/ensemble_check.ipynb
lgpl-2.1
# enable plotting in notebook %matplotlib notebook """ Explanation: Ensemble check Note: This notebook can be run locally by cloning the Github repository. The notebook is located in doc/examples/ensemble_check.ipynb. Be aware that probabilistic quantities such as error estimates based on bootstrapping will differ whe...
jegibbs/phys202-2015-work
assignments/assignment06/DisplayEx01.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot as plt from IPython.html.widgets import interact, interactive, fixed from IPython.display import display from IPython.html import widgets from IPython.display import Image assert True # leave this to grade the import statements """ Explanation: Disp...
kwant-project/kwant-tutorial-2016
3.1.Aharonov-Bohm.ipynb
bsd-2-clause
from math import pi %run matplotlib_setup.ipy from matplotlib import pyplot import numpy as np import kwant lat=kwant.lattice.square() L,W=30,16 def myshape(R): return ( (R[0]**2 + R[1]**2) > (L-W/2)**2 and (R[0]**2 + R[1]**2) < (L+W/2)**2) H=kwant.Builder() H[lat.shape(myshape,(L,0)...
karlstroetmann/Artificial-Intelligence
Python/3 Games/Connect-Four-Frame.ipynb
gpl-2.0
gPlayers = [ 'X', 'O' ] """ Explanation: Connect Four This notebook defines the game Connect Four. Connect Four is played on a board of dimension $6 \times 7$, i.e. there are $6$ rows $7$ columns. Instead of Red and Yellow we call the players X and O. Player X starts. Player X and O take turns to choose columns tha...
nyirock/mg_blast_wrapper
wps2_blast_pp_metagenome_v1.4.ipynb
mit
from Bio import SeqIO import time import os import shutil import pandas #parameters version = 'v1.4' project_name = 'wps2_bl_metagenome' e_value = 1e-20 iden = 95.0 metric = 50.0 !cat ../ss_genomes/AP_WPS-2_bacterium* > ../ss_genomes/all_AP_WPS-2_bacterium.fna !makeblastdb -in ../ss_genomes/all_AP_WPS-2_bacterium.fn...
mne-tools/mne-tools.github.io
0.23/_downloads/1f2e88712289c5315357ca3b8efc1bbb/sensor_connectivity.ipynb
bsd-3-clause
# Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD (3-clause) import mne from mne.connectivity import spectral_connectivity from mne.datasets import sample from mne.viz import plot_sensors_connectivity print(__doc__) """ Explanation: Compute all-to-all connectivity in sensor space Computes the Ph...
feststelltaste/software-analytics
prototypes/Reading a Git log file output with Pandas SCRATCHBOOK.ipynb
gpl-3.0
import pandas as pd from io import StringIO commits_raw = pd.read_csv(StringIO(log), sep="#", header=None, names=['file_stats','sha', 'date', 'author']) commits_raw.head() """ Explanation: After this, we have to tell Git which information we want. We can do this via the <tt>pretty-format</tt> option....
UIUC-iSchool-DataViz/spring2017
week07/examples_week07.ipynb
mit
%matplotlib inline """ Explanation: Examples: Week 7 This week, we will apply some of our discussions around filtering, splitting and so on to build out comparisons between different variables within the World Bank Economic Indicators dataset. This dataset, which covers 1960-2016, 264 countries and 1452 variables, can...
julienchastang/unidata-python-workshop
notebooks/Primer/Primer.ipynb
mit
# Convention for import to get shortened namespace import numpy as np # Create an array for testing a = np.arange(12).reshape(3, 4) a """ Explanation: <div style="width:1000 px"> <div style="float:right; width:98 px; height:98px;"> <img src="https://raw.githubusercontent.com/Unidata/MetPy/master/metpy/plots/_static...
takanory/python-machine-learning
Chapter13.ipynb
mit
import theano from theano import tensor as T # 初期化: scalar メソッドではスカラー(単純な配列)を生成 x1 = T.scalar() w1 = T.scalar() w0 = T.scalar() z1 = w1 * x1 + w0 # コンパイル net_input = theano.function(inputs=[w1, x1, w0], outputs=z1) # 実行 net_input(2.0, 1.0, 0.5) """ Explanation: 第13章 ニューラルネットワーク 著者オリジナル: https://github.com/rasbt/py...
rmhyman/DataScience
Intro To Data Science Lesson 2.ipynb
mit
import numpy as np import pandas as pd df = pd.read_csv('Master.csv') df.head(5) """ Explanation: Intro to Data Wrangling Data Wrangling is the concept of arranging your dataset into a workable format for analysis. When retreiving data from various sources, it is not always in a format that is ready to be analyzed. ...
smorton2/think-stats
code/chap05ex.ipynb
gpl-3.0
from __future__ import print_function, division %matplotlib inline import numpy as np import nsfg import first import analytic import thinkstats2 import thinkplot """ Explanation: Examples and Exercises from Think Stats, 2nd Edition http://thinkstats2.com Copyright 2016 Allen B. Downey MIT License: https://opensou...
icrtiou/coursera-ML
ex5-bias vs variance/4- polynomial regression.ipynb
mit
lr.poly_features(X, power=3) """ Explanation: create polynomial features End of explanation """ X_poly, Xval_poly, Xtest_poly= lr.prepare_poly_data(X, Xval, Xtest, power=8) X_poly[:3, :] """ Explanation: prepare polynomial regression data expand feature with power = 8, or any power you want to use Apply normaliza...
stanmoore1/lammps
python/examples/pylammps/interface_usage_bonds.ipynb
gpl-2.0
from lammps import IPyLammps L = IPyLammps() # 2d circle of particles inside a box with LJ walls import math b = 0 x = 50 y = 20 d = 20 # careful not to slam into wall too hard v = 0.3 w = 0.08 L.units("lj") L.dimension(2) L.atom_style("bond") L.boundary("f f p") L.lattice("hex", 0.85) L.region("...
graphistry/pygraphistry
demos/demos_databases_apis/neo4j/official/graphistry_bolt_tutorial_public.ipynb
bsd-3-clause
#!pip install --user pandas #!pip install --user graphistry[bolt] ### ADVANCED: ### If you already have the neo4j python driver, you can leave out '[bolt]': ### !pip install --user graphistry ### If you already have graphistry but not neo4j, you can reuse your existing graphistry: ### !pip install --user neo4j """ Ex...
danresende/deep-learning
reinforcement/Q-learning-cart.ipynb
mit
import gym import tensorflow as tf import numpy as np """ Explanation: Deep Q-learning In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p...
laowantong/mocodo
doc/fr_refman.ipynb
mit
%%mocodo --mld --colors ocean --shapes copperplate --relations diagram markdown_data_dict DF, 11 Élève, 1N Classe Classe: Num. classe, Num. salle Faire Cours, 1N Classe, 1N Prof: Vol. horaire Catégorie: Code catégorie, Nom catégorie Élève: Num. élève, Nom élève Noter, 1N Élève, 0N Prof, 0N Matière, 1N Date: Note Prof:...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_forward.ipynb
bsd-3-clause
import mne from mne.datasets import sample data_path = sample.data_path() # the raw file containing the channel location + types raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif' # The paths to freesurfer reconstructions subjects_dir = data_path + '/subjects' subject = 'sample' """ Explanation: Head model a...
pligor/predicting-future-product-prices
04_time_series_prediction/37_price_history_clustering.ipynb
agpl-3.0
factors(689) max_seq_len = 682 data_path = '../../../../Dropbox/data' phae_path = data_path + '/price_hist_autoencoder' npz_dates = phae_path + '/price_history_full_seqs_dates.npz' assert path.isfile(npz_dates) npz_train = phae_path + '/price_history_seqs_dates_normed_train.npz' assert path.isfile(npz_train) npz_...
jorisvandenbossche/2015-EuroScipy-pandas-tutorial
02 - Data structures.ipynb
bsd-2-clause
df = pd.read_csv("data/titanic.csv") df.head() """ Explanation: Tabular data End of explanation """ df['Age'].hist() """ Explanation: Starting from reading this dataset, to answering questions about this data in a few lines of code: What is the age distribution of the passengers? End of explanation """ df.groupb...
folivetti/BIGDATA
Spark/Lab03.ipynb
mit
# Data for manual OHE # Note: the first data point does not include any value for the optional third feature sampleOne = [(0, 'mouse'), (1, 'black')] sampleTwo = [(0, 'cat'), (1, 'tabby'), (2, 'mouse')] sampleThree = [(0, 'bear'), (1, 'black'), (2, 'salmon')] sampleDataRDD = sc.parallelize([sampleOne, sampleTwo, sampl...
HeyIamJames/bikeshare
BikeShareStep2.ipynb
mit
import pandas as pd import numpy as np from pandas import Series, DataFrame weather = pd.read_table('daily_weather.tsv') weather.groupby('season_desc').agg({'temp': np.mean}) fix = weather.replace("Fall", "Summer_").replace("Summer", "Spring_").replace("Winter", "Fall_").replace("Spring", "Winter_") weather.grou...
tpin3694/tpin3694.github.io
statistics/variance_and_standard_deviation.ipynb
mit
# Import data import math """ Explanation: Title: Variance And Standard Deviation Slug: variance_and_standard_deviation Summary: Calculating Variance And Standard Deviation in Python. Date: 2016-02-08 12:00 Category: Statistics Tags: Basics Authors: Chris Albon Preliminary End of explanation """ # Create list o...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/5a_train_keras_ai_platform_babyweight.ipynb
apache-2.0
import os """ Explanation: LAB 5a: Training Keras model on Cloud AI Platform. Learning Objectives Setup up the environment Create trainer module's task.py to hold hyperparameter argparsing code Create trainer module's model.py to hold Keras model code Run trainer module package locally Submit training job to Cloud A...
google/starthinker
colabs/bigquery_census_normalize.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: Census Data Normalized Convert given census table to percent of population, normalizing it. License Copyright 2020 Google LLC, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the...
jonathf/chaospy
docs/user_guide/advanced_topics/seir_model.ipynb
mit
def ode_seir(variables, coordinates, parameters): var_s, var_e, var_i, var_r = variables alpha, beta, gamma = parameters delta_s = -beta*var_i*var_s delta_e = beta*var_i*var_s-alpha*var_e delta_i = -gamma*var_i+alpha*var_e delta_r = gamma*var_i return delta_s, delta_e, delta_i, del...
diging/tethne-notebooks
1. Working with data from the Web of Science.ipynb
gpl-3.0
print "This is a code cell!" """ Explanation: Introduction to Tethne: Working with data from the Web of Science In this notebook we will take our first steps with the Tethne Python package. We'll parse some bibliographic records from the ISI Web of Science, and take a look at the Corpus class and its various features....
metpy/MetPy
dev/_downloads/3f80eaf969d597174a3c39544b2f3037/Mesonet_Stationplot.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, StationPlot from metpy.units import units """ Explanation: Mesonet Station Plot Make a surface sta...
DJCordhose/ai
notebooks/workshops/d2d/cnn-prediction.ipynb
mit
import warnings warnings.filterwarnings('ignore') %matplotlib inline %pylab inline import matplotlib.pylab as plt import numpy as np from distutils.version import StrictVersion import sklearn print(sklearn.__version__) assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1') import tensorflow as tf t...
ES-DOC/esdoc-jupyterhub
notebooks/bnu/cmip6/models/sandbox-2/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: BNU Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
pyro-ppl/numpyro
notebooks/source/truncated_distributions.ipynb
apache-2.0
!pip install -q git+https://github.com/pyro-ppl/numpyro.git import jax import jax.numpy as jnp import matplotlib.pyplot as plt import numpy as np import numpyro import numpyro.distributions as dist from jax import lax, random from jax.scipy.special import ndtr, ndtri from jax.scipy.stats import poisson, norm from nump...
ALEXKIRNAS/DataScience
CS231n/assignment2/PyTorch.ipynb
mit
import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from torch.utils.data import sampler import torchvision.datasets as dset import torchvision.transforms as T import numpy as np import timeit """ Explanation: Training a ConvNet ...
ioos/notebooks_demos
notebooks/2017-11-01-Creating-Archives-Using-Bagit.ipynb
mit
import os import pandas as pd fname = os.path.join("data", "dsg", "timeseriesProfile.csv") df = pd.read_csv(fname, parse_dates=["time"]) df.head() """ Explanation: Using BagIt to tag oceanographic data BagIt is a packaging format that supports storage of arbitrary digital content. The "bag" consists of arbitrary co...
dit/dit
examples/Time Series Analysis.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import dit from dit.inference import binned, dist_from_timeseries from dit.multivariate import total_correlation as I, intrinsic_total_correlation as IMI dit.ditParams['repr.print'] = True """ Explanation: Time Series Analysis One important area o...
Diyago/Machine-Learning-scripts
DEEP LEARNING/Pytorch from scratch/TODO/Autoencoders/linear-autoencoder/Simple_Autoencoder_Solution.ipynb
apache-2.0
import torch import numpy as np from torchvision import datasets import torchvision.transforms as transforms # convert data to torch.FloatTensor transform = transforms.ToTensor() # load the training and test datasets train_data = datasets.MNIST(root='data', train=True, download=True...
tritemio/multispot_paper
out_notebooks/usALEX-5samples-PR-raw-dir_ex_aa-fit-out-all-ph-17d.ipynb
mit
ph_sel_name = "all-ph" data_id = "17d" # ph_sel_name = "all-ph" # data_id = "7d" """ Explanation: Executed: Mon Mar 27 11:37:24 2017 Duration: 10 seconds. usALEX-5samples - Template This notebook is executed through 8-spots paper analysis. For a direct execution, uncomment the cell below. End of explanation """ f...
eford/rebound
ipython_examples/Resonances_of_Jupiters_moons.ipynb
gpl-3.0
import rebound import numpy as np %matplotlib inline import matplotlib.pyplot as plt sim = rebound.Simulation() sim.units = ('AU', 'days', 'Msun') # We can add Jupiter and four of its moons by name, since REBOUND is linked to the HORIZONS database. labels = ["Jupiter", "Io", "Europa","Ganymede","Callisto"] sim.add(l...
whitead/numerical_stats
unit_10/hw_2017/problem_set_3.ipynb
gpl-3.0
import matplotlib.pyplot as plt import numpy as np import pandas as pd data = pd.read_csv('november.csv') ind = data['center_diff_valid'] plt.plot(data['time'][ind] / (60 * 60 * 24), data['temp'][ind], '.') plt.ylabel('Temperature [F]') plt.xlabel('Days') plt.show() """ Explanation: Introduction We have two datasets ...
diminishedprime/.org
programmey_stuff/kaggle/titanic/titanic.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import scipy.stats as stats matplotlib.style.use('ggplot') """ Explanation: Titanic: this time with cross-validation And also a Neural Net End of explanation """ import math def scrub(filePath): data = p...
minxuancao/shogun
doc/ipython-notebooks/classification/Classification.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') from modshogun import * #Needed lists for the final plot classifiers_linear = []*10 classifiers_non_linear = []*10 classifiers_names = []*10 fadings = []*10 """ Explanation: Vi...
ClementPhil/deep-learning
transfer-learning/Transfer_Learning.ipynb
mit
from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm vgg_dir = 'tensorflow_vgg/' # Make sure vgg exists if not isdir(vgg_dir): raise Exception("VGG directory doesn't exist!") class DLProgress(tqdm): last_block = 0 def hook(self, block_num=1, block_size=1, total_s...
maartenbreddels/vaex
examples/science_pal5_tidal_tails.ipynb
mit
import vaex as vx import numpy as np import matplotlib.pylab as plt import scipy.ndimage.filters from astropy.coordinates import SkyCoord import numpy as np import xarray as xr %matplotlib inline # alias for gaussian filter gf = scipy.ndimage.filters.gaussian_filter """ Explanation: Finding Palomar 5's tidal tail in...
Hyperparticle/deep-learning-foundation
lessons/intro-to-tflearn/intro_to_tensorflow_solution.ipynb
mit
# Problem 1 - Implement Min-Max scaling for grayscale image data def normalize_grayscale(image_data): """ Normalize the image data with Min-Max scaling to a range of [0.1, 0.9] :param image_data: The image data to be normalized :return: Normalized image data """ a = 0.1 b = 0.9 grayscale...
probml/pyprobml
notebooks/book2/14/linreg_height_weight_numpyro.ipynb
mit
!pip install -q numpyro@git+https://github.com/pyro-ppl/numpyro !pip install -q arviz import numpy as np np.set_printoptions(precision=3) import matplotlib.pyplot as plt import math import os import warnings import pandas as pd import jax print("jax version {}".format(jax.__version__)) print("jax backend {}".format(...
ud3sh/coursework
deeplearning.ai/coursera-improving-neural-networks/week1/assignment2/Regularization+-+v2.ipynb
unlicense
# import packages import numpy as np import matplotlib.pyplot as plt from reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, load_2D_dataset, predict_dec from reg_utils import compute_cost, predict, forward_propagation, backward_propagation, update_parameters import sklearn import sklearn.da...
harmsm/pythonic-science
chapters/00_inductive-python/09_pandas.ipynb
unlicense
some_dict = {"x":{"a":1,"b":2,"c":3}, "y":{"a":4,"b":5,"c":6}} """ Explanation: Pandas Sometimes you want a spreadsheet. Starting point End of explanation """ # Answer some_dict["y"]["b"] """ Explanation: Write a piece of code that prints the number 5, taken from some_dict. End of explanation """ i...
eugeniopacceli/ComputerVision
quiz1/Quiz1-Calibration.ipynb
mit
import os import numpy as np import cv2 %matplotlib inline from matplotlib import pyplot as plt REALSQUARE = 23.500 # Size of a square BOARDDIM = (6,8) # Dimensions of the given board NUMIMG = 9 # Number of images to open imagesList = list() # Opens each image and adds to the image list PATH = "quiz1-data/" for fileN...
juditacs/snippets
feature_extraction/train_valid_test.ipynb
lgpl-3.0
import numpy as np # matrix dimensions N = 100 M = 20 # train-valid-test ratio, let's use 80-10-10 train_ratio = 0.8 valid_ratio = 0.1 test_ratio = 1.0 - train_ratio - valid_ratio # this is never used # array indices train_split = int(train_ratio * N) valid_split = int(valid_ratio * N) # create a random matrix X =...
km-Poonacha/python4phd
Session 1/ipython/Lesson 2 - Functions and Modules.ipynb
gpl-3.0
# FUNCTION DEFINITION def check_if_5(user_number): """This function just checks if the number passed to it is equal to 5. It returns 1 if the number is 5 and returns 0 if the number is not 5 """ if user_number == 5: return 1 else: return 0 #FUNCTION CALL return_val = check_if_5(5) if r...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_eco/td2a_eco_sql_correction.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 2A.eco - Python et la logique SQL - correction Correction d'exercices sur SQL. End of explanation """ import sqlite3 # on va se connecter à une base de données SQL vide # SQLite stocke la BDD dans un simple fichier filepath = "./DataBas...
statsmodels/statsmodels.github.io
v0.13.1/examples/notebooks/generated/deterministics.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pandas as pd plt.rc("figure", figsize=(16, 9)) plt.rc("font", size=16) """ Explanation: Deterministic Terms in Time Series Models End of explanation """ from statsmodels.tsa.deterministic import DeterministicProcess index = pd.RangeIndex(0, 100) det_proc = ...
GoogleCloudPlatform/datalab-samples
basemap/earthquakes.ipynb
apache-2.0
%bash echo 'Y' | apt-get install python-mpltoolkits.basemap """ Explanation: <h1> Geographic data in Datalab </h1> This notebook demonstrates how to use Datalab to display the earthquakes that have happened over the past 7 days. The data come from USGS, and we will use the Python module basemap to do the plotting. <h...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/hadgem3-gc31-lm/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-lm', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: MOHC Source ID: HADGEM3-GC31-LM Topic: Aerosol Sub-Topics: Transport, Emis...
rvuduc/cse6040-ipynbs
18--matrix-storage.ipynb
bsd-3-clause
import numpy as np """ Explanation: CSE 6040, Fall 2015 [18]: Matrix storage Today's lab continues Lab 16, which is a survey of techniques using Numpy, a Python module that provides fast primitives for multidimensional arrays. By the way, a partial solution set for Lab 16 is also available here. Downloads. For today's...
ES-DOC/esdoc-jupyterhub
notebooks/nasa-giss/cmip6/models/giss-e2-1g/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nasa-giss', 'giss-e2-1g', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NASA-GISS Source ID: GISS-E2-1G Topic: Seaice Sub-Topics: Dynamics, Thermody...
GoogleCloudPlatform/bigquery-notebooks
notebooks/community/analytics-componetized-patterns/retail/recommendation-system/bqml-scann/02_export_bqml_mf_embeddings.ipynb
apache-2.0
!pip install -U -q apache-beam[gcp] """ Explanation: Part 2: Process the item embedding data in BigQuery and export it to Cloud Storage This notebook is the second of five notebooks that guide you through running the Real-time Item-to-item Recommendation with BigQuery ML Matrix Factorization and ScaNN solution. Use th...
dnc1994/MachineLearning-UW
ml-regression/blank/week-1-simple-regression-assignment-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 1: Simple Linear Regression In this notebook we will use data on house sales in King County to predict house prices using simple (one input) linear regression. You will: * Use graphlab SArray and SFrame functions to compute important summary statistics * Write a functio...
4dsolutions/Python5
Pi Day Fun.ipynb
mit
from IPython.display import YouTubeVideo YouTubeVideo("HrRMnzANHHs") """ Explanation: Pi Day Fun March 14, 2016 Updated since. End of explanation """ from fractions import Fraction from itertools import count, islice from decimal import Decimal, localcontext def convert(f): """get a Decimal from a Fraction (and...
fullmetalfelix/ML-CSC-tutorial
NeuralNetwork - Intro.ipynb
gpl-3.0
# --- INITIAL DEFINITIONS --- from sklearn.neural_network import MLPRegressor import numpy, math, random import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # This function takes a 2-element vector p=[x,y] and computes z def Model(p): result = math.sin(0.4*p[0] - 0.3*p[1] + 0.2*p[0]*p[1]) ...
SSDS-Croatia/SSDS-2017
Day-5/Day 5 - Vanilla GAN Solved.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import os, util """ Explanation: Data Science Summer School - Split '17 5. Generating images of digits with Generative Adversarial Networks End of explanation """ data_folder = 'data'; da...
ES-DOC/esdoc-jupyterhub
notebooks/csir-csiro/cmip6/models/vresm-1-0/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'csir-csiro', 'vresm-1-0', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: CSIR-CSIRO Source ID: VRESM-1-0 Sub-Topics: Radiative Forcings. Propert...
cherepaha/PyDLV
demos/dlv_tutorial.ipynb
gpl-3.0
import os from pydlv import data_reader, derivative_calculator dr = data_reader.DataReader() dc = derivative_calculator.DerivativeCalculator() data = dr.read_data(path='../../../../data/scirep_locdyn') # rewards_sum defines the experimental conditions to be analysed (see data description on OSF for details) # reward ...
r31415smith/intro_python
Crash Course v0.62.ipynb
lgpl-3.0
import matplotlib.pyplot as plt import numpy as np %matplotlib inline """ Explanation: A Crash Course in Python for Scientists Rick Muller, Sandia National Laboratories version 0.62, Updated Dec 15, 2016 by Ryan Smith, Cal State East Bay Using Python 3.5.2 | Anaconda 4.1.1 This work is licensed under a Creative Commo...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_receptive_field1.ipynb
bsd-3-clause
# Authors: Chris Holdgraf <choldgraf@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) # sphinx_gallery_thumbnail_number = 7 import numpy as np import matplotlib.pyplot as plt import mne from mne.decoding import ReceptiveField, TimeDelayingRidge from scipy.stats import multivar...
jonnydyer/pypropep
ipython_doc/BasicUsage.ipynb
gpl-3.0
help(ppp.init) ppp.init() """ Explanation: Initalization First we must initalize the library to load the thermo and propellant files. Note that they can be overriden in the init function. End of explanation """ print ppp.PROPELLANT_FILE print ppp.THERMO_FILE """ Explanation: Custom Data files The propellant and th...
idekerlab/vizbi-2015
tutorials/Lesson_1_Introduction_to_cyREST.ipynb
mit
# HTTP Client for Python import requests # Standard JSON library import json # Basic Setup PORT_NUMBER = 1234 # This is the default port number of CyREST """ Explanation: VIZBI Tutorial Session Part 2: Cytoscape, IPython, Docker, and reproducible network data visualization workflows Tuesday, 3/24/2015 Lesson 1: Intr...
myuuuuun/ichimura_seminar
inagaki/inagaki_ch11.ipynb
mit
%matplotlib inline import math import numpy as np import scipy.stats as stats import matplotlib as mpl import matplotlib.pyplot as plt plt.rcParams['font.size'] = 13 # 日本語対応 mpl.rcParams['font.family'] = 'Osaka' """ Explanation: 稲垣数理統計 Chapter11 問題 End of explanation """ data = np.array([ [167, 59], ...
mne-tools/mne-tools.github.io
0.24/_downloads/1a105d401683707ed0696f30397d6253/40_artifact_correction_ica.ipynb
bsd-3-clause
import os import mne from mne.preprocessing import (ICA, create_eog_epochs, create_ecg_epochs, corrmap) sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_filt-0-...
simonschmoll/ActivityRecognition
P22 Activity Recognition.ipynb
apache-2.0
# General Imports for more than one file import pandas as pd import numpy as np # For reading the CSV from pandas import read_csv # Imports for the classification from sklearn.metrics import confusion_matrix from sklearn.metrics import f1_score from sklearn.model_selection import cross_validate from sklearn.ensemble...
bekbote/project_repository
0420_PytorchIntro_1555587538086.ipynb
apache-2.0
import torch import numpy as np import matplotlib.pyplot as plt """ Explanation: <a href="https://colab.research.google.com/github/bekbote/project_repository/blob/master/0420_PytorchIntro_1555587538086.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>...
fsilva/deputado-histogramado
notebooks/Deputado-Histogramado-3.ipynb
gpl-3.0
%matplotlib inline import pylab import matplotlib import pandas import numpy dateparse = lambda x: pandas.datetime.strptime(x, '%Y-%m-%d') sessoes = pandas.read_csv('sessoes_democratica_org.csv',index_col=0,parse_dates=['data'], date_parser=dateparse) """ Explanation: Deputado Histogramado expressao.xyz/deputado/ Co...
pombredanne/gensim
docs/notebooks/WMD_tutorial.ipynb
lgpl-2.1
from time import time start_nb = time() # Initialize logging. import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s') sentence_obama = 'Obama speaks to the media in Illinois' sentence_president = 'The president greets the press in Chicago' sentence_obama = sentence_obama.lower().split()...
rgbkrk/commuter
packages/server/examples/display-updates.ipynb
bsd-3-clause
print("typical output") """ Explanation: Outputs you can update by name This notebook demonstrates the new name-based display functionality in the notebook. Previously, notebooks could only attach output to the cell that was currently being executed: End of explanation """ # a temporary patch of display for demonstr...