repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
FluVigilanciaBR/fludashboard
Notebooks/Season_color_new_specs.ipynb
gpl-3.0
import pandas as pd from fludashboard.libs.flu_data import FluDB fluDB = FluDB() territory_name = 'Rio Grande do Sul' year=2016 territory_id = fluDB.get_territory_id_from_name(territory_name) dataset_from_id = { 1: 'srag', 2: 'sragflu', 3: 'obitoflu' } def contingency_alert(dataset_id: int, year: int, ter...
dsiufl/2015-Fall-Hadoop
notes/4-pyspark-example.ipynb
mit
import findspark import os findspark.init('/home/ubuntu/shortcourse/spark-1.5.1-bin-hadoop2.6') from pyspark import SparkContext, SparkConf conf = SparkConf().setAppName("pyspark-example").setMaster("local[2]") sc = SparkContext(conf=conf) """ Explanation: Example: Use pyspark to process GDELT event data GDELT: Globa...
zhmz90/CS231N
assign/assignment1/.ipynb_checkpoints/svm-checkpoint.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 # This is a bit of magic to make matplotlib figures appear inline in the # notebook rather than in a new window. #matplotlib inline #lt.rcParams['figure.figsize'] = (10....
ajhenrikson/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='main.0 (1).png') """ Explanation: Graphical excellence and integrity Find a data-focused visualization on one of the...
markdewing/qmc_algorithms
Variational/Variational_Helium.ipynb
mit
r1 = Symbol('r1') # magnitude of vector r1 (electron 1 to nucleus distance) r2 = Symbol('r2') # magnitude of vector r2 (electron 2 to nucleus distance) r12 = Symbol('r12') # |r2-r1| (magnitude of vector r2-r1) """ Explanation: Energy of a Helium atom The Hamiltonian for this system is $$-\frac{1}{2} (\nabla_1^2...
loldja/loldja.github.io
assets/code/blog/mta_cleaning.ipynb
mit
import pandas as pd import numpy as np import os %matplotlib inline import matplotlib.pyplot as plt # Data source: http://web.mta.info/developers/turnstile.html #Download all desired weeks from website, store them in a folder called ../data/mta_turnstiles # This will load combined CSV files that are in this folder in...
ES-DOC/esdoc-jupyterhub
notebooks/dwd/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: DWD Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties: 6...
gregversteeg/corex_topic
corextopic/example/corex_topic_example.ipynb
apache-2.0
import numpy as np import scipy.sparse as ss import matplotlib.pyplot as plt import corextopic.corextopic as ct import corextopic.vis_topic as vt # jupyter notebooks will complain matplotlib is being loaded twice from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectoriz...
mne-tools/mne-tools.github.io
0.20/_downloads/bc5044f9d3ef1d29067dd6b7d83ceed2/plot_20_visualize_epochs.ipynb
bsd-3-clause
import os import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False).crop(tmax=120) """ Explanation: Visualizing epo...
gatmeh/Udacity-deep-learning
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
Kulbear/deep-learning-nano-foundation
DLND-face-generation/dlnd_face_generation.ipynb
mit
data_dir = './data' # FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe" #data_dir = '/input' """ DON'T MODIFY ANYTHING IN THIS CELL """ import helper helper.download_extract('mnist', data_dir) helper.download_extract('celeba', data_dir) """ Explanation: Face Generation In this project, you'll use generative adv...
phungkh/phys202-2015-work
assignments/assignment03/NumpyEx02.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns """ Explanation: Numpy Exercise 2 Imports End of explanation """ def np_fact(n): """Compute n! = n*(n-1)*...*1 using Numpy.""" if n==0: return 1 else: a=np.arange(1.0, (n+1), 1.0) b= a.cump...
brandoncgay/deep-learning
image-classification/dlnd_image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' # Use Floyd's cifar-10 dataset if present floyd_cifar10...
tsarouch/data_science_references_python
regression/prediction_efficiency_baseline_study.ipynb
gpl-2.0
import pandas as pd import numpy as np def get_features_values_combinations(list_a, list_b): """ Returns a list of combinations of the values of e.g. from the lists list_a = ['L', 'M', 'W'] list_b = ['F', 'I', 'S'] we get the combinations: [('L', 'F'), ('L', 'I'), ('L', 'S'), ('M', 'F'), ('M'...
rileyrustad/pdxapartmentfinder
analysis/Second_Analysis.ipynb
mit
# start with imports import numpy as np import pandas as pd from pandas import DataFrame, Series import json import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline """ Explanation: This is my second attempt at creating a model using sklearn alogithms This time we'll be breaki...
alorozco53/RPYAApublic
Regression.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import LinearRegression from sklearn.linear_model import Ridge from semana2_datos import * """ Explanation: Regresión en Scikit-Learn End of explanation """ X_1 = np.a...
cesarcontre/Simulacion2017
Modulo3/Clase23_Repaso1(Mod.3).ipynb
mit
# Librería de cálculo simbólico import sympy as sym # Para imprimir en formato TeX from sympy import init_printing; init_printing(use_latex='mathjax') """ Explanation: Repaso (Módulo 3) El tema principal en este módulo fue optimización. Al finalizar este módulo, se espera que ustedes tengan las siguientes competencia...
rusty1s/embedded_gcnn
notebooks/speed_comparison.ipynb
mit
import sys sys.path.insert(0, '..') import time import matplotlib.pyplot as plt %matplotlib inline def plot_durations(t_current, t_other): print('Currently used version: {:.5f}s'.format(t_current)) print('Version of other package: {:.5f}s'.format(t_other)) print('=> {:.2f}%'.format(100 * (t_other - ...
SSQ/Coursera-UW-Machine-Learning-Classification
Week 5 PA 2/module-8-boosting-assignment-2.ipynb
mit
import numpy as np import pandas as pd import json import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Boosting a decision stump The goal of this notebook is to implement your own boosting module. Brace yourselves! This is going to be a fun and challenging assignment. Use SFrames to do some feature en...
PyLadiesCZ/pyladies.cz
original/v1/s005-modules/ostrava/Feedback k domácím projektům.ipynb
mit
soubor = open("soubor.txt", mode="r", encoding='utf-8') novy_soubor = open("soubor2.txt", mode="w", encoding='utf-8') for text in soubor: novy_soubor.write(text) print ("Soubor zkopírován.") soubor.close() novy_soubor.close() with open("soubor.txt", mode="r", encoding='utf-8') as soubor: with open("soubor2...
sraejones/phys202-2015-work
days/day11/Interpolation.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns """ Explanation: Interpolation Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy. End of explanation """ x = np.linspace(0,4*np.pi,10) x """ Explanation: Overview W...
maestrotf/pymepps
examples/example_plot_stationnc.ipynb
gpl-3.0
import pymepps import matplotlib.pyplot as plt """ Explanation: Load station data based on NetCDF files In this example we show how to load station data based on NetCDF files. The data is loaded with the pymepps package. Thanks to Ingo Lange we could use original data from the Wettermast for this example. In the follo...
ES-DOC/esdoc-jupyterhub
notebooks/mpi-m/cmip6/models/mpi-esm-1-2-hr/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mpi-m', 'mpi-esm-1-2-hr', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: MPI-M Source ID: MPI-ESM-1-2-HR Topic: Landice Sub-Topics: Glaciers, Ice. ...
ntung/ramp-elnino-Saigon
edaElNino-Saigon.ipynb
gpl-2.0
%matplotlib inline from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np import pandas as pd import xray # should be installed with pip import pyresample # should be installed with pip from sklearn.cross_validation import cross_val_score """ Explanation: <a href="http://www.datas...
newlawrence/poliastro
docs/source/examples/Propagation using Cowell's formulation.ipynb
mit
# Temporary hack, see https://github.com/poliastro/poliastro/issues/281 from IPython.display import HTML HTML('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>') import numpy as np from astropy import units as u from matplotlib import pyplot as plt...
agile-geoscience/gio
docs/userguide/Read_Surfer_grids.ipynb
apache-2.0
!head ../data/Surfer/surfer-6-ascii-tiny.grd import gio da = gio.read_surfer('../data/Surfer/surfer-6-ascii-tiny.grd') da da.max() """ Explanation: Read surfer grids There are 3 varieties: Surfer 6 binary Surfer 6 ASCII Surfer 7 binary In theory we can read all of these, but I don't have a Surfer 6 binary file to...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_python_intro.ipynb
bsd-3-clause
a = 3 print(type(a)) b = [1, 2.5, 'This is a string'] print(type(b)) c = 'Hello world!' print(type(c)) """ Explanation: Introduction to Python Python is a modern, general-purpose, object-oriented, high-level programming language. First make sure you have a working python environment and dependencies (see install_pytho...
phungkh/phys202-2015-work
assignments/assignment08/InterpolationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.interpolate import interp1d """ Explanation: Interpolation Exercise 1 End of explanation """ """with np.load('trajectory.npz') as data: #http://docs.scipy.org/doc/numpy/reference/generated/numpy.load.html t =...
JorisBolsens/PYNQ
Pynq-Z1/notebooks/examples/pmod_tmp2.ipynb
bsd-3-clause
from pynq import Overlay Overlay("base.bit").download() from pynq.iop import Pmod_TMP2 from pynq.iop import PMODB mytmp = Pmod_TMP2(PMODB) temperature = mytmp.read() print(str(temperature) + " C") """ Explanation: PmodTMP2 Sensor example In this example, the Pmod temperature sensor is initialized and set to log a r...
tuwien-musicir/rp_extract
RP_extract_Tutorial.v4.ipynb
gpl-3.0
# to install iPython notebook on your computer, use this in Terminal sudo pip install "ipython[notebook]" """ Explanation: <center><h1>Rhythm and Timbre Analysis from Music</h1></center> <center><h2>Rhythm Pattern Music Features</h2></center> <center><h2>Extraction and Application Tutorial</h2></center> <br> <center><...
sony/nnabla
tutorial/vae_unsupervised_learning.ipynb
apache-2.0
!pip install nnabla-ext-cuda100 !git clone https://github.com/sony/nnabla-examples.git %cd nnabla-examples """ Explanation: In this tutorial, we will show you how to implement variational auto-encoder (VAE) in NNabla, which can be a powerful model for unsupervised learning by estimating variational lower bound. VAE ca...
JohanSchott/Pade_approximants
python/Pade.ipynb
mit
%matplotlib notebook # import modules import numpy as np from scipy.optimize import leastsq from scipy.optimize import curve_fit import sys import matplotlib.pylab as plt def padeThiele(z,f,zut): ''' Thiele's reciprocal difference method. Input variables: z - complex. points in the complex plan...
cliburn/sta-663-2017
homework/04_Data_Munging.ipynb
mit
# Your answer here """ Explanation: Data Science Stack The following exercises give practice in the use of the Python data science stack, especially pandas for data manipulation and seaborn for quick statistical plotting. 1. (40 points) Read in the CSV file pokemon.csv in the local directory (Source: Kaggle). Do ...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_tf_dics.ipynb
bsd-3-clause
# Author: Roman Goj <roman.goj@gmail.com> # # License: BSD (3-clause) import mne from mne.event import make_fixed_length_events from mne.datasets import sample from mne.time_frequency import csd_epochs from mne.beamformer import tf_dics from mne.viz import plot_source_spectrogram print(__doc__) data_path = sample.da...
jaidevd/inmantec_fdp
notebooks/day4/01_intro_to_derivatives.ipynb
mit
import numpy as np from theano import tensor as T from theano import function from theano.gradient import jacobian import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['figure.figsize'] = 8, 6 plt.style.use('ggplot') %matplotlib inline """ Explanation: Derivatives in Theano End of explanation """ xx...
Diyago/Machine-Learning-scripts
DEEP LEARNING/Pytorch from scratch/TODO/GAN/gan-mnist/MNIST_GAN_Exercise.ipynb
apache-2.0
%matplotlib inline import numpy as np import torch import matplotlib.pyplot as plt from torchvision import datasets import torchvision.transforms as transforms # number of subprocesses to use for data loading num_workers = 0 # how many samples per batch to load batch_size = 64 # convert data to torch.FloatTensor tr...
guyk1971/deep-learning
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
harmsm/pythonic-science
chapters/03_dealing-with-files/01_parsing-a-pdb.ipynb
unlicense
#record atom_name chain x y z occupancy atom_type # | | | | | | | | #ATOM 1086 CG LYS A 141 -4.812 9.683 2.584 1.00 26.78 N0 # | | | | # atom_...
kubeflow/testing
scripts/Flakiness_report.ipynb
apache-2.0
%load_ext google.cloud.bigquery """ Explanation: Kubeflow test flakiness report This notebook reports kubeflow test flakiness. We leverqe kettle which uploads test metadata into bigquery upon publishing in GCS buckets via Prow. We also customize flakiness queries used in k8s infra-test metrics to compute daily flakine...
Santana9937/Classification_ML_Specialization
Week_2_Learning_Linear_Classifiers/week_2_assign_1_lin_class_scratch.ipynb
mit
import os import zipfile import string import numpy as np import pandas as pd from sklearn import linear_model from sklearn.feature_extraction.text import CountVectorizer import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set_style('darkgrid') %matplotlib inline """ Explanation: Impleme...
mne-tools/mne-tools.github.io
0.23/_downloads/d76fc6b994433139acc22a226164eadd/receptive_field_mtrf.ipynb
bsd-3-clause
# Authors: Chris Holdgraf <choldgraf@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # Nicolas Barascud <nicolas.barascud@ens.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt from scipy.io import loadmat from os.path import join import mne from mne.decoding impor...
ceos-seo/Data_Cube_v2
agdc-v2/contrib/notebooks/Catapult Project - L-Band Gamma0 SAR example.ipynb
apache-2.0
from pprint import pprint %matplotlib inline from matplotlib import pyplot as plt import xarray import datacube.api dc = datacube.api.API() alos2 = dc.get_dataset(product='gamma0', platform='ALOS_2', y=(-42.55,-42.57), x=(147.55,147.57), variables=['hh_gamma0', 'hv_gamma0...
thmp/qmc
Variational Monte Carlo.ipynb
mit
import numpy as np import numpy.random as random N = 10 # number of walkers delta = 0.1 # step size """ Explanation: Quantum Monte Carlo for Optimization Quantum Monte Carlo methods were originally developed to solve the Schrödinger equation for many-body systems, which cannot be exactly solved by numerical means. Wh...
madsenmj/ml-introduction-course
Class11/Class11.ipynb
apache-2.0
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns irisdf = pd.read_csv('../Class01/Class01_iris_data.csv') irisdf.columns=['sepalLen','sepalWid','petalLen','petalWid','target'] irisdf.head() # Plot the data to see what we are working with sns.pairplot(irisdf, hue='target') """ Explanation: Cl...
ManuSetty/wishbone
notebooks/Wishbone_for_single_cell_RNAseq.ipynb
gpl-2.0
import wishbone # Plotting and miscellaneous imports import os import matplotlib import matplotlib.pyplot as plt %matplotlib inline """ Explanation: <h3>Wishbone for single cell RNA-seq</h3> <h4>Table of contents</h4> <br/> <a href='#intro'>Introduction</a> <br/> <a href='#data'>Loading data</a> <br/> <a href='#pre...
kkamb/miniprojects
Yelp_NLP.ipynb
mit
class HandleGZippedJSON: def __init__(self, url): self.url = url self.json_data = None def run(self): request = urllib2.Request(self.url) request.add_header('Accept-encoding', 'gzip') opener = urllib2.build_opener() f = opener.open(request) c_data = f.re...
chainsawriot/pycon2016hk_sklearn
Super_readl.ipynb
mit
import csv import re subsetData = open("SAsubset.csv", "r") for row in csv.DictReader(subsetData): print row['Sentiment'], row['SentimentText'] subsetData.close() """ Explanation: Data Preprocessing Use a small subset of data to experiment with the data preprocessing and feature extraction. Testing the CSV module ...
phanrahan/magmathon
notebooks/tutorial/coreir/Counter.ipynb
mit
import magma as m from mantle import Register """ Explanation: Counter To implement a counter we can use the Register primitive and the + operator. How can we make a more general counter of arbitray width? End of explanation """ class Counter(m.Generator): @staticmethod def generate(width: int): clas...
sidazhang/udacity-dlnd
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
armgilles/presentation
EPSI/I5/Qualite des donnees/EP1/notebook/Pokemon.ipynb
mit
pokemon = data[data.Generation == 1] """ Explanation: On souhaite regarder uniquement les pokémons de 1ère génération. Il va donc falloir filtrer nos données On va donc crée une nouvelle variable qui aura uniquement les pokémons de "Generation" = 1 End of explanation """ Image(url="http://i.giphy.com/yidUzHnBk32Um9a...
LucaCanali/Miscellaneous
Oracle_Jupyter/Oracle_IPython_sqlplus.ipynb
apache-2.0
%%bash sqlplus -s test/test@dbserver:1521/orcl.mydomain.com <<EOF set serveroutput on begin dbms_output.put_line('Hello world!'); end; / select sysdate from dual; EOF """ Explanation: Oracle SQL*Plus in IPython/Jupyter notebooks A simple example of how to query Oracle from a Jupyter notebook It runs sqlplus (ora...
sapohl/data-pipeline
reports/update-orphaning/Update orphaning analysis using longitudinal dataset.ipynb
mpl-2.0
import datetime as dt import urllib2 import ujson as json from os import environ %pylab inline """ Explanation: Update orphaning End of explanation """ starttime = dt.datetime.now() starttime """ Explanation: Get the time when this job was started (for debugging purposes). End of explanation """ channel_to_proce...
brentp/gemini
inheritance.ipynb
mit
import gemini.tests from gemini.tests.test_inheritance import TestFamily, family Sample = family.Sample HOM_REF, HET, UNKNOWN, HOM_ALT = range(4) fam = TestFamily(""" #family_id sample_id paternal_id maternal_id sex phenotype 1 dad 0 0 1 1 1 mom grandpa grandma 2 1 1 kid dad mom 1 2 ...
tensorflow/docs-l10n
site/ja/r1/tutorials/images/hub_with_keras.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...
vvishwa/deep-learning
face_generation/dlnd_face_generation.ipynb
mit
data_dir = './data' # FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe" #data_dir = '/input' """ DON'T MODIFY ANYTHING IN THIS CELL """ import helper helper.download_extract('mnist', data_dir) helper.download_extract('celeba', data_dir) """ Explanation: Face Generation In this project, you'll use generative adv...
cgivre/oreilly-sec-ds-fundamentals
Notebooks/Supervised/Supervised Example.ipynb
apache-2.0
import pandas as pd import itertools import matplotlib.pyplot as plt import numpy as np from sklearn import svm from sklearn.ensemble import RandomForestClassifier from sklearn.cross_validation import train_test_split from sklearn.model_selection import cross_val_score from sklearn.metrics import confusion_matrix from ...
dblyon/PandasIntro
Exercises_part_A.ipynb
mit
%%javascript $.getScript('misc/kmahelona_ipython_notebook_toc.js') """ Explanation: <h1 id="tocheading">Table of Contents</h1> <div id="toc"></div> End of explanation """ data = {'animal': ['cat', 'cat', 'snake', 'dog', 'dog', 'cat', 'snake', 'cat', 'dog', 'dog'], 'age': [2.5, 3, 0.5, np.nan, 5, 2, 4.5, np.n...
georgetown-analytics/yelp-classification
.ipynb_checkpoints/Mongo_Connect-checkpoint.ipynb
mit
from pymongo import MongoClient from datetime import datetime import json """ Explanation: __| __|_ ) _| ( / Amazon Linux AMI ___|\___|___| End of explanation """ ip = '54.236.23.221' """ Explanation: You have to change this variable each time the EC2 server stops or restarts. Please email/text me to ...
scotthuang1989/Python-3-Module-of-the-Week
data_structure/namedtuple — Tuple Subclass with Named Fields.ipynb
apache-2.0
import collections Person = collections.namedtuple('Person', 'name age') bob = Person(name='Bob', age=30) print('\nRepresentation:', bob) jane = Person(name='Jane', age=29) print('\nField by name:', jane.name) print('\nFields by index:') for p in [bob, jane]: print('{} is {} years old'.format(*p)) """ Explanat...
phoebe-project/phoebe2-docs
2.3/examples/diher_misaligned.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" """ Explanation: DI Her: Misaligned Binary In this example, we'll reproduce Figure 8 in the misalignment release paper (Horvat et al. 2018). <img src="horvat+18_fig8.png" alt="Figure 8" width="400px"/> Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (u...
pyrdr/charlas
intro_text_mining/notebooks/Text Mining.ipynb
mit
# Funcion para quitar todo el texto que este entre parentesis, # lo que no sea letras y sustituir series de espacios en blanco por uno solo def cleanup_str(raw): rs = re.sub("\\(.*?\\)|[^a-zA-Z\\s]"," ",raw) rs = re.sub("\\s+"," ",rs).strip().lower() return rs my_str = """ Some people, when confronted wit...
parrt/msan501
notes/gradient-descent.ipynb
mit
import matplotlib.pyplot as plt import numpy as np def f(x): return (x - 2)**2 + 1 graphx = np.arange(0, 4, 0.01) graphy = f(graphx) # apply f to all of graphx (BROADCAST) plt.plot(graphx, graphy) plt.show() def foo(x): print(type(x)) return (x - 2)**2 + 1 foo(2), foo(10) X = np.array([1,2,3]) foo(X) """ ...
mne-tools/mne-tools.github.io
dev/_downloads/88563c785f9a977b7ce2000e660aeacf/30_annotate_raw.ipynb
bsd-3-clause
import os from datetime import timedelta import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False) raw.crop(tmax=60)...
dcavar/python-tutorial-for-ipython
notebooks/Python Feature Extraction for Timbl - Class session.ipynb
apache-2.0
from nltk import word_tokenize """ Explanation: Python Feature Extraction for Timbl (C) 2017-2019 by Damir Cavar Download: This and various other Jupyter notebooks are available from my GitHub repo. License: Creative Commons Attribution-ShareAlike 4.0 International License (CA BY-SA 4.0) This is a tutorial related to ...
ES-DOC/esdoc-jupyterhub
notebooks/cas/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', 'cas', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: CAS Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
ivukotic/ML_platform_tests
tutorial/DL with Keras/IntroToDLwithKeras.ipynb
gpl-3.0
import random x=random.random() print ("The Value of x is", x) """ Explanation: An Introduction to Deep Learning with Keras This tutorial is meant to teach a beginning HEP under-graduate or graduate student who may be unfamiliar with python or data science in python to train Deep Learning models using Keras. Usually, ...
kingb12/languagemodelRNN
model_comparisons/noing15_LSTM_v_BOW.ipynb
mit
report_files = ["/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing15_200_512_04drb/encdec_noing15_200_512_04drb.json", "/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing15_bow_200_512_04drb/encdec_noing15_bow_200_512_04drb.json"] log_files = ["/Users/bking/IdeaProjects/...
d-li14/CS231n-Assignments
assignment2/ConvolutionalNetworks.ipynb
gpl-3.0
# As usual, a bit of setup from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.cnn import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient from cs231n.layers import * fro...
KIPAC/StatisticalMethods
tutorials/probability_transformations.ipynb
gpl-2.0
exec(open('tbc.py').read()) # define TBC and TBC_above import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Tutorial: Probability Transformations In this notebook, we will work through an application of the change of variables formula for prob...
CUFCTL/DLBD
Fall2017/DataLoading.ipynb
mit
import sys, os import pickle def unpickle(fname): with open(fname, 'rb') as f: Dict = pickle.load(f, encoding='bytes') return Dict """ Explanation: Data Loading Tutorial Loading data is one crucial step in the deep learning pipeline. PyTorch makes it easy to write custom data loaders for your partic...
mne-tools/mne-tools.github.io
0.24/_downloads/758680cba517820dcb0b486577bea58f/70_fnirs_processing.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt from itertools import compress import mne fnirs_data_folder = mne.datasets.fnirs_motor.data_path() fnirs_cw_amplitude_dir = op.join(fnirs_data_folder, 'Participant-1') raw_intensity = mne.io.read_raw_nirx(fnirs_cw_amplitude_dir, verbose=True) ra...
rongchuhe2/workshop_data_analysis_python
Overview_Scientific_Packages_for_Python.ipynb
mit
import math math.factorial(5) # functions in math package math.e # variables in math package """ Explanation: Overview Scientific Packages for Python Package can be seen as a container of variables and functions provided by others to help us accomplish our tasks Import Packages into our enviroment To use a pack...
Kappa-Dev/ReGraph
examples/Tutorial_graph_audit.ipynb
mit
from regraph import NXGraph from regraph.audit import VersionedGraph from regraph.rules import Rule from regraph import print_graph, plot_rule, plot_graph """ Explanation: Audit trails for graph objects in ReGraph (aka versioning) ReGraph implements a framework for the version control (VC) of graph transformations The...
davidgutierrez/HeartRatePatterns
Jupyter/MimicIII/01 Fill Database WaveForm Headers.ipynb
gpl-3.0
import urllib.request import wfdb import psycopg2 from psycopg2.extensions import AsIs """ Explanation: Fill Database WaveForm Headers 1) Import de las librerias que utilizaremos End of explanation """ target_url = "https://physionet.org/physiobank/database/mimic3wdb/matched/RECORDS-waveforms" data = urllib.request....
arcyfelix/Courses
17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/03-General Pandas/02-Series.ipynb
apache-2.0
import numpy as np import pandas as pd """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Series The first main data type we will learn about for pandas is the Series data type. Let's import Pandas and explore the Series object. A Series is very similar to a NumPy array ...
kylepolich/dataskeptic
shownotes/multiple-regression.ipynb
cc0-1.0
from IPython.display import Image Image(filename='redfin.png', width=300) %matplotlib inline import matplotlib.pyplot as plt import pandas as pd import numpy as np import statsmodels.api as sm import math """ Explanation: Multiple Regression This episode is a discussion of multiple regression: the use of observations...
xtr33me/deep-learning
intro-to-tensorflow/.ipynb_checkpoints/intro_to_tensorflow-checkpoint.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
rringham/deep-learning-notebooks
udacity/5_word2vec.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import collections import math import numpy as np import os import random import tensorflow as tf import zipfile from matplotlib import pylab from six.moves import range fro...
m7thon/tom
doc/example.ipynb
mit
import tom import numpy as np import matplotlib.pyplot as plt %matplotlib inline rand = tom.Random(1234567) """ Explanation: Usage example To showcase the use of this toolkit, we first create a simple learning task, and then learn an OOM model using spectral learning. We start by importing the toolkit and initializing...
podondra/bt-spectraldl
notebooks/01-data-download.ipynb
gpl-3.0
%matplotlib inline import urllib.request import urllib.parse import io import os import csv import glob from functools import partial from itertools import count import numpy as np from astropy.io import fits import matplotlib.pyplot as plt LABELS_FILE = 'data/ondrejov-dataset.csv' !head $LABELS_FILE """ Explanation...
wbbeyourself/cn-deep-learning
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: 你的第一个神经网络 在此项目中,你将构建你的第一个神经网络,并用该网络预测每日自行车租客人数。我们提供了一些代码,但是需要你来实现神经网络(大部分内容)。提交此项目后,欢迎进一步探索该数据和模型。 End of explanation """ data_path = 'Bike-Sharing-Dataset/hour.c...
synthicity/activitysim
activitysim/examples/example_estimation/notebooks/10_joint_tour_freq.ipynb
agpl-3.0
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating Joint Tour Frequency This notebook illustrates how to re-estimate a single model component for ActivitySim. This process includes running ActivitySim in estimation mode to read household tra...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/day-by-day/day07-modeling-viral-load/day07-in_class_activity_SOLUTIONS.ipynb
agpl-3.0
# Make plots inline %matplotlib inline # Make inline plots vector graphics instead of raster graphics from IPython.display import set_matplotlib_formats set_matplotlib_formats('pdf', 'svg') # import modules for plotting and data analysis import matplotlib.pyplot as plt import numpy as np import pandas """ Explanatio...
justacec/bokeh
examples/howto/notebook_comms/Numba Image Example.ipynb
bsd-3-clause
from __future__ import print_function, division from timeit import default_timer as timer from bokeh.plotting import figure, show, output_notebook from bokeh.models import GlyphRenderer, LinearColorMapper from bokeh.io import push_notebook from numba import jit, njit from ipywidgets import interact import numpy as n...
harishkrao/DSE200x
Week5-Visualization/05a_Matplotlib_Notebook.ipynb
mit
import pandas as pd import numpy as np import random import matplotlib.pyplot as plt data = pd.read_csv(r'C:\Users\hrao\Documents\Personal\HK\Python\world-development-indicators\Indicators.csv') data.shape """ Explanation: <br><p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"> Matplotlib: ...
Alexoner/mooc
cs231n/assignment3/q1.ipynb
apache-2.0
# A bit of setup import numpy as np import matplotlib.pyplot as plt from time import time from cs231n.layers import * from cs231n.fast_layers import * %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] ...
adrianstaniec/deep-learning
13_seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
mas-dse-greina/bayes
Bayes AB Hypothesis Testing.ipynb
unlicense
import numpy as np from matplotlib import pyplot as plt from scipy import stats %matplotlib inline """ Explanation: Bayes A/B Hypothesis Testing This notebook describes how to implement Bayes A/B Testing in Python. I created this based on Bogdan Kulynych's excellent presentation at PyConPl14. Bayes A/B is a replace...
gsvijayraajaa/workshop
5.DecisionTree.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.style.use('fivethirtyeight') df = pd.read_csv("data/creditRisk.csv") df.head() df.dtypes """ Explanation: Learning from Data Decision Trees are a non-parametric supervised learning method used for classification and regres...
deepankarsharma/udacity_traffic_signs
Traffic_Sign_Classifier.ipynb
mit
# Load pickled data import pickle import tensorflow as tf import numpy as np # TODO: Fill this in based on where you saved the training and testing data training_file = 'traffic-signs-data/train.p' validation_file= 'traffic-signs-data/valid.p' testing_file = 'traffic-signs-data/test.p' with open(training_file, mode=...
chengjun/iching
.ipynb_checkpoints/iching_intro-checkpoint.ipynb
mit
from iching import iching from datetime import date today = date.today() today = str(today).replace('-', '') birthtoday = int('19850526' + today) iching.ichingDate(birthtoday) fixPred, changePred = iching.getPredict() print iching.ichingName(fixPred, changePred ), iching.ichingText(fixPred, iching) iching.ichingD...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: MOHC Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
intellimath/pyaxon
examples/axon_tutorial.ipynb
mit
from __future__ import unicode_literals, print_function, division from pprint import pprint import axon import json import xml.etree as etree from IPython.display import HTML, display, display_html """ Explanation: AXON: Tutorial Let's import inventory for playing with AXON with python. End of explanation """ !cat b...
CAChemE/curso-python-datos
notebooks_vacios/050-Pandas-Intro.ipynb
bsd-3-clause
# Importamos pandas """ Explanation: Carga y manipulación de datos con pandas _ pandas es una biblioteca de análisis de datos en Python que nos provee de las estructuras de datos y herramientas para realizar análisis de manera rápida. Se articula sobre la biblioteca NumPy y nos permite enfrentarnos a situaciones en la...
wenduowang/git_home
python/MSBA/intro/HW2/.ipynb_checkpoints/HW2_wenduowang-checkpoint.ipynb
gpl-3.0
restaurants = pd.read_csv("NYC_Restaurants.csv", dtype=unicode) for index, item in enumerate(restaurants.columns.values): print index, item """ Explanation: NYC Restaurants Read in data from csv, and check column names to keep in mind. End of explanation """ #use .apply() method to combine the 4 columns to get t...
spulido99/Programacion
Margarita/Taller 3 y 4.ipynb
mit
#Librerias requeridas para el ejercicio import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pandas as pd %matplotlib inline from sklearn import datasets, linear_model from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures from sklearn.ensemble...
rsterbentz/phys202-2015-work
assignments/assignment06/ProjectEuler17.ipynb
mit
def number_to_words(n): """Given a number n between 1-1000 inclusive return a list of words for the number.""" n=str(n) key = {1:'one', 2:'two', 3:'three', 4:'four', 5:'five', 6:'six', 7:'seven', 8:'eight', 9:'nine', 10:'ten', 11:'eleven', 12:'twelve', 13:'thirteen', 14:'fourteen', 15:'fifteen', 16:'sixteen...
mathusuthan/autodidacti
DSE220x-MLFundamentals/Week-1/NN_MNIST/Nearest_neighbor_MNIST.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import time ## Load the training set train_data = np.load('MNIST/train_data.npy') train_labels = np.load('MNIST/train_labels.npy') ## Load the testing set test_data = np.load('MNIST/test_data.npy') test_labels = np.load('MNIST/test_labels.npy') #...
geoscixyz/computation
notebooks/fundamentals/tools.ipynb
mit
# python has /types print(type(1) == int) print(type(1.) == float) print(type(1j) == complex) type(None) # What happens if you add values of different types? print(1 + 1.) """ Explanation: Tools Purpose: To introduce and provide resources for the tools used to build and work with <a href="http://simpeg.xyz">SimPEG</...
davofis/computational_seismology
08_finite_volumes/fv_hetero_1d.ipynb
gpl-3.0
# Import all necessary libraries, this is a configuration step for the exercise. # Please run it before the simulation code! import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Show the plots in the Notebook. plt.switch_backend("nbagg") """ Explanation: <div style='background...