repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
Saxafras/Spacetime
1-D CA and TransducerTests.ipynb
bsd-3-clause
A = 2 r = 1 table = lookup_table(18, 2, 1) R = 2*r + 1 scan = tuple(np.arange(0,A)[::-1]) for a in product(scan, repeat = R): print a, table[a] x = [0,1,1,0] print neighborhood(x, 1) for item in neighborhood(x, 1): print item print max_rule(2,1) print example.current_state() example.evolve(1) print example.c...
kpei/cs-rating
wl_model/wlbet_team_model_all.ipynb
gpl-3.0
import pandas as pd import numpy as np import datetime as dt from scipy.stats import norm, bernoulli %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns from spcl_case import * plt.style.use('fivethirtyeight') """ Explanation: Win/Loss Betting Model Same as other one but I now filter by teams that...
ebellm/ztf_summerschool_2015
notebooks/SNe_Ia_with_PTF.ipynb
bsd-3-clause
# execute this cell SNlcs = Table.read("../data/Firth14Tbl2.txt", format = 'ascii') SNlcs """ Explanation: Hands-On Exercise 6: Determining $H_0$ with Type Ia SNe from PTF Version 0.1 Today we learned about a variety of different explosive, extragalactic transients. While the lectures focused on recently discovered, ...
junghao/fdsn
examples/GeoNet_FDSN_demo_event.ipynb
mit
from obspy import UTCDateTime from obspy.clients.fdsn import Client as FDSN_Client from obspy import read_inventory """ Explanation: GeoNet FDSN webservice with Obspy demo - Event Service This demo introduces some simple code that requests data using GeoNet's FDSN webservices and the obspy module in python. This noteb...
billzhao1990/CS231n-Spring-2017
assignment2/TensorFlow.ipynb
mit
import tensorflow as tf import numpy as np import math import timeit import matplotlib.pyplot as plt %matplotlib inline from cs231n.data_utils import load_CIFAR10 def get_CIFAR10_data(num_training=49000, num_validation=1000, num_test=10000): """ Load the CIFAR-10 dataset from disk and perform preprocessing to...
agile-geoscience/welly
docs/_userguide/Wells.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import welly welly.__version__ """ Explanation: Wells Wells are one of the fundamental objects in welly. Well objects include collections of Curve objects. Multiple Well objects can be stored in a Project. On this page, we take a closer look at the Well. First, some ...
kmunve/TSanalysis
Test/new_snow_problem.ipynb
mit
# -*- coding: utf-8 -*- %matplotlib inline from __future__ import print_function import pylab as plt import datetime import numpy as np plt.rcParams['figure.figsize'] = (14, 6) """ Explanation: APS - new snow Imports End of explanation """ # New snow amount last 24 h 0-60 cm [10 cm intervals] new_snow_24h_cat = np.a...
jameskermode/f90wrap
examples/callback_print_function_issue93/callback_print_output_python.ipynb
lgpl-3.0
import CBF """ Explanation: Setting a callback message to trap print output print * statements in Fortran do print to the Python console stdandard output, but there is no satisfactory way to do the same with Jupyter notebooks (so far as I know). This document illustrates how to do so once you've built generated the m...
quantopian/research_public
notebooks/lectures/Instability_of_Estimates/answers/notebook.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import pandas as pd from statsmodels.stats.stattools import jarque_bera # Set a seed so we can play with the data without generating new random numbers every time np.random.seed(321) """ Explanation: Exercises: Instability of Parameter Estimates - Answer Key Lecture...
catarinaqmcosta/Scenarios_Network
ExposureEntireNetwork.ipynb
gpl-3.0
%matplotlib inline import utilsNetwork """ Explanation: Exposure model: Complete highway network This IPython notebook processes a shapefile, and creates an exposure model. Each asset has a typology associated, that will be defined based on an external .csv file or on the length of the asset. End of explanation """ ...
cuttlefishh/papers
vibrio-fischeri-transcriptomics/code/ipynb/vibrio_pathways.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib import rcParams import seaborn as sns from sys import argv """ Explanation: Function imports End of explanation """ gene_dict = { 'Phosphate': ['VF_A1087', 'VF_A1090', 'VF_1611', 'VF_A1057', 'VF_1610', 'VF_1...
studentofdata/qcew
vmfiles/IPNB/Examples/b Graphics/30 Seaborn.ipynb
bsd-3-clause
# The imports %matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set(style="darkgrid") """ Explanation: Seaborn graphics Seaborn is a Python library with "a high-level interface for drawing attractive statistical graphics". This notebook includes some ...
chengsoonong/crowdastro
notebooks/17_training_with_features.ipynb
mit
import itertools import sys import bson import h5py import keras.layers import keras.models import matplotlib.pyplot import numpy import pandas import sklearn.cross_validation import sklearn.dummy import sklearn.linear_model import sklearn.metrics sys.path.insert(1, '..') import crowdastro.data import crowdastro.show...
google-research/google-research
kws_streaming/colab/conv_batch_norm_folding.ipynb
apache-2.0
import tensorflow as tf import numpy as np np.random.seed(123) """ Explanation: Copyright 2019 Google LLC 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 ...
nouiz/summerschool2015
scan_tutorial/scan_tutorial.ipynb
bsd-3-clause
import theano import theano.tensor as T import numpy as np vector1 = T.vector('vector1') vector2 = T.vector('vector2') """ Explanation: Scan In short Mechanism to perform loops in a Theano graph Supports nested loops and reusing results from previous iterations Highly generic Implementation You've previous seen th...
rorimac/Tools-of-a-Math-Student
Chapter2.ipynb
mit
1 + 1 """ Explanation: Using python Python is an interpreted language. This means that there is a "python program" that reads your input and excecutes it. If you open your ipython interpreter, you'll see the following message (or something very similar): Python 2.7.6 (default, Mar 22 2014, 22:59:56) Type "copyright",...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/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', 'ipsl', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbul...
cmorgan/toyplot
docs/tick-locators.ipynb
bsd-3-clause
import numpy x = numpy.arange(20) y = numpy.linspace(0, 1, len(x)) ** 2 import toyplot canvas, axes, mark = toyplot.plot(x, y, width=300) """ Explanation: .. _tick-locators: Tick Locators When you create a figure in Toyplot, you begin by creating a :class:canvas<toyplot.canvas.Canvas>, add :mod:axes<toyplot....
GoogleCloudPlatform/training-data-analyst
bootcamps/imagereco/fashion_cnn_lab.ipynb
apache-2.0
import os PROJECT = 'my-project-id' # REPLACE WITH YOUR PROJECT ID BUCKET = 'my-bucket-name' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 MODEL_TYPE='cnn' # 'dnn' or 'cnn' # do not change these os.environ['PROJECT'] = PROJECT os.environ['BUCKET'] = BUCKET ...
therealAJ/python-sandbox
data-science/learning/ud1/DataScience/PCA.ipynb
gpl-3.0
from sklearn.datasets import load_iris from sklearn.decomposition import PCA import pylab as pl from itertools import cycle iris = load_iris() numSamples, numFeatures = iris.data.shape print numSamples print numFeatures print list(iris.target_names) """ Explanation: Principal Component Analysis PCA is a dimensionali...
jsmanrique/grimoirelab-personal-utils
Light Github index generator.ipynb
mit
import utils utils.logging.basicConfig(level=utils.logging.INFO) settings = utils.read_config_file('settings.yml') es = utils.establish_connection(settings['es_host']) """ Explanation: Github Repositories Index Generator This notebook generates two ElasticSearch (ES) indexes with information about: * git (commits, fil...
georgetown-analytics/machine-learning
examples/bbengfort/occupancy/occupancy.ipynb
mit
%matplotlib notebook import os import csv import pickle import numpy as np import pandas as pd from datetime import datetime from sklearn.pipeline import Pipeline from sklearn.preprocessing import LabelEncoder from sklearn.feature_extraction import DictVectorizer from sklearn.base import BaseEstimator, TransformerM...
Vvkmnn/books
ThinkBayes/09_Two_Dimensions.ipynb
gpl-3.0
import thinkbayes class Paintball(thinkbayes.Suite, thinkbayes.Joint): def __init__(self, alphas, betas, locations): self.locations = locations pairs = [(alpha, beta) for alpha in alphas for beta in betas] thinkbayes.Suite.__init__(self, pairs) """ Expl...
gfrubi/FM2
Notebooks/Ejemplo-MSV-Difusion-Calor-2D-rectangulo.ipynb
gpl-3.0
%matplotlib inline from numpy import * from matplotlib.pyplot import * from mpl_toolkits.mplot3d import axes3d from ipywidgets import interact style.use('classic') """ Explanation: Ecuación de Difusión del calor 2D Discutiremos la solución de la ecuación de difusión del calor bidimensional, $$ \frac{\partial^2 \psi}{...
M0nica/python-foundations-hw
11/.ipynb_checkpoints/Parking Data-checkpoint.ipynb
mit
violations_df = violations_df[violations_df['Vehicle Year'] != 0] # print(violations_df['Vehicle Year'].head()) """ Explanation: I don't think anyone's car was built in 0AD. Discard the '0's as NaN. End of explanation """ # print(violations_df['Date First Observed'].head()) import datetime violations_df.head()['Iss...
ioam/scipy-2017-holoviews-tutorial
notebooks/03-exploration-with-containers.ipynb
bsd-3-clause
import numpy as np import holoviews as hv hv.extension('bokeh') %opts Curve Area [width=600] """ Explanation: <a href='http://www.holoviews.org'><img src="assets/hv+bk.png" alt="HV+BK logos" width="40%;" align="left"/></a> <div style="float:right;"><h2>03. Exploration with Containers</h2></div> In the first two secti...
pgroth/prov-wod-analysis
MeasuringPROVProvenanceWebofData.ipynb
apache-2.0
from IPython.display import HTML display(HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> We note that the code for our analysis is embeded within this document ...
mne-tools/mne-tools.github.io
0.17/_downloads/e33f407965fb2ba1307deaf80b7d794c/plot_brainstorm_auditory.ipynb
bsd-3-clause
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: BSD (3-clause) import os.path as op import pandas as pd import numpy as np import mne from mne import combine_evoked from mne.minimum_norm impor...
unpingco/Python-for-Probability-Statistics-and-Machine-Learning
chapters/probability/notebooks/Conditional_expectation_MSE_Ex.ipynb
mit
from __future__ import division %pylab inline """ Explanation: Python for Probability, Statistics, and Machine Learning End of explanation """ import sympy as S X10,X20,X50 = S.symbols('X10,X20,X50',real=True) xi = 10*X10+20*X20+50*X50 eta = X10*X20*(1-X50)+X10*(1-X20)*(X50)+(1-X10)*X20*(X50) num=S.summation(xi*e...
encima/Comp_Thinking_In_Python
Session_5/5_Homework.ipynb
mit
initial_var = 358645317684531432678 """ Explanation: What is the difference between a method and a function? Convert the below variable to a string and assign to string_var. Assign the length of that string to: len_var End of explanation """ name = "Oi, you there" def update_name(): name = "what?" print(n...
zzsza/Datascience_School
19. 문서 전처리/03. konlpy 한국어 처리 패키지 소개.ipynb
mit
from konlpy.corpus import kolaw kolaw.fileids() c = kolaw.open('constitution.txt').read() print(c[:100]) from konlpy.corpus import kobill kobill.fileids() d = kobill.open('1809890.txt').read() print(d[:100]) """ Explanation: konlpy 한국어 처리 패키지 소개 konlpy는 한국어 정보처리를 위한 파이썬 패키지이다. http://konlpy.org/ko/v0.4.4/ https:/...
jmhsi/justin_tinker
data_science/courses/deeplearning1/nbs/lesson2.ipynb
apache-2.0
# Rather than importing everything manually, we'll make things easy # and load them all in utils.py, and just import them from there. %matplotlib inline import utils; reload(utils) from utils import * """ Explanation: Linear models with CNN features End of explanation """ %matplotlib inline from __future__ import ...
sainathadapa/fastai-courses
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...
henridwyer/company-reviews
src/Topic Modeling.ipynb
mit
# words that appear in fewer than MIN_DOC_FREQ documents will be ignored MIN_DOC_FREQ = 20 # if there are less than MIN_WORDS in a document, it is dropped MIN_WORDS = 10 from pymongo import MongoClient import datetime import reviews_data from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import s...
PyLCARS/PythonUberHDL
myHDL_DigLogicFundamentals/myHDL_BitOperations/BitwiseBehavior_in_myHDL.ipynb
bsd-3-clause
#This notebook also uses the `(some) LaTeX environments for Jupyter` #https://github.com/ProfFan/latex_envs wich is part of the #jupyter_contrib_nbextensions package from myhdl import * from myhdlpeek import Peeker import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from sympy im...
BinRoot/TensorFlow-Book
ch02_basics/Concept10_queue_text.ipynb
mit
import tensorflow as tf filename_queue = tf.train.string_input_producer(["big.txt"]) """ Explanation: Ch 02: Concept 10 Queue of text from file The previous notebook (Concept 09) introduced queues. Let's see how we can use them with real world data. Download a corpus of text. $ wget http://norvig.com/big.txt Create ...
atcemgil/notes
fe588/fe588_introduction.ipynb
mit
x = 0.1 N = 3 a = 1 b = 0 c = -1 print('f(' + str(x) + ') = ' + str(a*x**2 + b*x + c)) a = 1 b = 1 print(a*b,a*(b+1),a*(b+2),a*(b+3)) a = 2 print(a*b,a*(b+1),a*(b+2),a*(b+3)) a = 3 print(a*b,a*(b+1),a*(b+2),a*(b+3)) a = 4 print(a*b,a*(b+1),a*(b+2),a*(b+3)) """ Explanation: Install Python. jup...
JAmarel/Phys202
Interact/.ipynb_checkpoints/InteractEx02-checkpoint.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 2 Imports End of explanation """ def plot_sine1(a,b): labels = ['0','$\pi$.','$2\pi$.','$3\pi$.','$4\pi$...
akseshina/dl_course
seminar_6/hw_RNN.ipynb
gpl-3.0
import numpy as np import pandas as pd import tensorflow as tf from lazy import lazy from attrdict import AttrDict from collections import Counter import warnings warnings.filterwarnings('ignore') import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns import random family_classification_metadata =...
tata-antares/tagging_LHCb
for_IML/BtaggingMadness.ipynb
apache-2.0
%matplotlib inline from matplotlib import pyplot as plt import numpy import root_numpy # import pandas - no pandas today from astropy.table import Table from sklearn.metrics import roc_auc_score from scipy.special import logit from decisiontrain import DecisionTrainClassifier from collections import OrderedDict # th...
agiovann/Constrained_NMF
demos/obsolete/demo_caiman_cnmfe.ipynb
gpl-2.0
try: if __IPYTHON__: # this is used for debugging purposes only. allows to reload classes when changed get_ipython().magic(u'load_ext autoreload') get_ipython().magic(u'autoreload 2') except NameError: print('Not IPYTHON') pass import sys import numpy as np from time impo...
QInfer/qinfer-examples
parallelization.ipynb
agpl-3.0
from __future__ import division """ Explanation: Parallelization with QInfer Setup We begin by enabling Python 3–style division, as is recommended for use in Python 2.7. End of explanation """ import ipyparallel as ipp import qinfer as qi from functools import partial """ Explanation: Next, we import the IPython pa...
kpei/cs-rating
wl_model/wlbet_team_model.ipynb
gpl-3.0
import pandas as pd import numpy as np import datetime as dt from scipy.stats import norm, bernoulli %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns from spcl_case import * plt.style.use('fivethirtyeight') """ Explanation: Win/Loss Betting Model End of explanation """ h_matches = pd.read_csv...
flaviocordova/udacity_deep_learn_project
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...
georgetown-analytics/machine-learning
examples/bbengfort/traffic/Traffic.ipynb
mit
%matplotlib notebook import os import shutil import urllib3 import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt """ Explanation: Time Series Traffic Analysis End of explanation """ URL = "https://archive.ics.uci.edu/ml/machine-learning-databases/00492/Metro_Interstate_Traff...
quoniammm/happy-machine-learning
Udacity-DL/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...
kmclaugh/fastai_courses
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...
google/jax
docs/notebooks/Custom_derivative_rules_for_Python_code.ipynb
apache-2.0
import jax.numpy as jnp from jax import custom_jvp @custom_jvp def f(x, y): return jnp.sin(x) * y @f.defjvp def f_jvp(primals, tangents): x, y = primals x_dot, y_dot = tangents primal_out = f(x, y) tangent_out = jnp.cos(x) * x_dot * y + jnp.sin(x) * y_dot return primal_out, tangent_out from jax import jv...
tleonhardt/CodingPlayground
dataquest/Statistics/Jeopardy.ipynb
mit
import pandas as pd # Read the dataset into a Pandas DataFrame jeopardy = pd.read_csv('../data/jeopardy.csv') # Print out the first 5 rows jeopardy.head(5) # Print out the columns jeopardy.columns # Remove the spaces from column names col_names = jeopardy.columns col_names = [s.strip() for s in col_names] jeopardy....
feststelltaste/software-analytics
prototypes/Reading a Git repo's commit history with Pandas efficiently.ipynb
gpl-3.0
import git GIT_REPO_PATH = r'../../spring-petclinic/' repo = git.Repo(GIT_REPO_PATH) git_bin = repo.git git_bin """ Explanation: Introduction There are multiple reasons for analyzing a version control system like your Git repository. See for example Adam Tornhill's book "Your Code as a Crime Scene" or his upcoming b...
kinshuk4/MoocX
misc/deep_learning_notes/Ch4_Recurrent_Networks/001_Optimization_Algorithms_and_Hyper-parameter_Search/Optimization_Algorithms_Variations_Hyper-paramter_Search.ipynb
mit
def batch_SGD(batch = 50, eta = 0.37, verbose=True): # to clear the globals in `edf` edf.components = [] edf.params = [] ######################################### please modify this cell to finish the problem 2.a ####################### # for repeatability np.random.seed(0) # Inputs and p...
martin-hunt/hublib
examples/UI_Demo.ipynb
mit
e1 = ui.Number( name='E1', description="Longitudinal Young's Modulus", units='GPa', min=0, max=500, value=138 ) e1 def my_cb(x, y): print("CB:", x == e1) print("New:", y) def my_cb2(x, y): print("CB2:", x == e1) print("New:", y) """ Explanation: Number (...
gte620v/PythonTutorialWithJupyter
exercises/solutions/Ex2-Iris_Dataset_solutions.ipynb
mit
import pandas as pd url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data" df = pd.read_csv(url,names=['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species']) df.h...
neilzim/SCDA
old_notebooks/scda_survey_demo.ipynb
mit
#survey_params = {'Pupil': { 'pm': ['hex1', 'hex2', 'hex3', 'hex4', 'pie08'], # 'ss': ['X','Cross'], # 'sst': ['025','100'], # 'sm': [True, False], # 'N': 250 }, # 'FPM': { 'rad': 4. }, # 'LS': { 'shape':['ann', 'hex'], 'obs...
intel-analytics/analytics-zoo
pyzoo/zoo/chronos/use-case/network_traffic/network_traffic_model_forecasting.ipynb
apache-2.0
def plot_predict_actual_values(date, y_pred, y_test, ylabel): """ plot the predicted values and actual values (for the test data) """ fig, axs = plt.subplots(figsize=(16,6)) axs.plot(date, y_pred, color='red', label='predicted values') axs.plot(date, y_test, color='blue', label='actual values')...
DiracInstitute/kbmod
notebooks/Kbmod_Reference.ipynb
bsd-2-clause
#everything we will need for this demo from kbmodpy import kbmod as kb import numpy as np import matplotlib.pyplot as plt import os path = "../data/demo/" """ Explanation: KBMOD Reference This notebook demonstrates a gpu-accelerated image processing framework designed for image stack and time domain analysis, compatib...
jeffakolb/Data-Science-45min-Intros
python-objects/python_odds_and_ends.ipynb
unlicense
%%HTML <img src="https://imgs.xkcd.com/comics/bun_alert.png" width=500></img> """ Explanation: WTF is this? or, When is is what you think is is? Also, rabbit hole alert... End of explanation """ %%HTML <blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Pay no mind.... <a href="https://t.co/mnIP...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/06_structured/3_tensorflow_wd.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.1 # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'...
andrewosh/notebooks
worker/notebooks/thunder/tutorials/multi_index.ipynb
mit
from thunder import Series from numpy import arange, array data = tsc.loadSeriesFromArray(arange(12)) data.first() """ Explanation: Multi-indexing When dealing with Series data, it is often useful to index each element of the series with multiple labels and then select and aggregrate data based on these indices. For ...
vzg100/Post-Translational-Modification-Prediction
.ipynb_checkpoints/Phosphorylation Sequence Tests -MLP -dbptm+ELM-VectorAvr.-checkpoint.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] for i in par: print("y", i) y = Predictor() y.load_data(file="Data/Trainin...
mabevillar/rmtk
rmtk/vulnerability/derivation_fragility/equivalent_linearization/miranda_2000_firm_soils/miranda_2000_firm_soils.ipynb
agpl-3.0
import miranda_2000_firm_soils from rmtk.vulnerability.common import utils %matplotlib inline """ Explanation: Miranda (2000) for firm soils This methodology, proposed in Miranda (2000), aims to estimate the maximum lateral inelastic displacement demands on a structure based on the maximum lateral elastic displacement...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/cmip6/models/sandbox-2/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-2', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: PCMDI Source ID: SANDBOX-2 Sub-Topics: Radiative Forcings. Properties: 85 (4...
Avsecz/concise
nbs/PWM_initialization.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt # RBP PWM's from concise.data import attract dfa = attract.get_metadata() dfa # TF PWM's from concise.data import encode dfe = encode.get_metadata() dfe # TF PWM's from concise.data import hocomoco dfh = hocomoco.get_metadata() dfh """ Explanation: Initializing ...
analog-rl/Easy21
Joe #3 TD Learning in Easy21/easy21 tests.ipynb
mit
import matplotlib.pyplot as plt %matplotlib notebook plt.figure(1) values = [] for i in xrange(0,100000): values.append(Card().absolute_value) # values.append(random.randint(1,10)) plt.title('Test; Each draw from the deck results in a value between 1 and 10 (uniformly distributed)') plt.hist(values) ...
pagutierrez/tutorial-sklearn
notebooks-spanish/03-representacion_datos_aa.ipynb
cc0-1.0
from sklearn.datasets import load_iris iris = load_iris() """ Explanation: Representación y visualización de datos El aprendizaje automático trata de ajustar modelos a los datos; por esta razón, empezaremos discutiendo como los datos pueden ser representados para ser accesibles por el ordenador. Además de esto, nos ba...
google/jax
docs/jax-101/04-advanced-autodiff.ipynb
apache-2.0
import jax f = lambda x: x**3 + 2*x**2 - 3*x + 1 dfdx = jax.grad(f) """ Explanation: Advanced Automatic Differentiation in JAX Authors: Vlatimir Mikulik & Matteo Hessel Computing gradients is a critical part of modern machine learning methods. This section considers a few advanced topics in the areas of automatic d...
transcranial/keras-js
notebooks/layers/pooling/MaxPooling2D.ipynb
mit
data_in_shape = (6, 6, 3) L = MaxPooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format='channels_last') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(270) data_in = 2 * np....
xiaoxiaoyao/MyApp
jupyter_notebook/loans-tree.ipynb
unlicense
#为了让Python能够高效率处理表格数据,我们使用一个非常优秀的数据处理框架Pandas。 import pandas as pd #然后我们把loans.csv里面的内容全部读取出来,存入到一个叫做df的变量里面。 df = pd.read_csv('loans.csv') #我们看看df这个数据框的前几行,以确认数据读取无误。因为表格列数较多,屏幕上显示不完整,我们向右拖动表格,看表格最右边几列是否也正确读取。 df.tail() #统计一下总行数,看是不是所有行也都完整读取进来了。 df.shape """ Explanation: 如何用Python和机器学习帮你决策? 贷还是不贷: 每一行数据,都代表了之前的一次...
OSHI7/Learning1
MatplotLib Pynotebooks/AnatomyOfMatplotlib-Part3-HowToSpeakMPL.ipynb
mit
%load exercises/3.1-colors.py t = np.arange(0.0, 5.0, 0.2) plt.plot(t, t, , t, t**2, , t, t**3, ) plt.show() t = np.arange(0.0, 5.0, 0.2) plt.plot(t, t, , t, t**2, , t, t**3, ) plt.show() """ Explanation: How to speak "MPL" In the previous parts, you learned how matplotlib organizes plot-making by figures and axes....
alexandrnikitin/algorithm-sandbox
courses/DAT256x/Module01/01-05-Polynomials.ipynb
mit
from random import randint x = randint(1,100) (x**3 + 2*x**3 - 3*x - x + 8 - 3) == (3*x**3 - 4*x + 5) """ Explanation: Polynomials Some of the equations we've looked at so far include expressions that are actually polynomials; but what is a polynomial, and why should you care? A polynomial is an algebraic expression ...
GoogleCloudPlatform/mlops-on-gcp
workshops/tfx-caip-tf23/lab-03-tfx-cicd/labs/lab-03.ipynb
apache-2.0
import yaml # Set `PATH` to include the directory containing TFX CLI. PATH=%env PATH %env PATH=/home/jupyter/.local/bin:{PATH} !python -c "import tfx; print('TFX version: {}'.format(tfx.__version__))" """ Explanation: CI/CD for TFX pipelines Learning Objectives Develop a CI/CD workflow with Cloud Build to build and...
davidzchen/tensorflow
tensorflow/lite/g3doc/tutorials/model_maker_text_classification.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...
GoogleCloudPlatform/professional-services
examples/vertex_pipeline/notebook/batch_prediction_pipeline_development.ipynb
apache-2.0
!python3 -c "import kfp; print('KFP SDK version: {}'.format(kfp.__version__))" import os from functools import partial import kfp import pprint import yaml from jinja2 import Template from kfp.v2 import dsl from kfp.v2.compiler import compiler from kfp.v2.dsl import Dataset from kfp.v2.google.client import AIPlatform...
anhaidgroup/py_entitymatching
notebooks/vldb_demo/.ipynb_checkpoints/Demo_notebook_v6-checkpoint.ipynb
bsd-3-clause
import py_entitymatching as em import profiler import pandas as pd """ Explanation: |S.No| Package | Comments | |---|---|---| |1| pandas | provides data structures (such as DataFrame) to <span style="color:red;">store and manage relational data</span>. Specifically, DataFrame is used to represent input tables. | ...
eds-uga/csci1360e-su16
lectures/L8.ipynb
mit
li = ["this", "is", "a", "list"] print(li) print(li[1:3]) # Print element 1 (inclusive) to 3 (exclusive) print(li[2:]) # Print element 2 and everything after that print(li[:-1]) # Print everything BEFORE element -1 (the last one) """ Explanation: Lecture 8: Array Indexing, Slicing, and Broadcasting CSCI 1360E: Fou...
JackDi/phys202-2015-work
assignments/assignment10/ODEsEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 1 Imports End of explanation """ def lorentz_derivs(yvec, t, sigma, rho, beta): """Compute the the de...
ledeprogram/algorithms
class7/homework/bennion_kate_assignment_7.ipynb
gpl-3.0
import pandas as pd %matplotlib inline from sklearn import datasets from pandas.tools.plotting import scatter_matrix import matplotlib.pyplot as plt iris = datasets.load_iris() from sklearn.cross_validation import train_test_split x = iris.data[:,2:] y = iris.target x_train, x_test, y_train, y_test = train_test_s...
cesarcontre/Simulacion2017
Modulo3/Clase20_ProgramaciónLineal.ipynb
mit
import numpy as np f = np.array([-1, -1]) A = np.array([[50, 24], [30, 33], [-1, 0], [0, -1]]) b = np.array([2400, 2100, -45, -5]) import pyomo_utilities x, obj = pyomo_utilities.linprog(f, A, b) x obj obj_real = x.sum()-50 obj_real.round(2) """ Explanation: Programación lineal <img style="float: right; margin: ...
fablln/Deep-Learning
mnist_cnn/TP2-notebook.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) X_train, y_train = mnist.train.images, mnist.train.labels X_validation, y_validation = mnist.validation.images, mnist.validation.labels X_test, y_test =...
thewtex/SimpleITK-Notebooks
63_Registration_Initialization.ipynb
apache-2.0
import SimpleITK as sitk import os import numpy as np from ipywidgets import interact, fixed from downloaddata import fetch_data as fdata import registration_callbacks as rc import registration_utilities as ru # Always write output to a separate directory, we don't want to pollute the source directory. OUTPUT_DIR =...
kitu2007/dl_class
batch-norm/Batch_Normalization_Solutions.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Solutions Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a co...
zhuanxuhit/deep-learning
sentiment-rnn/.ipynb_checkpoints/Sentiment RNN-checkpoint.ipynb
mit
import numpy as np import tensorflow as tf with open('reviews.txt', 'r') as f: reviews = f.read() with open('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 network that performs sentiment analysis....
tensorflow/docs-l10n
site/en-snapshot/probability/examples/TensorFlow_Probability_Case_Study_Covariance_Estimation.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...
Diyago/Machine-Learning-scripts
DEEP LEARNING/NLP/Kaggle Quora Insincere Questions Classification/improve-your-score-with-some-text-preprocessing.ipynb
apache-2.0
import pandas as pd import numpy as np import operator import re """ Explanation: Improve your Score with some Text Preprocessing Updated version : https://www.kaggle.com/theoviel/improve-your-score-with-text-preprocessing-v2 This kernel is an improved version of @Dieter's work. https://www.kaggle.com/christofhenk...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160705화수_25,26일차_뉴럴 네트워크 Neural Network/2.TensorFlow 패키지 소개.ipynb
mit
import tensorflow as tf x = tf.Variable(1.0) y = tf.Variable(2.0) type(x), type(y) """ Explanation: TensorFlow 패키지 소개 TensorFlow 패키지는 Theano 패키지와 마찬가지로 선형 대수 심볼 컴파일러(Symbolic Linear Algebra Compiler)이다. Theano에 비해 분산처리 기능이 강화되어 있다. TensorFlow 기본 사용법 Theano와 유사하게 TensorFlow도 다음과 같은 과정을 거쳐 사용한다. 심볼 변수 정의 심볼 관계 정의 세션 ...
ES-DOC/esdoc-jupyterhub
notebooks/niwa/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'niwa', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NIWA Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balan...
Mixpap/MasterThesis
Notebooks/Density Profile.ipynb
mit
#HCG=np.load('../Data/H2CoolingG512.npz') HCG=np.load('../Data/TabulatedG.npz') f.quadruple(HCG,np.log10(HCG['RHO']),rows=2,nn=0,tlim=26,Save_Figure='H2CoolGRquad') f.pprofile(HCG,'RHO',steps=4,itlim=26,tdk='Myrs',Save_Figure='H2CoolGRHOprofile',sc2='log',xlim=[0,20],yprop=256) f.pprofile(HCG,'Temp',steps=4,itlim=26,td...
hannorein/rebound
ipython_examples/ChaoticHyperion.ipynb
gpl-3.0
import rebound import numpy as np import matplotlib.pyplot as plt """ Explanation: Chaotic Hyperion In this example, we simulate the spin of Hyperion. The spin evolution is governed by an ordinary differential equation that is coupled to the moon's orbit. We start by importing REBOUND, numpy and matplotlib. End of ex...
CentreForCorpusResearch/clic
docs/notebooks/Cheshire/Cheshire queries.ipynb
mit
# coding: utf-8 import os from cheshire3.baseObjects import Session from cheshire3.document import StringDocument from cheshire3.internal import cheshire3Root from cheshire3.server import SimpleServer session = Session() session.database = 'db_dickens' serv = SimpleServer(session, os.path.join(cheshire3Root, 'con...
locuslab/dreaml
examples/seqnn.ipynb
apache-2.0
from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD class SimpleNN(ContinuousTransform): def init_func(self,target_df,X_train_df,y_train_df,X_test_df,y_test_df): model=Sequential() model.add(Dense(64, input_dim=784, init='uni...
ozak/CompEcon
notebooks/DynamicProgramming.ipynb
gpl-3.0
from __future__ import division %pylab --no-import-all %matplotlib inline from numpy import interp interp? x = np.linspace(0, np.pi, 100) plt.figure(1) plt.plot(x, np.sin(x), label='Actual Function') for i in np.arange(3,11,2): fig1 = plt.figure(1) xp = np.linspace(0, np.pi, i) yp = np.sin(xp) y = in...
uriba/physical-catalysis
angledSimulation.ipynb
gpl-3.0
%pylab inline from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.pyplot as plt from pylab import meshgrid,cm,imshow,contour,clabel,colorbar,axis,title,show """ Explanation: Modelling catalysis of izomerization in macro sca...
crystalzhaizhai/cs207_yi_zhai
lectures/L10/L10.ipynb
mit
from IPython.display import HTML """ Explanation: Lecture 10 Object Oriented Programming II Wednesday, October 4th 2017 End of explanation """ class Animal(): def __init__(self, name): self.name=name def __repr__(self): class_name = type(self).__name__ return "{0!s}({1.n...
akloster/porekit-python
docs/02_Plots.ipynb
isc
df = pd.read_hdf("../examples/data/ru9_meta.h5", "meta") """ Explanation: Plotting Data Visualizing the metadata is very useful to get a first look at the nature and quality of the run. First we need a DataFrame with the meta data. You can make one with porekit.gather_metadata once, and then load it later from a hdf f...
stephenbeckr/convex-optimization-class
Demos/AutomaticDifferentiation.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') """ Explanation: <a href="https://colab.research.google.com/github/stephenbeckr/convex-optimization-class/blob/master/Demos/AutomaticDifferentiation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/c...
Jay-Oh-eN/data-science-workshops
eda.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %pylab inline # We will use the Inside AirBnB dataset from here on df = pd.read_csv('data/sf_listings.csv') df.head() df.room_type.value_counts().plot.bar() # Since SF doesn't have many neighborhoods (comparatively) we can also see the raw # ...
materials-data-facility/forge
docs/tutorials/6-Data_Retrieval_Functions.ipynb
apache-2.0
from mdf_forge.forge import Forge mdf = Forge() """ Explanation: Part 6 - Data Retrieval Functions End of explanation """ # NBVAL_SKIP # Running this example will save a file in the current directory. res = mdf.search("dft.converged:true AND mdf.resource_type:record", limit=10) mdf.globus_download(res) """ Explana...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_lcmv_beamformer.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt import numpy as np import mne from mne.datasets import sample from mne.beamformer import lcmv print(__doc__) data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_a...
opesci/devito
examples/userapi/02_apply.ipynb
mit
from devito import Grid, TimeFunction, Eq, Operator grid = Grid(shape=(4, 4)) u = TimeFunction(name='u', grid=grid, save=3) op = Operator(Eq(u.forward, u + 1)) """ Explanation: Introduction to Operator apply and arguments This tutorial describes two fundamental user APIs: Operator.apply Operator.arguments We will u...
sheikhomar/ml
tree-based-methods.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline df = pd.read_csv('data/titanic-train.csv') df.head() df['Survival State'] = df['Survived'].apply(lambda x: 'Survived' if x == 1 else 'Died') df['Survival State'].value_counts() """ Explanation: Tree-based...