repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
Hash--/ICRH
notebooks/Single and double Conjugate-T matching.ipynb
mit
bridge = rf.io.hfss_touchstone_2_network('../icrh/data/Sparameters/WEST/WEST_ICRH_bridge.s3p', f_unit='MHz') impedance_transformer = rf.io.hfss_touchstone_2_network('../icrh/data/Sparameters/WEST/WEST_ICRH_impedance-transformer.s2p', f_unit='MHz') window = rf.io.hfss_touchstone_2_network('../icrh/data/Sparameters/WEST/...
google/dopamine
dopamine/colab/cartpole.ipynb
apache-2.0
# @title Install necessary packages. !pip install -U dopamine-rl # @title Necessary imports and globals. import numpy as np import os from dopamine.discrete_domains import run_experiment from dopamine.colab import utils as colab_utils from absl import flags import gin.tf BASE_PATH = '/tmp/colab_dopamine_run' # @pa...
ledeprogram/algorithms
class6/donow/benzaquen_mercy_donow6.ipynb
gpl-3.0
import pandas as pd %matplotlib inline import matplotlib.pyplot as plt # package for doing plotting (necessary for adding the line) import statsmodels.formula.api as smf """ Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model End of explanation """ df = pd.re...
jnobre/lxmls-toolkit-2017
lxmls/laboratories/day3/Lxmls_Day3.ipynb
mit
import sys sys.path.append('../../../') import lxmls.sequences.crf_online as crfo import lxmls.sequences.structured_perceptron as spc import lxmls.readers.pos_corpus as pcc import lxmls.sequences.id_feature as idfc import lxmls.sequences.extended_feature as exfc print "CRF Exercise" corpus = pcc.PostagCorpus( ) trai...
gagneurlab/concise
nbs/getting_started.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import concise.layers as cl import keras.layers as kl import concise.initializers as ci import concise.regularizers as cr from keras.callbacks import EarlyStopping from concise.preprocessing import encodeDNA from keras.models import Model, load_model # get the data d...
solomonvimal/UCLA-Hydro
ABoVE/Vegetaion_File_from_GEE.ipynb
gpl-3.0
%matplotlib inline import ee from numpy import array import operator import matplotlib.pyplot as plt from folium import IFrame import base64, folium import datetime import ee import pandas as pd import os import numpy as np import matplotlib as mpl ee.Initialize() resolution, width, height = 75, 7, 3 mpl.rcParams['ytic...
facaiy/book_notes
machine_learning/tree/gbdt/intro.ipynb
cc0-1.0
show_image("./res/gradient_descent.jpg", figsize=(12,8)) show_image("./res/iterator.jpg") """ Explanation: GBDT(Gradient Boosting Decision Tree) 原理简介 0. 前言 我最开始了解 GBDT 时,死活不理解决策树这种分段函数,怎么可能算出一阶导数。读了论文 Friedman - Greedy Function Approximation: A Gradient Boosting Machine 后,才发现自己完全误解了决策树在GBDT中的作用。论文总是倾向把简单事情描述复杂,博客又常常过...
dtamayo/rebound
ipython_examples/SaturnsRings.ipynb
gpl-3.0
import rebound import numpy as np sim = rebound.Simulation() """ Explanation: Simulating Saturn's rings In this example, we will simulate a small patch of Saturn's rings. The simulation is similar to the C example in examples/shearing_sheet. We first import REBOUND and numpy, then create an instance of the Simulation ...
trangel/Insight-Data-Science
general-docs/data-challenge-Week6/data challenge Tonatiuh Rangel.ipynb
gpl-3.0
import pandas as pd import numpy as np columns=['country','age','new_user','source','total_pages_visited','converted'] df = pd.read_csv('conversion_data.csv') df.columns=columns df.head(2) """ Explanation: Check missing data or NaN Data exploration Analysis on 1. Age 2. Pages visited 3. New user Columns: co...
artdavis/pyfred
pyfred/examples/jupyter_notebook_pyfred_tutorial.ipynb
gpl-3.0
# To get remote console connection info use: #%connect_info # To open a GUI console: %qtconsole # Embed plots in the notebook %matplotlib inline # NumPy is nice to have around import numpy as np np.set_printoptions(precision=4) # 4 decimal places for printing is OK import time # For time delay # Get IPython's pretty ...
AndreySheka/dl_ekb
hw10/Seminar10-RNN-homework-en.ipynb
mit
#text goes here corpora = "" for fname in os.listdir("codex"): import sys if sys.version_info >= (3,0): with open("codex/"+fname, encoding='cp1251') as fin: text = fin.read() #If you are using your own corpora, make sure it's read correctly corpora += text else: ...
saga-survey/saga-code
ipython_notebooks/2015June-AAT.ipynb
gpl-2.0
#if online ufo = urllib2.urlopen('https://docs.google.com/spreadsheet/ccc?key=1b3k2eyFjHFDtmHce1xi6JKuj3ATOWYduTBFftx5oPp8&output=csv') hosttab = QTable.read(ufo.read(), format='csv') ufo.close() #if offline hosttab = Table.read('SAGADropbox/hosts/host_catalog_flag0.csv') hostscs = SkyCoord(u.Quantity(hosttab['RA'], ...
ES-DOC/esdoc-jupyterhub
notebooks/bnu/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: BNU Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topics: Transport, Emissions Co...
daniel-koehn/Theory-of-seismic-waves-II
03_Intro_finite_differences/2_fd_ac1d.ipynb
gpl-3.0
# Execute this cell to load the notebook's style sheet, then ignore it from IPython.core.display import HTML css_file = '../style/custom.css' HTML(open(css_file, "r").read()) """ Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 parts of this notebook are...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session11/Day2/MeasuringCentroidsAndProperMotion.ipynb
mit
# Load the packages we will use import numpy as np import astropy.io.fits as pf import astropy.coordinates as co from astropy.wcs import WCS from matplotlib import pyplot as pl %matplotlib inline """ Explanation: Practice with stellar astrometry To accompany astrometry lecture from the Rubin Observatory Data Science F...
scikit-optimize/scikit-optimize.github.io
dev/notebooks/auto_examples/parallel-optimization.ipynb
bsd-3-clause
print(__doc__) import numpy as np """ Explanation: Parallel optimization Iaroslav Shcherbatyi, May 2017. Reviewed by Manoj Kumar and Tim Head. Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt Introduction For many practical black box optimization problems expensive objective can be evaluated in parallel ...
atulsingh0/MachineLearning
scikit-learn/04_Scikit.ipynb
gpl-3.0
from sklearn.neighbors import KNeighborsClassifier from sklearn.datasets import load_iris from sklearn.metrics import accuracy_score from sklearn.cross_validation import cross_val_score import matplotlib.pyplot as plt %matplotlib inline # loading the IRIS dataset iris = load_iris() X = iris.data y = iris.target # ins...
starbro/BeastMode
.ipynb_checkpoints/New-checkpoint.ipynb
apache-2.0
# function to get name of movie from each URL def get_movie(url): ''' Scrapes a given URL from IMDB.com. The URL's page contains many reviews for one particular movie. This function returns the name of that movie. ''' pageText = requests.get(url) # Keep asking for the page until you get it. Sl...
jjehl/poppy_education
xl-320/Configurer les moteurs XL-320.ipynb
gpl-2.0
import pypot.dynamixel import time """ Explanation: Les commandes de bas niveau pour configurer un moteur xl-320 Importer les modules necessaires. End of explanation """ print(pypot.dynamixel.get_available_ports()) """ Explanation: Connecter les moteurs au niveau logiciel. Trouver le port sur lequel est branché le ...
blei-lab/ars-reparameterization
gamma/demo.ipynb
mit
import autograd.numpy as np import autograd.numpy.random as npr from autograd.scipy.special import gammaln, psi from autograd import grad from autograd.optimizers import adam, sgd import matplotlib.pyplot as plt import seaborn as sns sns.set_context("talk") sns.set_style("white") %matplotlib inline npr.seed(1) # the...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex14-Standardized Precipitation Index (SPI).ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt # to generate plots from mpl_toolkits.basemap import Basemap # plot on map projections import datetime from netCDF4 import Dataset # http://unidata.github.io/netcdf4-python/ from netCDF4 import netcdftime from netcdftime import...
CELMA-project/CELMA
MES/integrals/volumeIntegral/calculations/exactSolutions.ipynb
lgpl-3.0
%matplotlib notebook import numpy as np from sympy import init_printing from sympy import S from sympy import sin, cos, tanh, exp, pi, sqrt from sympy import integrate from boutdata.mms import x, y, z, t import os, sys # If we add to sys.path, then it must be an absolute path common_dir = os.path.abspath('./../../.....
rishizek/deep-learning
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 %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 ridersh...
echohenry2006/tvb-library
tvb/simulator/demos/region_deterministic_stimulus.ipynb
gpl-2.0
from tvb.simulator.lab import * """ Explanation: Demonstrate using the simulator at the region level with a stimulus. Run time: approximately 2 seconds (workstation circa 2010). Memory requirement: < 1GB End of explanation """ LOG.info("Configuring...") #Initialize a Model, Coupling, and Connectivity. oscillator = ...
madsenmj/ml-introduction-course
Class05/Class05.ipynb
apache-2.0
import pandas as pd iowadf= pd.read_csv("Class05_iowa_data.csv") iowadf.head() # The sales data looks like it isn't a float like we want it to be (the presence of a $ in front is my clue that there may be something wrong.) Let's look at the data types to be sure. iowadf.dtypes # Sure enough. We need to get the real v...
dereneaton/ipyrad
newdocs/API-analysis/cookbook-structure.ipynb
gpl-3.0
# conda install ipyrad -c bioconda # conda install -c bioconda -c ipyrad structure clumpp # conda install toyplot -c eaton-lab import ipyrad.analysis as ipa import toyplot """ Explanation: <span style="color:gray">ipyrad-analysis toolkit:</span> STRUCTURE Structure v.2.3.4 is a standard tool for examining population ...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Autocorrelation_and_AR_Models/notebook.ipynb
unlicense
import numpy as np import pandas as pd from scipy import stats import statsmodels.api as sm import statsmodels.tsa as tsa import matplotlib.pyplot as plt # ensures experiment runs the same every time np.random.seed(100) # This function simluates an AR process, generating a new value based on historial values, # autor...
chris1610/pbpython
notebooks/Category-Encoding-Article.ipynb
bsd-3-clause
import pandas as pd import numpy as np from sklearn.preprocessing import OrdinalEncoder, OneHotEncoder from sklearn.compose import make_column_transformer from sklearn.linear_model import LinearRegression from sklearn.pipeline import make_pipeline from sklearn.model_selection import cross_val_score import category_en...
seg/2016-ml-contest
geoLEARN/Submission_4_OVR_RF.ipynb
apache-2.0
###### Importing all used packages %matplotlib inline import warnings warnings.filterwarnings('ignore') 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 import seaborn as sns from...
phnmnl/workflow-demo
Jupyter/Workflow.ipynb
apache-2.0
control=input() """ Explanation: R-based metabolomics workflow by Kultima lab This notebook aims to show, through a series of examples, how to set up a metabolomics workflow using the Chronos REST API. As benchmark case we use a R-based pipeline by the Kultima lab. The aim of this pipeline is to: 1. Remove contaminan...
mdalvi/financial-analysis-and-algo-trading
python_finance_fundamentals/finance_fundamentals_lecture_notes.ipynb
mit
import pandas as pd import quandl aapl = pd.read_csv('AAPL_CLOSE', index_col='Date', parse_dates=True) cisco = pd.read_csv('CISCO_CLOSE', index_col='Date', parse_dates=True) ibm = pd.read_csv('IBM_CLOSE', index_col='Date', parse_dates=True) amzn = pd.read_csv('AMZN_CLOSE', index_col='Date', parse_dates=True) aapl.hea...
ES-DOC/esdoc-jupyterhub
notebooks/hammoz-consortium/cmip6/models/sandbox-1/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-1', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: HAMMOZ-CONSORTIUM Source ID: SANDBOX-1 Topic: Aerosol Sub-Topics: T...
ESSS/notebooks
smooth_transition_between_analytic_functions.ipynb
mit
import sympy from sympy import Piecewise import numpy as np # For example: x_ = sympy.symbols('x', real=True) f_left_ = x_**1.2 f_right_ = 10.0 / x_**0.2 x_threshold = 10.0 ** (5 / 7) f_ = Piecewise( (f_left_, x_ < x_threshold), (f_right_, True) ) f = sympy.lambdify(x_, f_) import seaborn import matplotl...
quantumlib/Cirq
docs/tutorials/hidden_linear_function.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...
srcole/qwm
guessinggame/Single player guessing game.ipynb
mit
from IPython.display import YouTubeVideo YouTubeVideo("ud_frfkt1t0") # Import libraries from __future__ import division from scipy.stats import binom import numpy as np import matplotlib.pyplot as plt %pylab inline # Initialize random seed np.random.seed(1) def genABK(nTrials,int_min,int_max): ''' Generate t...
metpy/MetPy
v1.1/_downloads/e5685967297554788de3cf5858571b23/Natural_Neighbor_Verification.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np from scipy.spatial import ConvexHull, Delaunay, delaunay_plot_2d, Voronoi, voronoi_plot_2d from scipy.spatial.distance import euclidean from metpy.interpolate import geometry from metpy.interpolate.points import natural_neighbor_point """ Explanation: Natural Neighbo...
jorgemauricio/INIFAP_Course
Basico/Python_Introduccion_Ejercicios-Soluciones.ipynb
mit
7 ** 4 """ Explanation: Python Introduccion Ejercicios - Soluciones Este ejercicio te permite comprender los principios basicos de Python Ejercicios Resulve la pregunta que se te muestra en negritas para obtener la respuesta que se muestra debajo de la celda de codigo 7 a la 4 potencia? End of explanation """ s = '...
karlobermeyer/numeric-digit-classification
numeric_digit_classification.ipynb
mit
#%qtconsole # For inspecting variables. # Standard import os from glob import glob # Unix style pathname pattern expansion. import csv import pickle import time # Scientific Computing and Visualization import numpy as np; np.random.seed(13) # Lucky seed. import matplotlib.pyplot as plt %matplotlib inline import cv...
mne-tools/mne-tools.github.io
dev/_downloads/d8a6d02146c5c075611a652218e020ad/30_reading_fnirs_data.ipynb
bsd-3-clause
import os.path as op import numpy as np import pandas as pd import mne """ Explanation: Importing data from fNIRS devices fNIRS devices consist of two kinds of optodes: light sources (AKA "emitters" or "transmitters") and light detectors (AKA "receivers"). Channels are defined as source-detector pairs, and channel loc...
marius311/cosmoslik
cosmoslik_plugins/likelihoods/planck/clik.ipynb
gpl-3.0
%pylab inline sys.path = sys.path[1:] from cosmoslik import * clik = likelihoods.planck.clik( clik_file="plik_lite_v18_TT.clik/", A_Planck=1 ) clik """ Explanation: Planck (via clik) This plugin is an interface between the Planck likelihood code clik and CosmoSlik. You need clik already installed on your mach...
frankbearzou/Data-analysis
Recent Grads/Recent Grads.ipynb
mit
recent_grads = pd.read_csv('recent-grads.csv') recent_grads.head() recent_grads.tail() recent_grads.describe() recent_grads.shape """ Explanation: Data Exploration End of explanation """ recent_grads.shape[0] - recent_grads.dropna().shape[0] """ Explanation: how many rows contain null values? End of explanation...
djevans071/Rebalancing-Citibike
Rebalancing.ipynb
mit
# find csv file for tripdata year = 2015 month = 3 #csvPath = '{}{:02}-citibike-tripdata.csv'.format(year, month) #df = pd.read_csv(basepath + csvPath, parse_dates = ['Start Time', 'Stop Time']) df = trip_data(year, month) #df['trip_id'] = df.index.values df.head() rebals = rebal_data(year,month) rebals.head() """ Ex...
dacr26/CompPhys
08_01_Schroedinger.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot import math import matplotlib.animation as animation from JSAnimation.IPython_display import display_animation lx=20 dx = 0.04 nx = int(lx/dx) dt = dx**2/20. V0 = 15. alpha = dt/dx**2 fig = pyplot.figure() ax = pyplot.axes(xlim=(0, lx), ylim=(0, 2), ...
tensorflow/workshops
extras/archive/05_custom_estimators.ipynb
apache-2.0
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np import tensorflow as tf """ Explanation: Custom Estimators In this notebook we'll write an Custom Estimator (using a model function we specifiy). On the way, we'll use tf.layers...
yedivanseven/bestPy
examples/07_RESTfulAPI.ipynb
gpl-3.0
from urllib.parse import ParseResult from urllib.request import urlopen import json """ Explanation: CHAPTER 7 RESTful API Now you know all about algorithms and how to benchmark them. Once you found the optimal algorithm and settings, however, what do you do with them? One common way to make your findings, that is, a ...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/gfdl-cm4/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-cm4', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: GFDL-CM4 Topic: Ocean Sub-Topics: Timestepping Framework, A...
EvoML/EvoML
EvoML - Example Usage.ipynb
gpl-3.0
from evoml.subsampling import BasicSegmenter_FEMPO, BasicSegmenter_FEGT, BasicSegmenter_FEMPT df = pd.read_csv('datasets/ozone.csv') df.head(2) X, y = df.iloc[:,:-1], df['output'] print(BasicSegmenter_FEGT.__doc__) from sklearn.tree import DecisionTreeRegressor clf_dt = DecisionTreeRegressor(max_depth=3) clf = Bas...
WMD-group/SMACT
examples/Practical_tutorial/Combinations_practical.ipynb
mit
from math import factorial as factorial grid_points = 1000.0 atoms = 30.0 elements = 50.0 ########## # A. Show that assigning each of the 30 atoms as one of 50 elements is ~ 9e50 (permutations) element_assignment = 0 print(f'Number of possible element assignments is: {element_assignment}') # B. Show that the numb...
mavillan/SciProg
04_jit/04_actividad.ipynb
gpl-3.0
import numba import numpy as np import numexpr as ne import matplotlib.pyplot as plt """ Explanation: <center> <h1> Scientific Programming in Python </h1> <h2> Topic 4: Just in Time Compilation: Numba and NumExpr </h2> </center> Notebook created by Martín Villanueva - martin.villanueva@usm.cl - DI UTFSM - Ap...
MartyWeissman/Python-for-number-theory
P3wNT Notebook 3.ipynb
gpl-3.0
def is_prime(n): ''' Checks whether the argument n is a prime number. Uses a brute force search for factors between 1 and n. ''' for j in range(2,n): # the range of numbers 2,3,...,n-1. if n%j == 0: # is n divisible by j? print("{} is a factor of {}.".format(j,n)) r...
maxkleiner/maXbox4
MNISTSinglePredict.ipynb
gpl-3.0
#sign:max: MAXBOX8: 13/03/2021 07:46:37 import numpy as np import matplotlib.pyplot as plt from sklearn import tree from sklearn.ensemble import RandomForestClassifier from sklearn.svm import SVC from sklearn import datasets from sklearn.metrics import accuracy_score # [height, weight, 8*8 pixels of digits 0...
Hash--/documents
notebooks/Fusion_Basics/The cyclotron interaction.ipynb
mit
# Python modules import import numpy as np # numpy import matplotlib.pyplot as plt import matplotlib.animation as animation from mpl_toolkits.mplot3d import Axes3D # allows 3D plots with the keyword projection='3d' below %matplotlib inline from scipy.integrate import odeint # Integrate a system of ordinary differenti...
Kaggle/learntools
notebooks/data_cleaning/raw/ex1.ipynb
apache-2.0
from learntools.core import binder binder.bind(globals()) from learntools.data_cleaning.ex1 import * print("Setup Complete") """ Explanation: In this exercise, you'll apply what you learned in the Handling missing values tutorial. Setup The questions below will give you feedback on your work. Run the following cell to...
hetaodie/hetaodie.github.io
assets/media/uda-ml/code/modelselect/workspace/Solution-zh.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: 通过网格搜索完善模型 在这个迷你 Lab 练习中,我们将为决策树模型拟合一些样本数据。 这个初始模型会过拟合。 然后,我们将使用网格搜索为这个模型找到更好的参数,以减少过拟合。 首先,导入: End of explanation """ def load_pts(csv_name): data = np.asarray(pd.read_csv(csv_name, header=None)) X = d...
amitkaps/multidim
notebooks/Air_Routes.ipynb
mit
import pandas as pd # Read in the airports data. airports = pd.read_csv("../data/airports.dat.txt", header=None, na_values=['\\N'], dtype=str) # Read in the airlines data. airlines = pd.read_csv("../data/airlines.dat.txt", header=None, na_values=['\\N'], dtype=str) # Read in the routes data. routes = pd.read_csv(".....
mrustl/flopy
examples/Notebooks/flopy3_sfrpackage_example.ipynb
bsd-3-clause
import sys import platform import os import numpy as np import glob import shutil import matplotlib as mpl import matplotlib.pyplot as plt import flopy import flopy.utils.binaryfile as bf #Set name of MODFLOW exe # assumes executable is in users path statement exe_name = 'mf2005' if platform.system() == 'Windows': ...
drJfunk/gbmgeometry
examples/demo.ipynb
mit
%pylab inline from astropy.coordinates import SkyCoord import astropy.coordinates as coord import astropy.units as u from gbmgeometry import * """ Explanation: GBM Geometry Demo J. Michael Burgess gbmeometry is a module with routines for handling GBM geometry. It performs a few tasks: * creates and astropy coordinate...
thalesians/tsa
src/jupyter/python/kalman.ipynb
apache-2.0
import os, sys sys.path.append(os.path.abspath('../../main/python')) import datetime as dt import numpy as np import numpy.testing as npt import matplotlib.pyplot as plt from thalesians.tsa.distrs import NormalDistr as N import thalesians.tsa.filtering as filtering import thalesians.tsa.filtering.kalman as kalman im...
jstac/recursive_utility_code
python/constant_vol/lg_discretized.ipynb
mit
D_vals = np.arange(5, 250, step=5) discrete_exponent_vals = np.empty_like(D_vals, dtype=np.float64) for d, D in enumerate(D_vals): discrete_exponent_vals[d] = lrm_discretized(lg, D=D) fig, ax = plt.subplots() ax.ticklabel_format(useOffset=False) #ax.set_ylim((a - 1.5 * 1e-8, a + 2 * 1e-9)) ax.plot(D_vals, np.one...
nmih/ssbio
docs/notebooks/GEM-PRO - SBML Model.ipynb
mit
import sys import logging # Import the GEM-PRO class from ssbio.pipeline.gempro import GEMPRO # Printing multiple outputs per cell from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" """ Explanation: GEM-PRO - SBML Model This notebook gives an example of how to ...
jsub10/MLCourse
Notebooks/Logistic-Regression.ipynb
mit
# Import our usual libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import os # OS-independent way to navigate the file system # Data directory is one directory up in relation to directory of this notebook data_dir_root = os.path.normpath(os.getcwd() + os.sep + os.par...
harmsm/pythonic-science
chapters/05_big-files/01_phred-scores-and-enrichment_key.ipynb
unlicense
p = np.arange(0.001,1,0.001) plt.plot(p,-10*np.log10(p)) plt.title("High Q score is good") """ Explanation: Extracting information about sequence quality and enrichment Enrichment Often want to compare two datasets (tissue 1 vs. tissue 2; -drug vs. +drug; etc.) Done by taking ratio of counts for sequences between dat...
cestella/presentations
NLP_on_non_textual_data/src/main/ipython/clinical2vec.ipynb
apache-2.0
print_synonyms('dx::440.0', model) """ Explanation: Atherosclerosis of the Aorta Also known as heart disease or hardening of the arteries. This disease is the number one killer of Americans. End of explanation """ #Crohn's Disease print_synonyms('dx::555.9', model) """ Explanation: Peptic Ulcers There have been lo...
jjonte/udacity-deeplearning-nd
py3/project-3/dlnd_tv_script_generation.ipynb
unlicense
""" 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...
sjsrey/pysal
notebooks/model/spvcm/spatially-varying-coefficients.ipynb
bsd-3-clause
side = np.arange(0,10,1) grid = np.tile(side, 10) beta1 = grid.reshape(10,10) beta2 = np.fliplr(beta1).T fig, ax = plt.subplots(1,2, figsize=(12*1.6, 6)) sns.heatmap(beta1, ax=ax[0]) sns.heatmap(beta2, ax=ax[1]) plt.show() """ Explanation: Today, we'll sample a spatially-varying coefficient model, like that discusse...
PyladiesMx/Empezando-con-Python
4. Lops/For Loops.ipynb
mit
#Obtén el cuadrado de 1 1**2 #Obtén el cuadrado de 2 2**2 #Obtén el cuadrado de 3 3**2 #Obtén el cuadrado de 4 4**2 #Obtén el cuadrado de 5 5**2 #Obtén el cuadrado de 6 6**2 #Obtén el cuadrado de 7 7**2 #Obtén el cuadrado de 8 8**2 #Obtén el cuadrado de 9 9**2 #Obtén el cuadrado de 10 10**2 """ Explanation: B...
dangall/Udacity-Machine-Learning-Nanodegree
P1_boston_housing/boston_housing.ipynb
mit
# Import libraries necessary for this project import numpy as np import pandas as pd from sklearn.cross_validation import ShuffleSplit # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the Boston housing dataset data = pd.read_csv('hou...
batfish/pybatfish
docs/source/notebooks/differentialQuestions.ipynb
apache-2.0
bf.set_network('generate_questions') bf.set_snapshot('filters-change') """ Explanation: Differential Questions Differential questions enable you to discover configuration and behavior differences between two snapshot of the network. Most of the Batfish questions can be run differentially by using snapshot=&lt;current...
AndreySheka/dl_ekb
hw8/VAE_homework.ipynb
mit
#The following line fetches you two datasets: images, usable for autoencoder training and attributes. #Those attributes will be required for the final part of the assignment (applying smiles), so please keep them in mind from lfw_dataset import fetch_lfw_dataset data,attrs = fetch_lfw_dataset() import numpy as np X_t...
PythonFreeCourse/Notebooks
week02/6_Documentation.ipynb
mit
dir(str) """ Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית."> <p style="text-align: right; dir...
ethen8181/machine-learning
deep_learning/softmax.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', 'notebook_format')) from formats import load_style load_style(plot_style = False) os.chdir(path) # 1. magic for inline plot # 2. magic to print version ...
neeasthana/ML-SQL
Clustering/Seeds/Seeds.ipynb
gpl-3.0
#Libraries and Imports import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pylab from sklearn.cluster import KMeans from sklearn import preprocessing from sklearn.decomposition import PCA """ Explanation: Seeds dataset (Clustering) Authors Written by: Neeraj Asthana (und...
deflaux/linkage-disequilibrium
datalab/Visualizing_Regional_LD.ipynb
apache-2.0
import gcp.bigquery as bq import pandas as pd import matplotlib.pyplot as plt """ Explanation: <!-- Copyright 2015 Google Inc. All rights reserved. --> <!-- 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...
google/struct2tensor
examples/prensor_playground.ipynb
apache-2.0
#@test {"skip": true} # install struct2tensor !pip install struct2tensor # graphviz for pretty output !pip install graphviz """ Explanation: Your structured data into Tensorflow. ML training often expects flat data, like a line in a CSV. tf.Example was designed to represent flat data. But the data you care about and ...
tensorflow/docs-l10n
site/zh-cn/hub/tutorials/yamnet.ipynb
apache-2.0
#@title Copyright 2020 The TensorFlow Hub Authors. All Rights Reserved. # # 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 ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/feature_engineering/solutions/4_keras_adv_feat_eng.ipynb
apache-2.0
# Run the chown command to change the ownership of the repository !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # 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 na...
ctn-waterloo/best-practices
Installation - setuptools.ipynb
mit
from setuptools import setup setup( name='bughandler', packages=['killer'] ) """ Explanation: Installation Purpose: set up a fresh computer to be able to run all aspects of your model and analysis. SetupTools: - Makes your code importable using Python - Checks all requirements are satisified - Makes your code...
evanmiltenburg/python-for-text-analysis
Assignments/ASSIGNMENT-1.ipynb
apache-2.0
# average code """ Explanation: Assignment 1: Calculation, Strings, Boolean Expressions and Conditions Deadline: Friday, September 9, 2021 before 3pm (submit via Canvas: Block I/Assignment 1) This assignment is not graded, but it is mandatory to submit a version that shows you have given it a serious try. We will che...
eds-uga/csci1360e-su17
lectures/L8.ipynb
mit
def pet_names(name1, name2): print("Pet 1: ", name1) print("Pet 2: ", name2) pet1 = "King" pet2 = "Reginald" pet_names(pet1, pet2) # pet1 variable, then pet2 variable pet_names(pet2, pet1) # notice we've switched the order in which they're passed to the function """ Explanation: Lecture 8: Functions II CSCI...
asharel/ml
LAB2/src/Practica2.ipynb
gpl-3.0
#Libraries import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt # Read Dataset from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn import metrics import sklearn.featur...
zzsza/TIL
pytorch/GAN.ipynb
mit
D = nn.Sequential( nn.Linear(784, 256), nn.ReLU(), nn.Linear(256, 256), nn.ReLU(), nn.Linear(256, 1), nn.Sigmoid()) G = nn.Sequential( nn.Linear(64, 256), nn.ReLU(), nn.Linear(256, 256), nn.ReLU(), nn.Linear(256, 784), nn.Tanh()) transform = transforms.Compose([ ...
BrownDwarf/ApJdataFrames
notebooks/Somers2017.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import pandas as pd pd.options.display.max_columns = 150 %config InlineBackend.figure_format = 'retina' import astropy from astropy.io import ascii from astropy.table import Table import numpy as np """ Explanation: Somers2017 Title: A Measuremen...
tpin3694/tpin3694.github.io
sql/sort_by_multiple_columns.ipynb
mit
# Ignore %load_ext sql %sql sqlite:// %config SqlMagic.feedback = False """ Explanation: Title: Sort By Multiple Columns Slug: sort_by_multiple_columns Summary: Sort By Multiple Columns in SQL. Date: 2017-01-16 12:00 Category: SQL Tags: Basics Authors: Chris Albon Note: This tutorial was written using Catherine De...
napsternxg/ipython-notebooks
Dynamic Programming.ipynb
apache-2.0
def wrapper(S, coins): states = [(10000, set()) for k in range(S+1)] states = [(10000, []) for k in range(S+1)] return n_coins(S, coins, states) def n_coins(S, coins, states): if S < 1: return (10000, []) if S in coins: return (1, [S]) if S < min(coins): return (10000, [...
quantopian/research_public
notebooks/lectures/Introduction_to_NumPy/notebook.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt """ Explanation: Introduction to NumPy by Maxwell Margenot Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantopian/research_public Notebook released under the Creative Commons Attribution 4.0 License. NumPy is an incredibly powerful ...
sdss/marvin
docs/sphinx/tutorials/notebooks/Basics_of_Marvin.ipynb
bsd-3-clause
from marvin.tools import Cube """ Explanation: Basics of Marvin In this notebook, you will learn the common core functionality across many of the Marvin Tools. This includes the basics of accessing and handling MaNGA data from different locations, as well as a beginners guide of interacting with data via the core too...
hail-is/hail
hail/python/hail/docs/tutorials/06-joins.ipynb
mit
import hail as hl hl.utils.get_movie_lens('data/') users = hl.read_table('data/users.ht') movies = hl.read_table('data/movies.ht') ratings = hl.read_table('data/ratings.ht') """ Explanation: Table Joins Tutorial This tutorial walks through some ways to join Hail tables. We'll use a simple movie dataset to illustrate...
kit-cel/lecture-examples
nt2_ce2/vorlesung/ch_2_properties_lin_modulation/psd_linear_modulation.ipynb
gpl-2.0
# importing import numpy as np import matplotlib.pyplot as plt import matplotlib # showing figures inline %matplotlib inline # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=True) matplotlib.rc('figure', figsize=(18, 10) ) """ Explanation: Content and Objectives Show PSD of ...
ES-DOC/esdoc-jupyterhub
notebooks/hammoz-consortium/cmip6/models/sandbox-3/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-3', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: HAMMOZ-CONSORTIUM Source ID: SANDBOX-3 Topic: Landice Sub-Topics: G...
diegocavalca/Studies
deep-learnining-specialization/4. Convolutional Neural Networks/week2/Keras+-+Tutorial+-+Happy+House+v2.ipynb
cc0-1.0
import numpy as np from keras import layers from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D from keras.models import Model from keras.preprocessing import im...
phungkh/phys202-2015-work
assignments/assignment12/FittingModelsEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Fitting Models Exercise 2 Imports End of explanation """ A=np.load('decay_osc.npz') tdata = A['tdata'] ydata= A['ydata'] dy = A['dy'] tdata, ydata, dy plt.figure(figsize=(10,5)) plt.scatter(tdata,yd...
google/applied-machine-learning-intensive
content/04_classification/06_images_and_video/00-pil.ipynb
apache-2.0
# 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 the L...
jedbrown/numerical-computation
LinearAlgebra.ipynb
mit
%matplotlib notebook import numpy from matplotlib import pyplot def matmult1(A, x): """Entries of y are dot products of rows of A with x""" y = numpy.zeros_like(A[:,0]) for i in range(len(A)): row = A[i,:] for j in range(len(row)): y[i] += row[j] * x[j] return y A = numpy.a...
root-mirror/training
SoftwareCarpentry/exercises/fitting-exercise.ipynb
gpl-2.0
import ROOT data = [ 6,1,10,12,6,13,23,22,15,21, 23,26,36,25,27,35,40,44,66,81, 75,57,48,45,46,41,35,36,53,32, 40,37,38,31,36,44,42,37,32,32, 43,44,35,33,33,39,29,41,32,44, 26,39,29,35,32,21,21,15,25,15 ] title = 'Lorentzian Peak on Quadratic Background' h = ROOT.TH1F('his...
superliaoyong/plist-forsource
python第一课课件.ipynb
apache-2.0
print('hello, "world') print("hello, 'world") import this """ Explanation: 人生苦短,我用python python课程 课表 一、 python基础 - 变量与数据类型,及常见数据类型的用法 二、 python基础 - 条件、循环、函数、类 三、 python爬虫 - python爬虫并用Mysql数据库存储 四、 pandas通览 - 用pandas做数据处理与分析 五、 实战 - 泰坦尼克幸存者预测 学完本课程之后,你会: 1、 掌握基本的python语法,并编写...
jmschrei/pomegranate
examples/bayes_classifier_hmm_cheating_coin_toss.ipynb
mit
from pomegranate import * import numpy as np %pylab inline """ Explanation: Bayes Classifier with Hidden Markov Model emissions Coin Toss author: Nicholas Farn [<a href="sendto:nicholasfarn@gmail.com">nicholasfarn@gmail.com</a>], Jacob Schreiber [<a href="sendto:jmschreiber91@gmail.com">jmschreiber91@gmail.com...
leriomaggio/deep-learning-keras-tensorflow
1. ANN/1.1.1 Perceptron and Adaline.ipynb
mit
# Display plots in notebook %matplotlib inline # Define plot's default figure size import matplotlib """ Explanation: (exceprt from Python Machine Learning Essentials, Supplementary Materials) Sections Implementing a perceptron learning algorithm in Python Training a perceptron model on the Iris dataset Adaptive l...
matt-graham/auxiliary-pm-mcmc
experiment_notebooks/Auxiliary Pseudo-Marginal MCMC - MI u updates and MH theta updates.ipynb
mit
data_dir = os.path.join(os.environ['DATA_DIR'], 'uci') exp_dir = os.path.join(os.environ['EXP_DIR'], 'apm_mcmc') """ Explanation: Construct data and experiments directorys from environment variables End of explanation """ data_set = 'pima' method = 'apm(mi+mh)' n_chain = 10 chain_offset = 0 seeds = np.random.random_...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-2/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: TEST-INSTITUTE-2 Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical...
metpy/MetPy
dev/_downloads/c1a3b4ec1d09d4debc078297d433a9b2/Point_Interpolation.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature from matplotlib.colors import BoundaryNorm import matplotlib.pyplot as plt import numpy as np from metpy.cbook import get_test_data from metpy.interpolate import (interpolate_to_grid, remove_nan_observations, remove_repeat_coo...