repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/analyses/churn.ipynb
mit
from __future__ import division import pandas as pd import numpy as np import matplotlib.pyplot as plt import json from sklearn.cross_validation import KFold from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import train_test_split from sklearn.svm import SVC from sklearn.ensemble import R...
rdhyee/webtech-learning
notebooks/js_notes.ipynb
apache-2.0
%%javascript // version of jQuery element.text($.fn.jquery) %%javascript { // incorrect attempt to compute element independently... // just use element: http://stackoverflow.com/a/20020566/ var _e = IPython.notebook.get_selected_cell().output_area.element; var _element = _e.find(".rendered_html"); element.text...
udacity/deep-learning
sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
GoogleCloudPlatform/python-docs-samples
notebooks/tutorials/bigquery/BigQuery query magic.ipynb
apache-2.0
%%bigquery SELECT name, SUM(number) as count FROM `bigquery-public-data.usa_names.usa_1910_current` GROUP BY name ORDER BY count DESC LIMIT 10 """ Explanation: BigQuery query magic Jupyter magics are notebook-specific shortcuts that allow you to run commands with minimal syntax. Jupyter notebooks come with many built-...
astroferreira/galclean
Galclean Example.ipynb
gpl-2.0
%matplotlib inline import numpy as np from galclean import galclean, plot_result, galshow from matplotlib import pyplot as plt from astropy.io import fits """ Explanation: Refer to the requirements.yml file to reproduce the same conda env used in this Notebook. Using latest versions of Astropy, photutils, matplotlib...
SamLau95/nbinteract
docs/notebooks/recipes/recipes_interactive_questions.ipynb
bsd-3-clause
import nbinteract as nbi """ Explanation: Interactive Questions nbinteract also provides built-in methods to easily create multiple choice and short answer questions. End of explanation """ nbi.multiple_choice(question="What is 10 + 2 * 5?", choices=['12', '60', '20'], answers...
cmflannery/MAE170
jupyter/lab5/Lab5-camerons_updates.ipynb
mit
temp1 = np.array([30,35,40,45,50,55,60,65,70,75,80,85,90]) temp2 = np.array([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90]) measured = np.array([1.142,1.280,1.475,1.698,1.882,2.10,2.26,2.53,2.70,2.93,3.11,3.32,3.42]) expected = np.array([0,.198,.397,.597,.798,1,1.203,1.407,1.612,1.817,2.023,2.230,2.436,2.644,...
bmeaut/python_nlp_2017_fall
course_material/05_Decorators_Packaging/05_Decorators_lab.ipynb
mit
import functools from datetime import datetime def timer(func): @functools.wraps(func) def timed_func(*args, **kwargs): start = datetime.now() ret = func(*args, **kwargs) tm = datetime.now() - start print("Running time: {}".format(tm.total_seconds())) return ret retu...
gschivley/ERCOT_power
Raw Data/Merging EPA and EIA.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import pandas as pd import os import glob import re import cPickle as pickle import gzip import seaborn as sns """ Explanation: TODO: Verify that the merge result is as expected. I noticed that when I checked the length of the EPA for a 6-month period, the length w...
christophebertrand/ada-epfl
HW02-Data_from_the_Web/bachelor_data_analysis.ipynb
mit
select = soupe.find_all('select') select_name = [s.attrs['name'] for s in select] select_name """ Explanation: Collect the data Get the name of the 4 fields we have to select End of explanation """ select_field = [soupe.find('select',{'name': name}) for name in select_name] """ Explanation: Get the select field c...
ES-DOC/esdoc-jupyterhub
notebooks/niwa/cmip6/models/sandbox-1/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'niwa', 'sandbox-1', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: NIWA Source ID: SANDBOX-1 Sub-Topics: Radiative Forcings. Properties: 85 (42 ...
OSHI7/Learning1
MatplotLib Pynotebooks/AnatomyOfMatplotlib-Part5-Artists.ipynb
mit
""" Show examples of matplotlib artists http://matplotlib.org/api/artist_api.html Several examples of standard matplotlib graphics primitives (artists) are drawn using matplotlib API. Full list of artists and the documentation is available at http://matplotlib.org/api/artist_api.html Copyright (c) 2010, Bartosz Telen...
Cyberface/nrutils_dev
review/notebooks/dev_bam_extraction_radius.ipynb
mit
# Setup ipython environment %load_ext autoreload %autoreload 2 # %matplotlib auto %matplotlib inline # Import useful things from nrutils import scsearch,gwylm # Setup plotting backend import matplotlib as mpl from mpl_toolkits.mplot3d import axes3d mpl.rcParams['lines.linewidth'] = 0.8 mpl.rcParams['font.family'] = 'se...
seg/2016-ml-contest
Anjum48/Anjum48 Facies Classification.ipynb
apache-2.0
%matplotlib inline import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable from pandas import set_option set_option("display.max_rows", 10) pd.options.mode.chained_assignment = None filen...
ColeLab/informationtransfermapping
EmpiricalResults/Demo_Network2NetworkInformationTransfer.ipynb
gpl-3.0
import sys import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt import statsmodels.sandbox.stats.multicomp as mc import multiprocessing as mp %matplotlib inline import os os.environ['OMP_NUM_THREADS'] = str(1) import warnings warnings.filterwarnings('ignore') import networkinformationtransfer...
bjedwards/NetworkXTutorial
III. Graph Generators.ipynb
bsd-3-clause
import networkx as nx """ Explanation: Graph Generators NetworkX comes with a large number of builtin graph generators. These can be especially useful for testing out new measures, metrics, and dynamics, on already well tested algorithms. In this notebook, we'll go through some of the different classes of graph genera...
nbortolotti/tensorflow-code-experiences
colaboratory/5steps_object_detection.ipynb
apache-2.0
!git clone https://github.com/tensorflow/models.git !apt-get -qq install libprotobuf-java protobuf-compiler !protoc ./models/research/object_detection/protos/string_int_label_map.proto --python_out=. !cp -R models/research/object_detection/ object_detection/ !rm -rf models """ Explanation: <a href="https://colab.resea...
mne-tools/mne-tools.github.io
0.18/_downloads/4702564ec4882e1756a75c62d2a92ee4/plot_stats_cluster_1samp_test_time_frequency.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.stats import permutation_cluster_1samp_test from mne.datasets import sample print(__doc__) """ Explanat...
mwickert/SP-Comm-Tutorial-using-scikit-dsp-comm
tutorial_part0/Speech Processing.ipynb
bsd-2-clause
Image('images/PyAudio_RT_flow@300dpi.png',width='80%') pah.available_devices() """ Explanation: Introduction Without getting too detailed Lab is about a simple technique for either increasing or decreasing the playing time of a sound array, without altering the sound's pitch. Increasing the rate refers to decreasing ...
jason-neal/spectrum_overload
Notebooks/Tutorial.ipynb
mit
from __future__ import division, print_function from spectrum_overload import Spectrum from astropy.io import fits import copy import numpy as np import matplotlib.pyplot as plt """ Explanation: Tutorial for spectrum_overload Jason Neal September 2016 Spectrum is a module based around a class called Spectrum. It a...
fonnesbeck/scipy2015_tutorial
notebooks/4. Resampling Methods and Missing Data.ipynb
cc0-1.0
salmon = pd.read_table("../data/salmon.dat", delim_whitespace=True, index_col=0) plt.scatter(x=salmon.spawners, y=salmon.recruits) """ Explanation: Resampling Methods Resampling is the process of repeatedly drawing subsamples from a training dataset, and fitting a model to each sample with the goal of discovering addi...
gedman4b/MachineLearning
Python/Personalized Medicine.ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: <b>Objective</b> Develop algorithms to classify genetic mutations based on clinical evidence (text) End of explanation """ training_variants_df = pd.read_csv('data/training_variants.csv') training_variants_df....
google/jax
docs/jax-101/03-vectorization.ipynb
apache-2.0
import jax import jax.numpy as jnp x = jnp.arange(5) w = jnp.array([2., 3., 4.]) def convolve(x, w): output = [] for i in range(1, len(x)-1): output.append(jnp.dot(x[i-1:i+2], w)) return jnp.array(output) convolve(x, w) """ Explanation: Automatic Vectorization in JAX Authors: Matteo Hessel In the previou...
rvuduc/cse6040-ipynbs
12--pagerank.ipynb
bsd-3-clause
import sqlite3 as db import pandas as pd def get_table_names (conn): assert type (conn) == db.Connection # Only works for sqlite3 DBs query = "SELECT name FROM sqlite_master WHERE type='table'" return pd.read_sql_query (query, conn) def print_schemas (conn, table_names=None, limit=0): assert type (con...
ES-DOC/esdoc-jupyterhub
notebooks/nims-kma/cmip6/models/sandbox-2/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-2', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NIMS-KMA Source ID: SANDBOX-2 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Ener...
GoogleCloudPlatform/dfcx-scrapi
examples/google_sheets_series/cx_to_sheets_by_flow.ipynb
apache-2.0
#If you haven't already, make sure you install the `dfcx-scrapi` library !pip install dfcx-scrapi """ Explanation: Introduction In this notebook, we will demonstrate how Google Sheets can be used as a simple medium for managing, updating, and evaluating Intents and Training Phrases in Dialogflow CX. Specifically, we ...
aldian/tensorflow
tensorflow/lite/g3doc/tutorials/model_maker_question_answer.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...
halimacc/CS231n-assignments
assignment2/Dropout.ipynb
unlicense
# As usual, a bit of setup from __future__ import print_function import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solv...
tlapicka/IPythonNotebooks
Matplotlib--popisky,znacky.ipynb
gpl-2.0
f=logspace(0,4,1000) C=1e-6 R=3e3 au=(1./(1j*2*pi*f*C)) / (R+(1./(1j*2*pi*f*C))) fig=figure() ax=subplot(111) semilogx(f,20*log10(abs(au))) grid(True,'both') text(200,-10,'-20dB/dek',size=20,rotation=-50) figtext(0.8,0.05,'OSA X') figtext(0.05,0.8, 'OSA Y',rotation=90) l = plt.axvline(x= 1/(2*pi*R*C), ymax=0.95, li...
keii11/TIL
elements_of_programing_python/c5_arrays/c5_bootcamp.ipynb
mit
def even_odd(A): """この関数では,左に偶数の値,右に奇数の値を集めていく. まだ決まっていない部分がそれらのインデックスに挟まれた領域を示すと考え, 3種類のsubarrayから構成されていると見做すこともできる. Args: A: list of integers. Returns: Sorted list, with the even numbers are at the left side and odd numbers are at the right side. """ next_even, next_odd = ...
Timonzimm/CS-401
HW02/Homework 2.ipynb
mit
import requests, re, html import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from bs4 import BeautifulSoup from tqdm import tqdm_notebook import warnings warnings.filterwarnings('ignore') NUM_OBS = 200 """ Explanation: 02 - Data from the Web Deadline Wednesday October 25, 20...
victor-o-silva/python_subdict
DOCS.ipynb
mit
d = { 'a': 'A', 'b': 'B', 'c': 'C', 'd': { 'x': 'D_X', 'y': 'D_Y', 'z': { 'I': 'D_Z_I', 'II': { '1': 'D_Z_II_1', '2': 'D_Z_II_2' }, 'III': 'D_Z_III' } } } """ Explanation: python_subdict ...
zhoujli/zhoujli.github.io
_source/2016-3-11-Spark-II.ipynb
mit
%matplotlib inline import seaborn as sns import pandas as pd user = sc.textFile("E:/Documents/zhoujli.github.io/_source/ml-100k/u.user") """ Explanation: In my last post I briefly introduce how I set up Apache Spark on my own laptop. In this post, I will start using Spark and Python to do some data exploration. Resil...
therealAJ/python-sandbox
data-science/learning/ud1/DataScience/PolynomialRegression.ipynb
gpl-3.0
%matplotlib inline from pylab import * np.random.seed(2) pageSpeeds = np.random.normal(3.0, 1.0, 1000) purchaseAmount = np.random.normal(50.0, 10.0, 1000) / pageSpeeds scatter(pageSpeeds, purchaseAmount) """ Explanation: Polynomial Regression What if your data doesn't look linear at all? Let's look at some more real...
DarkEnergyScienceCollaboration/Twinkles
examples/notebooks/MatchingLensGalaxies-SN.ipynb
mit
import numpy as np import pandas as pd import matplotlib as mpl mpl.rcParams['text.usetex'] = False from matplotlib import pyplot as plt import os from lsst.sims.photUtils import Sed, Bandpass, BandpassDict, getImsimFluxNorm %matplotlib inline """ Explanation: Matching Gravitationally Lensed SNe (GLSNe) Lens Galaxies...
alfkjartan/control-computarizado
state-space/notebooks/Under construction - Output feedback controller for the harmonic oscillator.ipynb
mit
import numpy as np import sympy as sy sy.init_printing(use_latex='mathjax', order='lex') h,omega = sy.symbols('h,omega', real=True, positive=True) A = sy.Matrix([[0,-omega**2], [1,0]]) B = sy.Matrix([[1],[0]]) Phi = sy.simplify(sy.exp(A*h).rewrite(sy.sin)) Phi s = sy.symbols('s',real=True, positive=True) Gamma = sy....
intel-analytics/BigDL
python/orca/colab-notebook/quickstart/tf2_keras_lenet_mnist.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
jserenson/Python_Bootcamp
Timing your code - timeit.ipynb
gpl-3.0
import timeit """ Explanation: Timing your code Sometimes its important to know how long your code is taking to run, or at least know if a particular line of code is slowing down your entire project. Python has a built-in timing module to do this. This module provides a simple way to time small bits of Python code. I...
CheungChanDevCoder/blog
python/ipynb/人人推荐系统调研综述.ipynb
mit
import numpy as np import pandas as pd import os # 使用pandas加载csv数据 movies = pd.read_csv(os.path.expanduser("~/ml-latest-small/movies.csv")) ratings = pd.read_csv(os.path.expanduser("~/ml-latest-small/ratings.csv")) # 去掉无用的维度 ratings.drop(['timestamp'],axis=1,inplace=True) movies.head() ratings.head() # 将movieid替换为mo...
datactive/bigbang
examples/network_analysis/Show Interaction Graph.ipynb
mit
%matplotlib inline """ Explanation: This notebook shows how BigBang can be used to display a graph of interactions in the mailing list over some period of time. First we'll make the I Python notebook display computed visualizations inline. End of explanation """ from bigbang.archive import Archive import bigbang.par...
GoogleCloudPlatform/training-data-analyst
blogs/timeseries/rnn_cloudmle.ipynb
apache-2.0
!pip install --upgrade tensorflow import tensorflow as tf print tf.__version__ import numpy as np import tensorflow as tf import seaborn as sns import pandas as pd SEQ_LEN = 10 def create_time_series(): freq = (np.random.random()*0.5) + 0.1 # 0.1 to 0.6 ampl = np.random.random() + 0.5 # 0.5 to 1.5 x = np.sin...
syednasar/datascience
ml-template/Template Machine Learning Notebook.ipynb
mit
import pandas as pd iris_data = pd.read_csv('iris-data.csv') iris_data.head() """ Explanation: A template for Data Science By Nasar, S. It is recommended to view this notebook in nbviewer for the best viewing experience. Table of contents Introduction License Required libraries The problem domain Step 1: An...
philippgrafendorfe/stackedautoencoders
.ipynb_checkpoints/MNIST_Autoencoder_dim_reduction-checkpoint.ipynb
mit
from keras.layers import Input, Dense, Dropout from keras.models import Model from keras.datasets import mnist from keras.models import Sequential, load_model from keras.optimizers import RMSprop from keras.callbacks import TensorBoard from keras.utils import plot_model from IPython.display import Image from matplotlib...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/pipelines/google_cloud_pipeline_components_TPU_model_train_upload_deploy.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex AI Pipelines: TPU model train, upload, and deploy using google-cloud-pipeline-component...
saga-survey/saga-code
ipython_notebooks/Masterlist Generation.ipynb
gpl-2.0
inedd = ~mastercat0['Dist_edd'].mask inkk = ~mastercat0['Dist_kk'].mask sum(inedd), sum(inkk), sum(inedd&inkk) meths = list(np.unique(kknearby['Meth'])) meths = dict(zip(meths, range(len(meths)))) plt.scatter(kknearby['Dist'], [meths[m] for m in kknearby['Meth']],lw=0,alpha=.1) plt.yticks(meths.values(), meths.keys())...
judithyueli/pyFKF
.ipynb_checkpoints/Demo-checkpoint.ipynb
mit
from IPython.html.widgets import interact, interactive, fixed from IPython.html.widgets import FloatSlider from CO2simulation import CO2simulation def plot_CO2plume(time): import param as param CO2 = CO2simulation(param) x = CO2.extract_state(int(time/3)) data = CO2.extract_data(int(time/3)) fig_set...
saketkc/hatex
2017_Fall/CSCI-599/Assignment01/Problem_1.ipynb
mit
from __future__ import division from lib.fully_conn import * from lib.layer_utils import * from lib.grad_check import * from lib.datasets import * from lib.optim import * from lib.train import * import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set def...
xianjunzhengbackup/code
data science/Extending_to_Linear_regression.ipynb
mit
fitted_model.summary() print (fitted_model.params) betas = np.array(fitted_model.params) fitted_values = fitted_model.predict(X) """ Explanation: If we had wanted to manage the same result using the StatsModels.formula.api, we should have typed the following: linear_regression = smf.ols(formula='target ~ RM', dat...
ioos/notebooks_demos
notebooks/2017-06-12-NCEI_RA_archive_history.ipynb
mit
from owslib.iso import namespaces # Append gmi namespace to namespaces dictionary. namespaces.update({"gmi": "http://www.isotc211.org/2005/gmi"}) namespaces.update({"gml": "http://www.opengis.net/gml/3.2"}) """ Explanation: Using NCEI geoportal REST API to collect information about IOOS Regional Association archived ...
scottprahl/miepython
docs/02_efficiencies.ipynb
mit
#!pip install --user miepython import importlib.resources import numpy as np import matplotlib.pyplot as plt try: import miepython except ModuleNotFoundError: print('miepython not installed. To install, uncomment and run the cell above.') print('Once installation is successful, rerun this cell again.') ...
herruzojm/udacity-deep-learning
sentiment-rnn/Sentiment_RNN_Solution.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
napsternxg/Udacity-Deep-Learning
udacity/5_word2vec.ipynb
gpl-3.0
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. import collections import math import numpy as np import os import random import tensorflow as tf import urllib import zipfile from matplotlib import pylab from sklearn.manifold import TSNE """ Explanation: Dee...
saudijack/unfpyboot
Day_01/03_Homework/Homework_01/00_Homework-Solutions.ipynb
mit
%pylab inline """ Explanation: Homework 1 Google Trends is pretty awesome, except that on the site you cannot do more than overlay plots. Here we'll play with search term data downloaded from Google and draw our own conclusions. Data from: https://www.google.com/trends/explore#q=spring%20break%2C%20textbooks%2C%20nor...
arturops/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...
ilanfri/StatsML
Bayesian_bootstrap.ipynb
bsd-3-clause
import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.style.use('ggplot') %matplotlib inline data = pd.read_csv('american_presidents.csv', header=0, index_col=None) data data.describe() data.plot(x='order',y='height_cm', color='blue') data.plot('order', kind='hist', color='blue') import random...
GoogleCloudPlatform/tf-estimator-tutorials
07_Image_Analysis/01.0 - CNN with CIFAR-10 binary dataset.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import os import re import shutil import sys import tarfile import tensorflow as tf from six.moves import urllib print(tf.__version__) def maybe_download_and_extract( dest_directory='data', data_url='http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz'): ...
volgy/notebook
SNR_SINAD_THD.ipynb
mit
%matplotlib inline from itertools import combinations import numpy as np import matplotlib.pyplot as plt from scipy.signal import get_window FS = 20e6 # sampling freq N = int(1e5) # number of samples FREQ = 3 * FS / 20 # frequency of the signal (avoid harmonics near DC) N_FFT = 8192 N_HARMONICS = 3 #...
ecell/ecell4-notebooks
en/tutorials/tutorial09.ipynb
gpl-2.0
from ecell4.prelude import * w1 = ode.World(ones()) w2 = gillespie.World(ones()) """ Explanation: 9. Spatial Gillespie Method 9.1. Spaces in E-Cell4 What the space in E-Cell4 looks like? End of explanation """ w3 = ode.World(Real3(2, 0.5, 1)) # is almost equivalent to 'w1' w4 = gillespie.World(Real3(2, 2, 0.25)) ...
jorgemauricio/INIFAP_Course
ejercicios/Seaborn/2_Graficas_Categoricas.ipynb
mit
import seaborn as sns %matplotlib inline tips = sns.load_dataset('tips') tips.head() """ Explanation: Categorical Data Plots Now let's discuss using seaborn to plot categorical data! There are a few main plot types for this: factorplot boxplot violinplot stripplot swarmplot barplot countplot Let's go through exampl...
DarkEnergyScienceCollaboration/Twinkles
examples/notebooks/MatchingLensGalaxies.ipynb
mit
import numpy as np import matplotlib as mpl mpl.rcParams['text.usetex'] = False from matplotlib import pyplot as plt import corner import urllib import os from sklearn.cross_validation import train_test_split from astroML.plotting import setup_text_plots from lsst.sims.photUtils import Sed, Bandpass, BandpassDict, getI...
kmunve/APS
aps/notebooks/varsom_training_data.ipynb
mit
import sys import pandas as pd import numpy as np import json from flatten_json import flatten from pprint import pprint from pathlib import Path # make sure the aps module is in the pythonpath APS_dir = str(Path.cwd().parents[1]) if APS_dir not in sys.path: sys.path.append(APS_dir) import aps.aps_io.get_forecasts ...
JKeun/project-02-watcha
02_preprocess/05_preprocess_expectation_df(mean, std, skewness).ipynb
mit
df = pd.read_csv('../resource/preprocess_dist_df.csv') col = df.columns.astype(float).values df.head() """ Explanation: 별점분포의 mean, var, skewness 구하기 - expect_df $\mu = E[X] = \sum x \cdot p(x)$ $\sigma^2 = E[(X - \mu)^2] = \sum (x - \mu)^2 p(x)$ $\frac{\mu_3}{\sigma^3} = \operatorname{E}\left[\left(\frac{X-\mu}{\sig...
mne-tools/mne-tools.github.io
0.21/_downloads/31a362832c6e14bb418b12340a063c91/plot_movement_detection.ipynb
bsd-3-clause
# Authors: Adonay Nunes <adonay.s.nunes@gmail.com> # Luke Bloy <luke.bloy@gmail.com> # License: BSD (3-clause) import os.path as op import mne from mne.datasets.brainstorm import bst_auditory from mne.io import read_raw_ctf from mne.preprocessing import annotate_movement, compute_average_dev_head_t # Load d...
kubeflow/kfp-tekton-backend
components/gcp/ml_engine/deploy/sample.ipynb
apache-2.0
%%capture --no-stderr KFP_PACKAGE = 'https://storage.googleapis.com/ml-pipeline/release/0.1.14/kfp.tar.gz' !pip3 install $KFP_PACKAGE --upgrade """ Explanation: Name Deploying a trained model to Cloud Machine Learning Engine Label Cloud Storage, Cloud ML Engine, Kubeflow, Pipeline Summary A Kubeflow Pipeline compone...
ajaybhat/DLND
Project 3/dlnd_tv_script_generation.ipynb
apache-2.0
import time import pylab as pl from IPython import display """ 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...
nyoungb2/CLdb
doc/examples/Ecoli/arrayBlast.ipynb
gpl-2.0
# directory where you want the spacer blasting to be done ## CHANGE THIS! workDir = "/home/nyoungb2/t/CLdb_Ecoli/" """ Explanation: Description: This notebook goes through the analysis of blasting spacers vs a database containing potential protospacers. Any blast datbase can be used. A script is provided to easily bl...
stephensekula/smu-honors-physics
pi_monte_carlo/Monte Carlo Lecture Code.ipynb
mit
Ntotal = 100 print(Ntotal) Nin = 55.0 print(Ntotal/Nin) """ Explanation: Monte Carlo Methods: Computation of Pi Basics: variables, values, printing End of explanation """ import random random.uniform(0.0,1.0) random.uniform(0.0,1.0) random.uniform(0.0,1.0) random.uniform(0.0,1.0) """ Explanation: Random Numbers...
QuantEcon/QuantEcon.notebooks
sci_python_quickstart.ipynb
bsd-3-clause
import sys print(sys.version) """ Explanation: Scientific Python Quickstart John Stachurski ANU This is a fast-paced, hands-on introduction to scientific computing with Python, contained in a Jupyter notebook. The main focus will be on introducing Python's four most important scientific libraries: NumPy, Scipy, Panda...
tpin3694/tpin3694.github.io
machine-learning/ski-tomasi_corner_detector.ipynb
mit
# Load image import cv2 import numpy as np from matplotlib import pyplot as plt """ Explanation: Title: Shi-Tomasi Corner Detector Slug: ski-tomasi_corner_detector Summary: How to detect corners images using OpenCV in Python with the Shi-Tomasi Corner Detector. Date: 2017-09-11 12:00 Category: Machine Learning Tags...
shaunharker/DSGRN
Tutorials/GettingStarted.ipynb
mit
import DSGRN """ Explanation: DSGRN Python Interface Tutorial This notebook shows the basics of manipulating DSGRN with the python interface. End of explanation """ network = DSGRN.Network(""" X1 : (X1+X2)(~X3) X2 : (X1) X3 : (X1)(~X2)""") DSGRN.DrawGraph(network) """ Explanation: Network The starting point of the...
NYUDataBootcamp/Projects
UG_S17/Gender Inequality-Shi-Zhou.ipynb
mit
%matplotlib inline import sys # system module import numpy as np # scientific computing import pandas as pd # data package import matplotlib as mpl import matplotlib.pyplot as plt # graphics module """ Explanation: Data Bootcamp Final Proj...
splicemachine/splice-community-sample-code
twimlcon-workshop-materials/4 - Model Deployment.ipynb
apache-2.0
#Begin spark session from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() #Create pysplice context. Allows you to create a Spark dataframe using our Native Spark DataSource from splicemachine.spark import PySpliceContext splice = PySpliceContext(spark) #Initialize our Feature Store API fr...
openstreams/wflow
notebooks/openDAP-e2o.ipynb
gpl-3.0
#!/usr/bin/env python # we need the netcdf4 library. This allows us to read netcdf from OpeNDAP or files import netCDF4 # Uncomment these if needed #from numpy import * #from scipy import * # specify an url rainurl = 'http://wci.earth2observe.eu/thredds/dodsC/ecmwf/met_forcing_v0/2012/Rainf_daily_E2OBS_201201.nc' # ...
kubeflow/fairing
examples/lightgbm/simple-training.ipynb
apache-2.0
from kubeflow import fairing # Setting up google container repositories (GCR) for storing output containers # You can use any docker container registry istead of GCR GCP_PROJECT = fairing.cloud.gcp.guess_project_name() DOCKER_REGISTRY = 'gcr.io/{}/fairing-job'.format(GCP_PROJECT) BASE_IMAGE = 'gcr.io/{}/lightgbm:lates...
squaseghost/WWU-projects
Lab9 - TOOLS.ipynb
gpl-3.0
import numpy as np from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Lab 4: Curve Fitting Jacob Skinner End of explanation """ x=np.array([1.1,2.2,3.1,4.0,5.0,5.8,6.9]) y=np.array([2.0,3.0,4.0,5.0,6.0,7.0,8.0]) dely=np.array([0.1,0.1,0.1,0.1,0.1,0.1,0.1]) plt.plot(x,y,'ro') plt.show() """ Ex...
chusine/dlnd
face_generation/dlnd_face_generation-Original.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...
phoebe-project/phoebe2-docs
2.3/examples/rossiter_mclaughlin.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" """ Explanation: Rossiter-McLaughlin Effect Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe import numpy as np b = phoebe.default_bina...
alexwhb/algorithm-practice
jupyter-notebooks/algorithems/Graphs DFS and BFS.ipynb
mit
graph = {'A': set(['B', 'C']), 'B': set(['A', 'D', 'E']), 'C': set(['A', 'F']), 'D': set(['B']), 'E': set(['B', 'F']), 'F': set(['C', 'E'])} print(graph) set1 = set(['a', 'b']) set2 = set(['b', 'c']) set1.difference(set2) set1.intersection(set2) set1.issubset(set2) set...
organicmatters/Learnfastai
deeplearning1/nbs/lesson1.ipynb
apache-2.0
%matplotlib inline """ Explanation: Using Convolutional Neural Networks Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning. Introduction to this week's task: 'Do...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/introduction_to_tensorflow/solutions/feat.cols_tf.data.ipynb
apache-2.0
# You can use any Python source file as a module by executing an import statement in some other Python source file. # The import statement combines two operations; it searches for the named module, then it binds the results of that search # to a name in the local scope. import numpy as np import pandas as pd # Import m...
bloomberg/bqplot
examples/Tutorials/Pyplot.ipynb
apache-2.0
import bqplot.pyplot as plt # first, let's create two vectors x and y to plot using a Lines mark import numpy as np x = np.linspace(-10, 10, 100) y = np.sin(x) # 1. Create the figure object fig = plt.figure(title="Simple Line Chart") # 2. By default axes are created with basic defaults. If you want to customize the...
DominikDitoIvosevic/Uni
STRUCE/2018/.ipynb_checkpoints/SU-2018-LAB03-SVM-i-kNN-checkpoint.ipynb
mit
import numpy as np import scipy as sp import pandas as pd import mlutils import matplotlib.pyplot as plt %pylab inline """ Explanation: Sveučilište u Zagrebu Fakultet elektrotehnike i računarstva Strojno učenje 2018/2019 http://www.fer.unizg.hr/predmet/su Laboratorijska vježba 3: Stroj potpornih vektora i algoritam...
javoweb/deep-learning
image-classification/.ipynb_checkpoints/dlnd_image_classification-checkpoint.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' class DLProgress(tqdm): last_block = 0 def hoo...
enbanuel/phys202-2015-work
assignments/assignment10/ODEsEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 1 Imports End of explanation """ def solve_euler(derivs, y0, x): """Solve a 1d ...
Diyago/Machine-Learning-scripts
DEEP LEARNING/Pytorch from scratch/MLP/Part 2 - Neural Networks in PyTorch (Solution).ipynb
apache-2.0
# Import necessary packages %matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import torch import helper import matplotlib.pyplot as plt """ Explanation: Neural networks with PyTorch Deep learning networks tend to be massive with dozens or hundreds of layers, that's where the ter...
srnas/barnaba
examples/example_12_escore.ipynb
gpl-3.0
from barnaba import escore pdb = "../test/data/1S72.pdb" Escore = escore.Escore([pdb]) """ Explanation: eSCORE, a scoring function for RNA structure prediction With barnaba it is possible to score decoys according to the eSCORE function. Essentially, we train a simple statistical potential using the interactions obser...
pyannote/pyannote-audio
tutorials/add_your_own_task.ipynb
mit
# this assumes that the AMI corpus has been setup for diarization # according to https://github.com/pyannote/AMI-diarization-setup import os os.environ['PYANNOTE_DATABASE_CONFIG'] = '/Users/bredin/Development/pyannote/pyannote-db/AMI-diarization-setup/pyannote/database.yml' from pyannote.database import get_protocol, ...
tpin3694/tpin3694.github.io
python/pandas_create_pipeline.ipynb
mit
import pandas as pd """ Explanation: Title: Create A Pipeline In Pandas Slug: pandas_create_pipeline Summary: Create a pipeline in pandas. Date: 2017-01-16 12:00 Category: Python Tags: Data Wrangling Authors: Chris Albon Pandas' pipeline feature allows you to string together Python functions in order to build a pip...
antoinecarme/pyaf
docs/PyAF_Introduction.ipynb
bsd-3-clause
import pandas as pd csvfile_link = "https://raw.githubusercontent.com/antoinecarme/TimeSeriesData/master/ozone-la.csv" ozone_dataframe = pd.read_csv(csvfile_link); """ Explanation: An introduction to time series forecasting with PyAF This is an introduction to time series forecasting with PyAF. We describe the basi...
fugufisch/hu_bp_python_course
07_modelling/Modelling_Hard.ipynb
mit
# initial values time_range = range(0,100) k1 = 0.2 k2 = 0.1 conc_A = 3.0 conc_B = 2.0 conc_C = 2.5 # function to return changes def eval_change(): # reactions v1 = k1 * conc_A * conc_B v2 = k2 * conc_C dadt = -v1 + v2 dbdt = -v1 + v2 dcdt = v1 - v2 return dadt, dbdt, dcdt # solutions for ...
kit-cel/wt
wt/vorlesung/basic_concepts_Python.ipynb
gpl-2.0
# defining lists sport_list = [ 'cycling', 'football', 'fitness' ] first_prime_numbers = [ 2, 3, 5, 7, 11, 13, 17, 19 ] # getting contents sport = sport_list[ 2 ] third_prime = first_prime_numbers[ 2 ] # printing print( 'All sports:', sport_list ) print( 'Sport to be done:', sport ) print( '\nFirst primes:', first_p...
agile-geoscience/xlines
notebooks/00_Synthetic_wedge_model.ipynb
apache-2.0
import matplotlib.pyplot as plt import numpy as np """ Explanation: X lines of Python Wedge model This is part of an Agile blog series called x lines of Python. We start with the usual preliminaries. End of explanation """ length, depth = 40, 100 model = 1 + np.tri(depth, length, -depth//3, dtype=int) model[:depth//...
newsapps/public-notebooks
Crimes by beat.ipynb
mit
from datetime import datetime, timedelta pivot = datetime.strptime('11/18/2014', '%m/%d/%Y') today = datetime.strptime('1/18/2016', '%m/%d/%Y') print today - pivot period = timedelta(days=426) print pivot - period """ Explanation: First, we need to know how far back to go. We want equal number of days before and afte...
TomTranter/OpenPNM
examples/paper_recreations/Tranter et al. (2017)/Tranter et al. (2017) - Part A.ipynb
mit
import pickle import numpy as np import openpnm as op from pathlib import Path import matplotlib.pyplot as plt from openpnm.models import physics as pm %matplotlib inline ws = op.Workspace() ws.settings["loglevel"] = 50 ws.clear() np.random.seed(10) path = Path('../../fixtures/hysteresis_paper_network.pnm') save_net =...
mne-tools/mne-tools.github.io
stable/_downloads/58e35821e0f211b843d5ead3e33d8849/20_sensors_time_frequency.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # Richard Höchenberger <richard.hoechenberger@gmail.com> # # License: BSD-3-Clause import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency...
google/tf-quant-finance
tf_quant_finance/examples/jupyter_notebooks/Root_Search.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/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', 'miroc', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: MIROC Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Ra...
Olsthoorn/TransientGroundwaterFlow
exercises_notebooks/WellInLeakyAquifer.ipynb
gpl-3.0
import numpy as np import matplotlib.pylab as plt #%%writefile wells.py # remove first # to write this as file "wells.py" to disk import pdb import numpy as np from scipy.special import expi def W(u): return -expi(-u) # Theis def wh(u, rho): """Returns Hantush's well function values Note: works only for...
NYUDataBootcamp/Projects
UG_S16/Yusef-Shaheen-IPO-Underpricing.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt import numpy as np import requests import re plt.style.use('ggplot') import matplotlib %matplotlib inline """ Explanation: Abstract Companies seeking public funding partner up with investment banks who bear the responsibility of facilitating the private bidding proce...
danresende/deep-learning
sentiment_network/Sentiment Classification - Mini Project 3.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...