repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
arnaldog12/Manual-Pratico-Deep-Learning
Rede Neural.ipynb
mit
import numpy as np import _pickle as pkl import matplotlib.pyplot as plt from sklearn.datasets import load_iris from sklearn.datasets.samples_generator import make_blobs, make_circles, make_moons, make_classification from sklearn.metrics import accuracy_score from sklearn.preprocessing import MinMaxScaler, OneHotEncode...
aaai2018-paperid-62/aaai2018-paperid-62
evaluation_analysis.ipynb
mit
import pandas as pd pd.options.mode.chained_assignment = None # default='warn', hides SettingWithCopyWarning file = 'data/evaluations.csv' conversion_dict = {'research_type': lambda x: int(x == 'E')} evaluation_data = pd.read_csv(file, sep=',', header=0, index_col=0, converters=conversion_dict) print('Samples per co...
wasit7/PythonDay
notebook/.ipynb_checkpoints/Somkiat's Basic Python-checkpoint.ipynb
bsd-3-clause
x=1 print x type(x) x.conjugate() type(1+2j) z=1+2j print z (1,2) t=(1,2,"text") t t def foo(): return (1,2) x,y=foo() print x print y def swap(x,y): return (y,x) x=1;y=2 print "{0:d} {1:d}".format(x,y) x,y=swap(x,y) print "{:f} {:f}".format(x,y) dir(1) x=[] x.append("text") x x.append(1) x.p...
molgor/spystats
notebooks/Sandboxes/TensorFlow/Biospytial Models in GPFlow.ipynb
bsd-2-clause
bees = pickNode(Family,name="Apidae") # Extract the cells bcells = list(bees.cells) len(bcells) """ Explanation: Let's start by picking a Family Node, e.g. The Bees in Mexico. End of explanation """ ### In the form of a anonymous function getNeighbours = lambda cells : list(set(reduce(lambda a,b : a+b , map(lambd...
JuBra/cobrapy
documentation_builder/gapfilling.ipynb
lgpl-2.1
import cobra.test model = cobra.test.create_test_model("salmonella") """ Explanation: Gapfillling GrowMatch and SMILEY are gap-filling algorithms, which try to to make the minimal number of changes to a model and allow it to simulate growth. For more information, see Kumar et al.. Please note that these algorithms ar...
blbradley/subset-selector
examples/example.ipynb
mit
from subset_selector import SubsetSelector ss = SubsetSelector(x, y) ss.plot() """ Explanation: Using subset-selector Create SubsetSelector with data and plot. y should be a multidimensional array. Each sample from a subset of y is graphed. You can scroll through subsets using the figure's toolbar, select graphs of in...
d125q/Internet_Robustness
analysis.ipynb
gpl-3.0
import pickle from collections import OrderedDict import datetime with open('robustness.pickle', 'rb') as handle: robustness = pickle.load(handle) robustness = OrderedDict({ attack_type: { timestamp: OrderedDict(result) for timestamp, result in sorted(timestamped_results.items()...
cosmodesi/desibgsdev
Redshift_Efficiency_Study/BGS_moonsep_sanitycheck.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt from astropy.table import Table, vstack from astropy.io import fits import seaborn as sns sns.set(style='white', font_scale=1.1, palette='deep') from desiutil.log import get_logger, DEBUG log = get_logger() from desistudy_qa import qa_zmag, qa_efficiency, q...
linsalrob/PyFBA
iPythonNotebooks/PATRIC to FBA.ipynb
mit
import sys import os import copy import PyFBA import re import inspect inspect.getfile(PyFBA) """ Explanation: How to create and run a gap-filled FBA from PATRIC The PATRIC (the Pathosystems Resource Integration Center) contains the best collection of well annotated genomes. They also happen to have been annotated by...
net-titech/CREST-Deep-M
notebooks/JPEG Compression.ipynb
mit
from scipy.misc import imsave, toimage from os import listdir from os.path import basename, splitext import glob import numpy as np npy_path = '../compressed-models/alexnet/npy/' jpg_path = '../compressed-models/alexnet/jpegs/' gif_path = '../compressed-models/alexnet/gifs/' png_path = '../compressed-models/alexnet/pn...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/statespace_tvpvar_mcmc_cfa.ipynb
bsd-3-clause
%matplotlib inline from importlib import reload import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from scipy.stats import invwishart, invgamma # Get the macro dataset dta = sm.datasets.macrodata.load_pandas().data dta.index = pd.date_range('1959Q1', '2009Q3', freq='Q...
SnShine/aima-python
rl.ipynb
mit
from rl import * """ Explanation: Reinforcement Learning This IPy notebook acts as supporting material for Chapter 21 Reinforcement Learning of the book Artificial Intelligence: A Modern Approach. This notebook makes use of the implementations in rl.py module. We also make use of implementation of MDPs in the mdp.py m...
mne-tools/mne-tools.github.io
0.23/_downloads/8eeab316a5e011839687fbb76fb65f29/cwt_sensor_connectivity.ipynb
bsd-3-clause
# Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD (3-clause) import numpy as np import mne from mne import io from mne.connectivity import spectral_connectivity, seed_target_indices from mne.datasets import sample from mne.time_frequency import AverageTFR print(__doc__) """ Explanation: Compute...
ptkool/spark
python/docs/source/getting_started/quickstart.ipynb
apache-2.0
from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() """ Explanation: Quickstart This is a short introduction and quickstart for the PySpark DataFrame API. PySpark DataFrames are lazily evaluated. They are implemented on top of RDDs. When Spark transforms data, it does not immediately compu...
ispamm/tensorflow-tutorial
3-TensorBoard.ipynb
gpl-3.0
from sklearn import datasets, model_selection data = datasets.load_breast_cancer() X = data['data'] y = data['target'].reshape(-1, 1) """ Explanation: Visualizzare statistiche con la TensorBoard Prerequisiti per il tutorial: * T1 - Reti neurali feedforward Contenuti del tutorial: 1. Struttura della TensorBoard. 2. Ese...
pvalienteverde/MeetUpIntroMLySistemasRecomendacion
Sistemas De Recomendacion.ipynb
mit
import pandas as pd import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity from sklearn.neighbors import NearestNeighbor...
d00d/quantNotebooks
Notebooks/quantopian_research_public/tutorials/pipeline/pipeline_tutorial_lesson_7.ipynb
unlicense
# Dollar volume factor dollar_volume = AverageDollarVolume(window_length=30) # High dollar volume filter high_dollar_volume = (dollar_volume > 10000000) # Average close price factors mean_close_10 = SimpleMovingAverage(inputs=[USEquityPricing.close], window_length=10, mask=high_dollar_volume) mean_close_30 = SimpleMo...
AtmaMani/pyChakras
udemy_ml_bootcamp/Python-for-Data-Analysis/NumPy/Numpy Exercise - Solutions.ipynb
mit
import numpy as np """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> NumPy Exercises - Solutions Now that we've learned about NumPy let's test your knowledge. We'll start off with a few simple tasks and then you'll be asked some more complicated questions. Import NumPy ...
RoebideBruijn/datascience-intensive-course
exercises/linear_regression/Mini_Project_Linear_Regression.ipynb
mit
# special IPython command to prepare the notebook for matplotlib and other libraries %pylab inline import numpy as np import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt import sklearn import seaborn as sns # special matplotlib argument for improved plots from matplotlib import rcParams ...
Upward-Spiral-Science/the-vat
Code/exploratory_analysis_AL.ipynb
apache-2.0
# Import Necessary Libraries import numpy as np import os, csv, json from matplotlib import * from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import scipy from sklearn.decomposition import PCA import skimage.measure # pretty charting import seaborn as sns sns.set_palette('muted') sns.set...
BDannowitz/polymath-progression-blog
book-tracking/book-tracking-2019-07.ipynb
gpl-2.0
import pandas as pd import numpy as np """ Explanation: 2019 Book Update End of explanation """ book_df = pd.read_csv('goodreads_library_export.csv') book_df['Date Added'] = pd.to_datetime(book_df['Date Added'], format="%Y/%m/%d") book_df.columns """ Explanation: Read in my G...
ES-DOC/esdoc-jupyterhub
notebooks/snu/cmip6/models/sandbox-2/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'snu', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: SNU Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/emac-2-53-vol/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-vol', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: EMAC-2-53-VOL Sub-Topics: Radiativ...
chesters99/ghpages
content/holybooks.ipynb
gpl-3.0
import re import glob import lxml.html import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches %matplotlib inline import nltk from nltk.corpus import stopwords from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.deco...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex29-Identify Patterns in the Coupled Fields of SLP and SST through Canonical Correlation Analysis.ipynb
mit
%matplotlib inline import numpy as np import xarray as xr from sklearn.decomposition import PCA from sklearn.cross_decomposition import CCA import cartopy.crs as ccrs import datetime as dt import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.gridspec as gridspec plt.rcParams['figure.fig...
cruzpmmq/fmp-soma-vadis
tutorial.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import time plt.style.use('ggplot') np.random.seed(1) """ Explanation: Função Massa de Probabilidade da soma (e diferença) de Variáveis Aleatórias Discretas Independentes 2017 Pedro Cruz up200506513@fc.up.pt End of explanation """ # Variável Aleatória X1 S_X1 = np...
dereneaton/ipyrad
tests/cookbook-treemix-pedicularis.ipynb
gpl-3.0
## conda install -c ipyrad ipyrad ## conda install -c ipyrad treemix ## conda install -c eaton-lab toytree import ipyrad.analysis as ipa import toytree import toyplot import numpy as np print 'ipyrad', ipa.__version__ print 'toytree', toytree.__version__ print 'toyplot', toyplot.__version__ ! treemix --version | grep...
PedramNavid/MachineLearningNanodegree
3_Titanic/titanic_survival_exploration.ipynb
gpl-3.0
import sys print(sys.version) import numpy as np import pandas as pd # RMS Titanic data visualization code from titanic_visualizations import survival_stats from IPython.display import display %matplotlib inline # Load the dataset in_file = 'titanic_data.csv' full_data = pd.read_csv(in_file) # Print the first few ...
infotranecon/IEtools
Dynamic Equilibrium Example-Bitcoin.ipynb
mit
import numpy as np import pylab as pl from IEtools import * import xlrd %pylab inline """ Explanation: These were run in Python 3 using the Anaconda distribution. The dynamic equilibrium model is described in more detail here: http://informationtransfereconomics.blogspot.com/2017/01/dynamic-equilibrium-presentation.ht...
GoogleCloudPlatform/mlops-on-gcp
continuous_training/composer-mlflow/chicago_taxi_fare_experiment.ipynb
apache-2.0
import numpy as np import pandas as pd from pandas_profiling import ProfileReport from scipy import stats from sklearn.ensemble import RandomForestRegressor from sklearn.compose import ColumnTransformer from sklearn.model_selection import train_test_split, cross_val_score, GridSearchCV from sklearn.pipeline import Pip...
joommf/tutorial
workshops/Durham/.ipynb_checkpoints/tutorial0_first_notebook-checkpoint.ipynb
bsd-3-clause
import oommfc as oc import discretisedfield as df %matplotlib inline print(df.__file__) """ Explanation: Tutorial 0 - First JOOMMF notebook The goal of this tutorial is for all participants to familiarise themselves with running JOOMMF simulations in Jupyter notebook. The only thing you need to know for this tutorial ...
ADicksonLab/wepy
info/tutorials/data_analysis/README.ipynb
mit
import os import os.path as osp import random as rand from pathlib import Path import shutil as sh import warnings from PIL import Image warnings.filterwarnings("ignore") rand.seed(33) ## Inputs and Outputs input_dir = Path("input") outputs_dir = Path("_output") media_dir = input_dir / 'media' sh.rmtree(outputs_...
rishuatgithub/MLPy
nlp/UPDATED_NLP_COURSE/04-Semantics-and-Sentiment-Analysis/03-Sentiment-Analysis-Assessment.ipynb
apache-2.0
# Import spaCy and load the language library. Remember to use a larger model! # Choose the words you wish to compare, and obtain their vectors # Import spatial and define a cosine_similarity function # Write an expression for vector arithmetic # For example: new_vector = word1 - word2 + word3 # List the to...
ZhukovGreen/UMLND
boston_housing/boston_housing.ipynb
gpl-3.0
# Import libraries necessary for this project import numpy as np import pandas as pd from sklearn.cross_validation import ShuffleSplit import matplotlib.pyplot as plt # Import supplementary visualizations code visuals.py import visuals as vs # Load the Boston housing dataset data = pd.read_csv('housing.csv') prices =...
Mathtodon/Mathtodon.github.io
Final_Version_With_Decision_Tree.ipynb
cc0-1.0
tree1 = tree.DecisionTreeClassifier( criterion ='entropy',random_state = 0) fittedtree=tree1.fit( X_train, y_train) #print metrics.confusion_matrix(y_train, fittedtree.predict(X_train)) #print metrics.accuracy_score(y_train, fittedtree.predict(X_train)) cross_validation.cross_val_score(tree1, X_train, y_train, cv = ...
jorisvandenbossche/DS-python-data-analysis
notebooks/python_recap/04-reusing_code.ipynb
bsd-3-clause
%%file test.py message = "Hello how are you?" for word in message.split(): print(word) """ Explanation: Python the basics: Reusing code DS Data manipulation, analysis and visualization in Python May/June, 2021 © 2021, Joris Van den Bossche and Stijn Van Hoey (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#100...
nehal96/Deep-Learning-ND-Exercises
Weight Initialization/weight_initialization.ipynb
mit
%matplotlib inline import tensorflow as tf import helper from tensorflow.examples.tutorials.mnist import input_data print('Getting MNIST Dataset...') mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) print('Data Extracted.') """ Explanation: Weight Initialization In this lesson, you'll learn how to fin...
deepmind/educational
colabs/summer_schools/intro_to_unsupervised_learning.ipynb
apache-2.0
import numpy as np # Basic plotting in style: import matplotlib.pyplot as plt import seaborn as sns # Animations: from matplotlib import animation from IPython.display import HTML #@title Data generating functions # 0, 2, 5, 10, 80 #https://tall.life/height-percentile-calculator-age-country/ HIDDEN_MU = [49.3, 50, 86....
simmy88/UdacityMLND
Customer Segments/customer_segments.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd from IPython.display import display # Allows the use of display() for DataFrames # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the wholesale custo...
jaredvonhalle/CSC478WorldFoodFacts
Regression.ipynb
mit
x = data.as_matrix() y = target.as_matrix() x = np.array([np.concatenate((v,[1])) for v in x]) #add column of ones to the end of the data set print x linreg = LinearRegression() linreg.fit(x,y) p = linreg.predict(x) p err = abs(p-y) err total_error = np.dot(err,err) rmse_train = np.sqrt(total_error/len(p)) rmse_tr...
UWSEDS/LectureNotes
PreFall2018/Python Functions.ipynb
bsd-2-clause
import numpy as np # Determine if num is prime # This code has a bug. What is it? # Also, the efficiency of the code can be improved. How? num = 8 upper = int(np.sqrt(num)) + 1: if num % integer == 0: print("Not prime!") is_prime = False import pdb; pdb.set_trace() if is_prime: print("Is...
armgilles/presentation
EPSI/I5/Qualite des donnees/EP3/analyse_commune.ipynb
mit
commune_metropole = pd.read_csv('data/commune_metropole.csv', encoding='utf-8') commune_metropole.shape commune_metropole.head() insee = pd.read_csv('data/insee.csv', sep=";", # séparateur du fichier dtype={'COM' : np.dtype(str)}, # On force la colonne CO...
Amarchuk/2FInstability
notebooks/2f/.ipynb_checkpoints/instabilities-checkpoint.ipynb
gpl-3.0
from IPython.display import HTML from IPython.display import Image from PIL import Image as ImagePIL %pylab %matplotlib inline """ Explanation: Неустойчивости Тут будут все функции, имеющие отношение к неустойчивостям, чтобы не копировать их каждый раз. Тесты на эти функции в соседнем ноутбуке. End of explanation """...
MBARIMike/biofloat
notebooks/explore_surface_oxygen_and_WOA.ipynb
mit
from biofloat import ArgoData from os.path import join, expanduser ad = ArgoData(cache_file = join(expanduser('~'), 'biofloat_fixed_cache_variablesDOXY_ADJUSTED-PSAL_ADJUSTED-TEMP_ADJUSTED_wmo1900650-1901157-5901073.hdf')) """ Explanation: Explore surface Argo oxygen float and World Ocean Atlas data Get cached s...
tsob/cnn-music-structure
src/simple_cnn.ipynb
mit
# A bit of setup # Usual imports import time import numpy as np import matplotlib.pyplot as plt # Notebook plotting magic %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # For auto-reloadin...
HazyResearch/dd-genomics
dsr/DSR_search.ipynb
apache-2.0
def root_tree_at(new_root): """ Given a node, remove all parents and add as children so that this node becomes the new root """ # Check to see if the new root has any parents... parents = new_root.xpath("..") if len(parents) > 0: p = root_tree_at(parents[0]) p.remove(new_root...
sumedhasingla/TubeTK
Examples/MergeAdjacentImages/MergeAdjacentImages.ipynb
apache-2.0
import os import sys # Path for TubeTK libs TubeTK_BUILD_DIR=None if 'TubeTK_BUILD_DIR' in os.environ: TubeTK_BUILD_DIR = os.environ['TubeTK_BUILD_DIR'] if not os.path.exists(TubeTK_BUILD_DIR): print('TubeTK_BUILD_DIR not found!') print(' Set environment variable') sys.exit(1) """ Explanation: MergeA...
maciejkula/lightfm
examples/ann/annoy_nsmlib_example.ipynb
apache-2.0
%matplotlib inline import numpy as np import pandas as pd from sklearn.metrics import pairwise_distances import time from lightfm.datasets import fetch_movielens movielens = fetch_movielens() for key, value in movielens.items(): print(key, type(value), value.shape) train = movielens['train'] test = movielens['te...
mne-tools/mne-tools.github.io
0.19/_downloads/e6f2b45ae501bec73cddc70f08093041/plot_40_visualize_raw.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) raw.crop(tmax=60).load_data() """ Explanation: Built-in plotti...
GoogleCloudPlatform/training-data-analyst
blogs/batch_predictions/batch_predictions_keras.ipynb
apache-2.0
import numpy as np import tensorflow as tf from tensorflow import keras tf.__version__ # Set GCP configs if using Cloud AI Platform import os PROJECT = "your-gcp-project-here" # REPLACE WITH YOUR PROJECT NAME REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 BUCKET = "your-gcp-bucket-here" ...
poppy-project/community-notebooks
tutorials-education/poppy_ergo_jr__decouverte_du_robot/TP1_mouvement_et_fonctions_eleve_vf.ipynb
lgpl-3.0
def f_init(bot, pos_initiale): #debut du corps de la procédure """ Explanation: Initialisation Ecrire un jeu d'instructions permettant d'initialiser la vitesse de chacun des moteurs à 30°/s. de mettre les moteurs poppy.m1 à poppy.m6 dans les positions données par la liste suivante pos_init = [0, -90, 30, 0, 60,...
setiQuest/ML4SETI
tutorials/Step_4_Classify_with_WatsonVR_old.ipynb
apache-2.0
#!pip install --user --upgrade watson-developer-cloud #Making a local folder to put my data. #NOTE: YOU MUST do something like this on a Spark Enterprise cluster at the hackathon so that #you can put your data into a separate local file space. Otherwise, you'll likely collide with #your fellow participants. my_tea...
trangel/Insight-Data-Science
general-docs/nlp-preprocessing/notebook_drafts/NLP-preprocessing-NYT-opeds.ipynb
gpl-3.0
import pandas as pd import numpy as np import nltk from nltk.tokenize import RegexpTokenizer from nltk.corpus import stopwords from nltk.stem.snowball import SnowballStemmer from nltk.stem.wordnet import WordNetLemmatizer from sklearn.feature_extraction.text import CountVectorizer """ Explanation: Notebook for prepr...
craigrshenton/home
notebooks/notebook10.ipynb
mit
import pandas as pd from pandas import read_csv pd.set_option('precision', 3) # set display precision to 3 significant figures filename = 'C:/Users/craigrshenton/Desktop/Dropbox/python/python_pro/machine_learning_mastery_with_python/machine_learning_mastery_with_python_code/chapter_07/pima-indians-diabetes.data.csv' n...
theandygross/HIV_Methylation
Figure3.ipynb
mit
import NotebookImport from Setup.Imports import * from Setup.Read_HIV_Data import * import Setup.DX_Imports as dx """ Explanation: Figure 4 End of explanation """ import Parallel.Age_HIV_Features as fx sns.set_context("paper", rc={"lines.linewidth": 2.5, "font_size":14}) sns.set_styl...
mauroalberti/geocouche
pygsf/checks/Test divergence and curl module.ipynb
gpl-2.0
from pygsf.mathematics.arrays import * from pygsf.spatial.rasters.geotransform import * from pygsf.spatial.rasters.fields import * """ Explanation: Test divergence and curl module This document present tests on divergence and curl module calculation using pygsf. Preliminary settings The modules to import for dealing...
mne-tools/mne-tools.github.io
0.21/_downloads/e807ecd348331c3d789aa11b874576a5/plot_decoding_time_generalization_conditions.ipynb
bsd-3-clause
# Authors: Jean-Remi King <jeanremi.king@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import matplotlib.pyplot as plt from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler f...
bearing/dosenet-analysis
calibration/Detector_Comparison.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit #from detector 1: d1_U = np.genfromtxt('uranium_test_2019-02-19_D3S.csv', delimiter= ",").T d1_Th = np.genfromtxt('thorium_test_2019-02-19_D3S.csv', delimiter= ",").T #from detector 2: d2_U = np.genfromtxt('Uranium_102566_2019-03-2...
flamingbear/ipython-notebooks
notebooks/EASE-Grid Sea Ice Age Python Example.ipynb
mit
!wget -qN ftp://sidads.colorado.edu/pub/DATASETS/nsidc0611_seaice_age/data/2012/iceage-2012w19.bin """ Explanation: EASE-Grid Sea Ice Age, Version 2 Short Jupyter notebook describing how to read the Sea Ice Age Dataset. The dataset documentation and data can be found here: http://nsidc.org/data/nsidc-0611 To begin: I ...
estnltk/episode-miner
docs/episode-miner.ipynb
gpl-2.0
from episode_miner import EventText, EventSequences, Episode, Episodes from estnltk.taggers import EventTagger from IPython.display import HTML, FileLink """ Explanation: Usage End of explanation """ event_vocabulary = [{'term': 'üks'}, {'term': 'kaks'}] event_tagger = EventTagger(event_voca...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/dev/n16_hallucinating_with_predictor.ipynb
mit
# Basic imports import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys from time import time from sklearn.metrics import r2_score, median_absolute_error %matplotlib inline %pylab inline pylab.rcParams['figure.figsize'] = (20.0, 10...
Lstyle1/Deep_learning_projects
weight-initialization/weight_initialization.ipynb
mit
%matplotlib inline import tensorflow as tf import helper from tensorflow.examples.tutorials.mnist import input_data print('Getting MNIST Dataset...') mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) print('Data Extracted.') """ Explanation: Weight Initialization In this lesson, you'll learn how to fin...
w4zir/ml17s
.ipynb_checkpoints/python-tutorial-checkpoint.ipynb
mit
def quicksort(arr): if len(arr) <= 1: return arr pivot = arr[int(len(arr) / 2)] left = [x for x in arr if x < pivot] middle = [x for x in arr if x == pivot] right = [x for x in arr if x > pivot] return quicksort(left) + middle + quicksort(right) print (quicksort([3,6,8,10,1,2])) """ Ex...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/nicam16-7s/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-7s', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MIROC Source ID: NICAM16-7S Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Tu...
sarathid/Learning
Deep_learning_ND/dlnd_image_classification.ipynb
gpl-3.0
""" 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...
rahulbakshee/TensorFlow-Basics
03_tf_mnist_01_softmax_flattened_input .ipynb
mit
# import import tensorflow as tf # import mnist data # data hosted at http://yann.lecun.com/exdb/mnist/ from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data", one_hot=True) """ Explanation: inspired from https://www.tensorflow.org/get_started/mnist/beginners End of ...
CELMA-project/CELMA
derivations/laplacianInversion/ForwardsBackwardsNonSymmetric.ipynb
lgpl-3.0
from IPython.display import display from sympy import init_printing from sympy import symbols, expand, together, as_finite_diff, collect from sympy import Function, Eq, Subs from collections import deque init_printing() def finiteDifferenceOfOneTerm(factors, wrt, stencil): """ Finds the finite different appro...
swirlingsand/self-driving-car-nanodegree-nd013
play/CarND-Camera-Calibration-master/CarND-Camera-Calibration-master/camera_calibration.ipynb
mit
%matplotlib inline import matplotlib import numpy as np import cv2 import glob import matplotlib.pyplot as plt # %matplotlib qt # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((6*8,3), np.float32) objp[:,:2] = np.mgrid[0:8, 0:6].T.reshape(-1,2) # Arrays to store object points and...
fionapigott/Data-Science-45min-Intros
kernel_smoothing/Regression with kernel smoothing.ipynb
unlicense
import sys import heapq import sklearn import matplotlib.pyplot as plt import numpy as np from scipy.stats import norm %matplotlib inline """ Explanation: Regression with kernel smoothing Or "Mr. Smoothie's Smoothie machine Smoother", a Story in Seven Parts What are we doing here? We're doing regression! start with...
chrander/pygameday
examples/example.ipynb
mit
from pygameday import GameDayClient from datetime import datetime """ Explanation: pygameday Example Notebook This Jupyter notebook walks through basic pygameday usage. First, import the GameDayClient object. We've also imported dateutil.parser to help with converting date strings to date objects. End of explanation ...
qingshuimonk/LolStats
getStarted.ipynb
mit
from lolcrawler_util import read_key api_key = read_key() # try hello world import urllib2 import json response = urllib2.urlopen('https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/RiotSchmick?api_key=' + api_key) data = json.load(response) print(json.dumps(data, indent=2)) """ Explanation: Get API_KEY API_KEY c...
jinzishuai/learn2deeplearn
deeplearning.ai/C5.SequenceModel/Week2_NLP_WordEmbeddings/assignment/Emojify/Emojify - learners.ipynb
gpl-3.0
import numpy as np from emo_utils import * import emoji import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier. Have you ever wanted to make your text messages more expressive? You...
bashtage/statsmodels
examples/notebooks/statespace_cycles.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from pandas_datareader.data import DataReader endog = DataReader('UNRATE', 'fred', start='1954-01-01') endog.index.freq = endog.index.inferred_freq """ Explanation: Trends and cycles in unemployment...
sshleifer/object_detection_kitti
object_detection/kitti-inference.ipynb
apache-2.0
import numpy as np import os import pickle import six.moves.urllib as urllib import sys sys.path.append("..") import tarfile import tensorflow as tf import zipfile from object_detection.eval_util import evaluate_detection_results_pascal_voc from collections import defaultdict from io import StringIO from matplotlib im...
yunfeiz/py_learnt
sample_code/tushare_pyecahrts_v0.1.ipynb
apache-2.0
import tushare as ts import pandas as pd from IPython.display import HTML stock_selected='600487' #历年前十大股东持股情况 #df1为季度统计摘要,data1为前十大持股明细统计 df1, data1 = ts.top10_holders(code=stock_selected, gdtype='0') #gdtype等于1时表示流通股,默认为0 #df1, data1 = ts.top10_holders(code='002281', year=2015, quarter=1, gdtype='1') df1 = df1.sort...
chris1610/pbpython
notebooks/Learn_Pandas-Weighted_Average.ipynb
bsd-3-clause
import pandas as pd import numpy as np """ Explanation: Learning More About Pandas by Building and Using a Weighted Average Function This notebook is based on the article on Pbpython.com. Please reference it for the background and additional details End of explanation """ sales = pd.read_excel("https://github.com/ch...
bashtage/statsmodels
examples/notebooks/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 = ...
psiq/gdsfactory
notebooks/10_YAML_component_connections.ipynb
mit
import pp gap = 0.2 wg_width = 0.5 length = 10 yaml = f""" instances: sl: component: coupler_symmetric settings: gap: {gap} wg_width: {wg_width} sr: component: coupler_symmetric settings: gap: {gap} wg_width: {wg_width} cs: component: coupler_s...
ioos/notebooks_demos
notebooks/2017-07-25-HFRadar_currents.ipynb
mit
from IPython.display import HTML url = ( "https://cordc.ucsd.edu/projects/mapping/maps/fullpage.php?" "ll=29.061888,-87.373643&" "zm=7&" "mt=&" "rng=0.00,50.00&" "us=1&" "cs=4&" "res=6km_h&" "ol=3&" "cp=1" ) iframe = ( '<iframe src="{src}" width="750" height="450" style="b...
rigetticomputing/grove
examples/JordanGradient.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt from mock import patch from grove.alpha.jordan_gradient.jordan_gradient import estimate_gradient """ Explanation: Estimating the gradient of a quadratic potential function using Jordan's quantum gradient estimation algorithm (10.1103/PhysRevLett.95.050501). First, im...
kimegitee/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...
omarcostahamido/One-Quick-Solution_Patches
Other/las-vegas-dice-with-comments.ipynb
agpl-3.0
# begin by importing the essential libraries from qiskit from qiskit import IBMQ, Aer from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit # The following options are recomended for Jupter notebook visualization using matplotlib %matplotlib inline """ Explanation: Challenge 1: Break the Bank - Las Ve...
wd15/chimad-phase-field
hackathons/hackathon1/fipy/1b.ipynb
mit
%matplotlib inline import sympy import fipy as fp import numpy as np A, c, c_m, B, c_alpha, c_beta = sympy.symbols("A c_var c_m B c_alpha c_beta") f_0 = - A / 2 * (c - c_m)**2 + B / 4 * (c - c_m)**4 + c_alpha / 4 * (c - c_alpha)**4 + c_beta / 4 * (c - c_beta)**4 print f_0 sympy.diff(f_0, c, 2) """ Explanation: Ta...
pierresendorek/tensorflow_crescendo
second_simplest_working_tensorflow_notebook_ever.ipynb
lgpl-3.0
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: (Second) Simplest Working Tensorflow Notebook Ever In this notebook, we show how to use TensorFlow on a very simple task : estimating the coefficients $a$ and $b$ of an affine function $y = ax + b$. Here, in...
hungiyang/StatisticalMethods
examples/XrayImage/FirstLook.ipynb
gpl-2.0
from __future__ import print_function import astropy.io.fits as pyfits import numpy as np import os import urllib import astropy.visualization as viz import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 10.0) """ Explanation: A First Look at an X-ray Image Dataset Images are data....
seg/2016-ml-contest
BGC_Team/Facies Prediction_submit6.ipynb
apache-2.0
##### import basic function import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline ##### import stuff from scikit learn from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.metrics import confusion_matrix, make_scorer, f1_score,...
enbanuel/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 """ # YOUR CODE HERE with np.load('trajectory.npz') as data: t = data['t'] x = data['x'] y = data['y'] print(x) ...
cleemesser/eeg-hdfstorage
notebooks/vizAbsenceSz.ipynb
bsd-3-clause
# import libraries from __future__ import print_function, division, unicode_literals %matplotlib inline # %matplotlib notebook import matplotlib import matplotlib.pyplot as plt import pandas as pd import numpy as np import h5py from pprint import pprint import stacklineplot # local copy # matplotlib.rcParams['figure...
geography-munich/sciprog
material/sub/jrjohansson/Lecture-3-Scipy.ipynb
apache-2.0
# what is this line all about? Answer in lecture 4 %matplotlib inline import matplotlib.pyplot as plt from IPython.display import Image """ Explanation: SciPy - Library of scientific algorithms for Python J.R. Johansson (jrjohansson at gmail.com) The latest version of this IPython notebook lecture is available at http...
sastels/Onboarding
4.5 - Sorting exercises.ipynb
mit
# Provided simple test() function used in main() to print # what each function returns vs. what it's supposed to return. def test(got, expected): if got == expected: prefix = ' OK ' else: prefix = ' X ' print '%s got: %s expected: %s' % (prefix, repr(got), repr(expected)) """ Explanation: ...
joashxu/NYCSubwayDataAnalysis
NYCSubway.ipynb
mit
%matplotlib inline import numpy as np import pandas import matplotlib.pyplot as plt try: import seaborn as sns sns.set_palette("deep", desat=.6) sns.set_context(rc={"figure.figsize": (10, 6)}) except ImportError: sns = None df = pandas.read_csv('turnstile_data_master_with_weather.csv') """ Expl...
karlstroetmann/Algorithms
Python/Chapter-05/Quick-Sort-Array.ipynb
gpl-2.0
def logging(f): def logged_f(*a): print(f'{f.__name__}{a}') r = f(*a) print(f'{f.__name__}{a} = {r}') return r return logged_f """ Explanation: The function logging is used as a decorator. It takes a function f as its argument and returns a new function logged_f that returns ...
JannesKlaas/MLiFC
Week 2/Ch. 11 - Evaluating and deploying the model.ipynb
mit
import keras from keras.models import load_model model = load_model('./support_files/Ch11_model.h5') """ Explanation: Ch. 11 - Evaluating and deploying the model In chapter 10 we have learned a lot of new tricks and tools to build neural networks that can deal with stuructured data such as the bank marketing dataset....
WomensCodingCircle/CodingCirclePython
Lesson07_ListsandTuples/Lists and Tuples - after class.ipynb
mit
sushi_order = ['unagi', 'hamachi', 'otoro'] prices = [6.50, 5.50, 15.75] print(sushi_order) print(prices) """ Explanation: Lists and Tuples Lists Recap A list is a sequence of values. These values can be anything: strings, numbers, booleans, even other lists. To make a list you put the items separated by commas betwee...
tritemio/multispot_paper
realtime kinetics/Simulated Kinetic Curve Fit - Run-All.ipynb
mit
from nbrun import run_notebook """ Explanation: Kinetic Curve Simulation Fit <p class=lead>This notebook performs fits of simulated Kinetic Curves for different kinetics parameters. A single [template notebook](Simulated Kinetic Curve Fit - Template.ipynb) is executed several times, once for each set of parameters. <p...
aemreunal/15688-project
NYC Traffic Collision Data.ipynb
mit
import os from os import path from bs4 import BeautifulSoup import collections import numpy as np import pandas as pd import re import requests import scipy from scipy.cluster.vq import kmeans, kmeans2, vq from scipy.spatial.distance import cdist from IPython.core.display import display, HTML from colour import Color ...
sarathid/Learning
Deep_learning_ND/Week 1/dlnd-your-first-network/DLND-your-first-network/dlnd-your-first-neural-network.ipynb
gpl-3.0
%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...
kfollette/ASTR200-Spring2017
Labs/Lab8/Lab 8.ipynb
mit
from numpy import * import matplotlib.pyplot as plt %matplotlib inline """ Explanation: <small><i>This notebook is based on one put together by Mark Krumholz and has been modified to suit the purposes of this course, including expansion/modification of explanations and additional exercises. The original can be found a...
gtzan/mir_book
data_mining_naive_bayes.ipynb
cc0-1.0
%matplotlib inline import matplotlib.pyplot as plt import pickle import numpy as np # load some lyrics bag of words data, binarize, separate matrix rows by genre data = np.load('data.npz') a = data['arr_0'] a[a > 0] = 1 labels = np.load('labels.npz') labels = labels['arr_0'] dictionary = pickle.load(open('dictiona...
2015fallhw/user9999
content/notebook/SIGEvolution.ipynb
agpl-3.0
from deap import base, creator creator.create("FitnessMin", base.Fitness, weights=(-1.0,)) """ Explanation: DEAP - Enabling Nimbler Evolutions by François-Michel De Rainville, Félix-Antoine Fortin, Marc-André Gardner, Marc Parizeau, and Christian Gagné <img src="files/images/deap_highlights.png" width="400px" style="f...