repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
loujine/musicbrainz-dataviz
0-introduction.ipynb
mit
%load_ext watermark %watermark --python -r %watermark --date --updated """ Explanation: Visualizing MusicBrainz data with Python/JS, an introduction This introductory notebook will explain how I get database from MusicBrainz and how I transform it to Python format for display in tables or plots. A static HTML version...
phoebe-project/phoebe2-docs
2.0/examples/minimal_synthetic.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" %matplotlib inline """ Explanation: Minimal Example to Produce a Synthetic Light Curve Setup Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest rel...
h-mayorquin/time_series_basic
presentations/.ipynb_checkpoints/2015-august-checkpoint.ipynb
bsd-3-clause
# Scientific Python libraries import numpy as np import matplotlib.pyplot as plt import mpld3 import seaborn as sn mpld3.enable_notebook() import sys sys.path.append("../") # Nexa in-house libraries from signals.time_series_class import MixAr from signals.aux_functions import sidekick from input.sensors import Perceptu...
ebridge2/FNGS_website
sic/sic_ndmg.ipynb
apache-2.0
%%bash ndmg_demo-func """ Explanation: SIC for NDMG Pipeline The NDMG pipeline estimates connectomes from M3r (multi-modal MRI) scans. The NDMG pipeline is designed to operate with: NDMG-d + 1xdiffusion-weighted image (DWI) for a particular subject. + 1xbval file giving the magnitude of diffuion vectors in the DWI. +...
cypherai/PySyft
notebooks/Syft - Testing - Benchmark Tests.ipynb
apache-2.0
from syft.test.benchmark import Benchmark Benchmark(str) """ Explanation: Testing: Benchmark Tests One goal of the OpenMined project is to efficiently train Deep Learning models in a homomorphically encrypted state. Therefore it is very important to benchmark new and existing features in order to achieve better and f...
resendislab/cobrame-docker
getting_started.ipynb
apache-2.0
import pickle with open("me_models/iLE1678.pickle", "rb") as model_file: ecoli = pickle.load(model_file) """ Explanation: Building and solving the E. coli ME model The image includes the COBRAme and ECOLIme Python packages to get you started quickly. The docker image includes a prebuild version of the E. coli ME ...
Ragnamus/sci-comp
notebooks/matthew.truscott.ipynb
mit
from prettytable import PrettyTable import numpy as np def root_finder(): a = 1 b = 1 crray = np.geomspace(0.1, (10 ** (-200)), num=200, endpoint=False) t = PrettyTable(['root1', 'root2', 'root3', 'root4']) for c in crray: root = np.sqrt((b * b) - (4 * a * c)) #print(root) r...
BrainIntensive/OnlineBrainIntensive
resources/matplotlib/AnatomyOfMatPlotLib/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() """ Explanation: How to speak "MPL" In the previous parts, you learned how Matplotlib organizes plot-making by figures and axes. We broke down the components of a basic figure and learned how to create them. You als...
landlab/landlab
notebooks/tutorials/overland_flow/linear_diffusion_overland_flow/linear_diffusion_overland_flow_router.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from landlab import RasterModelGrid, imshow_grid from landlab.components.overland_flow import LinearDiffusionOverlandFlowRouter from landlab.io.esri_ascii import read_esri_ascii """ Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../.....
ryan-leung/PHYS4650_Python_Tutorial
notebooks/06-Python-Matplotlib.ipynb
bsd-3-clause
import matplotlib.pyplot as plt %matplotlib inline import numpy as np """ Explanation: Matplotlib <img src="images/matplotlib.svg" alt="matplotlib" style="width: 600px;"/> <a href="https://colab.research.google.com/github/ryan-leung/PHYS4650_Python_Tutorial/blob/master/notebooks/06-Python-Matplotlib.ipynb"><img align...
ekaakurniawan/iPyMacLern
ML-W1/Linear Regression With One Variable.ipynb
gpl-3.0
import sys print("Python %d.%d.%d" % (sys.version_info.major, \ sys.version_info.minor, \ sys.version_info.micro)) import numpy as np print("NumPy %s" % np.__version__) import matplotlib import matplotlib.pyplot as plt print("matplotlib %s" % matplotlib.__version_...
turi-code/tutorials
strata-sj-2016/time-series/anomaly_detection.ipynb
apache-2.0
import graphlab as gl okla_daily = gl.load_timeseries('working_data/ok_daily_stats.ts') print "Number of rows:", len(okla_daily) print "Start:", okla_daily.min_time print "End:", okla_daily.max_time okla_daily.print_rows(3) import matplotlib.pyplot as plt %matplotlib notebook plt.style.use('ggplot') fig, ax = plt.s...
tritemio/multispot_paper
Multi-spot Gamma Fitting.ipynb
mit
from fretbursts import fretmath import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from cycler import cycler import seaborn as sns %matplotlib inline %config InlineBackend.figure_format='retina' # for hi-dpi displays import matplotlib as mpl from cycler import cycler bma...
jamesfolberth/NGC_STEM_camp_AWS
notebooks/data8_notebooks/project3/project3.ipynb
bsd-3-clause
# Run this cell to set up the notebook, but please don't change it. import numpy as np import math from datascience import * # These lines set up the plotting functionality and formatting. import matplotlib matplotlib.use('Agg', warn=False) %matplotlib inline import matplotlib.pyplot as plt plt.style.use('fivethirtye...
tensorflow/model-remediation
docs/min_diff/guide/customizing_min_diff_model.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...
CentroGeo/Analisis-Espacial
muap/MUAP II.ipynb
gpl-2.0
from geopandas import GeoDataFrame datos = GeoDataFrame.from_file('data/distritos_variables.shp') datos.head() """ Explanation: Parte II: efecto de agregación En la primera parte de la práctica vimos cómo la escala de análisis tiene influencia sobre los resultados del mismo. En esta segunda parte vamos a ver como dife...
metpy/MetPy
v1.0/_downloads/cdca3e0cb8a2930cccab0e29b97ef52a/upperair_soundings.ipynb
bsd-3-clause
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import Hodograph, SkewT from metpy.units import units """ Explanation: Upper Air Sounding Tutorial Upper air analysis is a...
kyleabeauchamp/mdtraj
examples/rmsd-benchmark.ipynb
lgpl-2.1
t = md.Trajectory(xyz=np.random.randn(1000, 100, 3), topology=None) print(t) """ Explanation: To benchmark the speed of the RMSD calculation, it's not really necessary to use 'real' coordinates, so let's just generate some random numbers from a normal distribution for the cartesian coordinates. End of explanation """ ...
tensorflow/docs-l10n
site/ja/guide/gpu.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...
AbeHandler/minhash_tutorial
start.ipynb
mit
import itertools import string import functools letters = string.ascii_lowercase vocab = list(map(''.join, itertools.product(letters, repeat=2))) from random import choices def zipf_pdf(k): return 1/k**1.07 def exponential_pdf(k, base): return base**k def new_document(n_words, pdf): return set( ...
ajgpitch/qutip-notebooks
examples/photon_birth_death.ipynb
lgpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from qutip import * """ Explanation: QuTiP Example: Birth and Death of Photons in a Cavity J.R. Johansson and P.D. Nation For more information about QuTiP see http://qutip.org End of explanation """ N=5 a=destroy(N) H=a.dag()*a # Simple os...
lileiting/goatools
notebooks/report_depth_level.ipynb
bsd-2-clause
# Get http://geneontology.org/ontology/go-basic.obo from goatools.base import download_go_basic_obo obo_fname = download_go_basic_obo() """ Explanation: Report counts of GO terms at various levels and depths Reports the number of GO terms at each level and depth. Level refers to the length of the shortest path fro...
lepmik/nest-simulator
doc/model_details/aeif_models_implementation.ipynb
gpl-2.0
import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (15, 6) """ Explanation: NEST implementation of the aeif models Hans Ekkehard Plesser and Tanguy Fardet, 2016-09-09 This notebook provides a reference solution for the Adaptive Expo...
nimagh/CNN_Implementations
Notebooks/VAE.ipynb
gpl-3.0
%load_ext autoreload %autoreload 2 import os, sys sys.path.append('../') sys.path.append('../common') sys.path.append('../GenerativeModels') from tools_general import tf, np from IPython.display import Image from tools_train import get_train_params, OneHot, vis_square from tools_config import data_dir from tools_trai...
jsharpna/DavisSML
lectures/lecture8/lecture8.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt ## open wine data wine = pd.read_csv('../../data/winequality-red.csv',delimiter=';') Y = wine.values[:,-1] X = wine.values[:,:-1] n,p = X.shape X = n**0.5 * (X - X.mean(axis=0)) / X.std(axis=0) ## Look at LROnline.py from LROnline import * lear...
openearth/notebooks
unstrucgridplot.ipynb
gpl-3.0
# Create split locations if not hasattr(netelemnode, 'mask'): netelemnode = np.ma.masked_array(netelemnode, mask=False) splitidx = np.cumsum(np.r_[(~netelemnode.mask).sum(1)][:-1]) # Convert to 1d filled idx idx = netelemnode[(~netelemnode.mask)]-1 xpoly = np.split(X[idx],splitidx) # x vector per poly ypoly = np.sp...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/08_image_keras/labs/mnist_models.ipynb
apache-2.0
import os PROJECT = "cloud-training-demos" # REPLACE WITH YOUR PROJECT ID BUCKET = "cloud-training-demos-ml" # REPLACE WITH YOUR BUCKET NAME REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 MODEL_TYPE = "linear" # "linear", "dnn", "dnn_dropout", or "cnn" # do not change these os.environ["PROJ...
noammor/coursera-machinelearning-python
ex1/ml-ex1-multivariate.ipynb
mit
import pandas import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Exercise 1: Linear regression with multiple variables End of explanation """ data = pandas.read_csv('ex1data2.txt', header=None, names=['x1', 'x2', 'y']) data.head() data.shape X = data[['x1', 'x2']].values Y = da...
IS-ENES-Data/submission_forms
test/forms/CMIP6/.ipynb_checkpoints/CMIP6_ki_123-checkpoint.ipynb
apache-2.0
# initialize your CORDEX submission form template from dkrz_forms import form_handler from dkrz_forms import checks """ Explanation: DKRZ CMIP6 submission form for ESGF data publication General Information Data to be submitted for ESGF data publication must follow the rules outlined in the CMIP6 Archive Design Docume...
ericmjl/Network-Analysis-Made-Simple
notebooks/03-practical/01-io.ipynb
mit
from IPython.display import YouTubeVideo YouTubeVideo(id="3sJnTpeFXZ4", width="100%") """ Explanation: Introduction End of explanation """ from pyprojroot import here """ Explanation: In order to get you familiar with graph ideas, I have deliberately chosen to steer away from the more pedantic matters of loading g...
coolharsh55/advent-of-code
2016/python3/Day05.ipynb
mit
with open('../inputs/day05.txt', 'r') as f: door_id = f.readline().strip() """ Explanation: Day 5: How About a Nice Game of Chess? author: Harshvardhan Pandit license: MIT link to problem statement You are faced with a security door designed by Easter Bunny engineers that seem to have acquired most of their securi...
xgrg/alfa
notebooks/Miscellaneous/Box-Cox transformation.ipynb
mit
# Generate data x = stats.loggamma.rvs(5, size=500) + 5 # Plot it fig = plt.figure(figsize=(6,9)) ax1 = fig.add_subplot(211) prob = stats.probplot(x, dist=stats.norm, plot=ax1) ax1.set_title('Probplot against normal distribution') # Plot an histogram ax2 = fig.add_subplot(212) ax2.hist(x) ax2.set_title('Histogram') ...
xebia-france/luigi-airflow
Luigi_airflow_004.ipynb
apache-2.0
raw_dataset = pd.read_csv(source_path + "Speed_Dating_Data.csv",encoding = "ISO-8859-1") """ Explanation: Import data End of explanation """ raw_dataset.head(3) raw_dataset_copy = raw_dataset check1 = raw_dataset_copy[raw_dataset_copy["iid"] == 1] check1_sel = check1[["iid", "pid", "match","gender","date","go_out"...
buntyke/DataAnalysis
startup.ipynb
mit
# Hit shift + enter or use the run button to run this cell and see the results print 'hello world' # The last line of every code cell will be displayed by default, # even if you don't print it. Run this cell to see how this works. 2 + 2 # The result of this line will not be displayed 3 + 3 # The result of this line...
feststelltaste/software-analytics
cheatbooks/groupby.ipynb
gpl-3.0
import pandas as pd df = pd.DataFrame({ "file" : ['hello.java', 'tutorial.md', 'controller.java', "build.sh", "deploy.sh"], "dir" : ["src", "docs", "src", "src", "src"], "bytes" : [54, 124, 36, 78, 62] }) df """ Explanation: groupby With groupby, you can group data in a DataFrame and apply calculations...
dolittle007/dolittle007.github.io
notebooks/bayesian_neural_network_advi.ipynb
gpl-3.0
%matplotlib inline import theano floatX = theano.config.floatX import pymc3 as pm import theano.tensor as T import sklearn import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_style('white') from sklearn import datasets from sklearn.preprocessing import scale from sklearn.cross_validation im...
RyRose/College-Projects
lab4/Lab 4.ipynb
mit
## Imports! %matplotlib inline import os import re import string import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.mlab import PCA from scipy.cluster.vq import kmeans, vq """ Explanation: Lab 4 Ryan Rose Scientific Computing 9/21/2016 End of explanation """ os.chdir("/home/ryan/...
jpcofr/svgpathtools
README.ipynb
mit
from __future__ import division, print_function # Coordinates are given as points in the complex plane from svgpathtools import Path, Line, QuadraticBezier, CubicBezier, Arc seg1 = CubicBezier(300+100j, 100+100j, 200+200j, 200+300j) # A cubic beginning at (300, 100) and ending at (200, 300) seg2 = Line(200+300j, 250+...
jjehl/poppy_education
python-divers/python_language_objet.ipynb
gpl-2.0
objet1 = 'bol' """ Explanation: Séquences 1 - Découverte de la programmation objet et du language Python Activité 1 - Manipuler les objets Python Compétences visées par cette activité : Savoir créer des variables de types chaîne de caractères et liste. Utiliser une méthode liée à un objet par la syntaxe objet.méthode...
idc9/law-net
vertex_metrics_experiment/data_pipline_scotus.ipynb
mit
setup_data_dir(data_dir) make_subnetwork_directory(data_dir, network_name) """ Explanation: set up the data directory End of explanation """ download_op_and_cl_files(data_dir, network_name) """ Explanation: data download get opinion and cluster files from CourtListener opinions/cluster files are saved in data_dir/...
dnc1994/MachineLearning-UW
ml-regression/blank/week-4-ridge-regression-assignment-1-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 4: Ridge Regression (interpretation) In this notebook, we will run ridge regression multiple times with different L2 penalties to see which one produces the best fit. We will revisit the example of polynomial regression as a means to see the effect of L2 regularization....
OpenDSA/Analysis
Yusuf/Test_Clustering_Results_22.ipynb
mit
clusters_df_22 = pd.read_csv("Clustered_Sessions_FCM.csv") clusters_df_22.columns framesets_credit_seek = clusters_df_22[clusters_df_22['cluster']=='Credit Seeking']['curr_frameset_name'].unique() framesets_normal = clusters_df_22[clusters_df_22['cluster']=='Normal'] ['curr_frameset_name'].unique() for framename in f...
OceanPARCELS/parcels
parcels/examples/parcels_tutorial.ipynb
mit
%matplotlib inline from parcels import FieldSet, ParticleSet, Variable, JITParticle, AdvectionRK4, plotTrajectoriesFile import numpy as np import math from datetime import timedelta from operator import attrgetter """ Explanation: Parcels Tutorial Welcome to a quick tutorial on Parcels. This is meant to get you starte...
GoogleCloudPlatform/mlops-on-gcp
model_serving/bqml-caip/02-bqml-to-caip-pipeline.ipynb
apache-2.0
import kfp import kfp.components as comp import random import os #Common Parameters PROJECT_ID=[] #enter your project name KFPHOST=[] #enter your KFP hostname #Parameters for BQML DATASET=[] #name of dataset to create or use if exists VIEW= [] #name of view to be created for BQML create model MODEL=[] ...
Esri/gis-stat-analysis-py-tutor
notebooks/PythonFeatureIO.ipynb
apache-2.0
import arcpy as ARCPY import numpy as NUM import SSDataObject as SSDO """ Explanation: Using the Spatial Statistics Data Object (SSDataObject) Makes Feature IO Simple SSDataObject does the read/write and accounting of feature/attribute and NumPy Array order Write/Utilize methods that take NumPy Arrays Using NumPy as...
marco-olimpio/ufrn
IMD0104 - PROGRAMAÇÃO ORIENTADA A OBJETOS E MAPEAMENTO OBJETO-RELACIONAL/assignments/3/all-that-you-need-to-know-about-the-android-market.ipynb
gpl-3.0
print('Number of apps in the dataset : ' , len(df)) df.sample(7) """ Explanation: Sneak peek at the dataset df = pd.read_csv('../input/googleplaystore.csv') print(df.dtypes) df.loc[df.App=='Tiny Scanner - PDF Scanner App'] df[df.duplicated(keep='first')] df.drop_duplicates(subset='App', inplace=True) df = df[df['Andro...
taliamo/Final_Project
organ_pitch/.ipynb_checkpoints/upload_pitch_data-checkpoint.ipynb
mit
# I import useful libraries (with functions) so I can visualize my data # I use Pandas because this dataset has word/string column titles and I like the readability features of commands and finish visual products that Pandas offers import pandas as pd import matplotlib.pyplot as plt import re import numpy as np %matp...
phoebe-project/phoebe2-docs
development/tutorials/ETV.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: ETV Datasets and Options Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as ...
thinkingmachines/deeplearningworkshop
codelab_3_tensorflow_nn.ipynb
mit
import numpy as np import matplotlib.pyplot as plt N = 100 # points per class D = 2 # dimensionality at 2 so we can eyeball it K = 3 # number of classes X = np.zeros((N*K, D)) # generate an empty matrix to hold X features y = np.zeros(N*K, dtype='int32') # switching this to int32 # for 3 classes, evenly generates s...
LimeeZ/phys292-2015-work
assignments/assignment08/InterpolationEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np sns.set_style('white') from scipy.interpolate import griddata """ Explanation: Interpolation Exercise 2 End of explanation """ x = np.linspace(-5.0,5.0 , 10) y = np.linspace(-5.0, 5.0, 10) f = (x,y) np.hstack? """ Explanat...
drphilmarshall/StatisticalMethods
lessons/templates/RISE_example.ipynb
gpl-2.0
# This is a code block within slide #2. b = 1 # Obviously, its the same python instance under the hood. b """ Explanation: This is slide #1. Space and ctrl-space (or the clickable arrows) are used to move between slides. Up/down arrows (or mouse) are used to move between cells. Shift-enter executes a cell, as usual....
dtamayo/rebound
ipython_examples/VariationalEquationsWithChainRule.ipynb
gpl-3.0
import rebound import numpy as np """ Explanation: Using Variational Equations With the Chain Rule For a complete introduction to variational equations, please read the paper by Rein and Tamayo (2016). Variational equations can be used to calculate derivatives in an $N$-body simulation. More specifically, given a set ...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_mixed_norm_inverse.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne from mne.datasets import sample from mne.inverse_sparse import mixed_norm from mne.minimum_norm import make_inverse_operator, apply_inverse from mne.viz import plot_sparse_source_estimates print(__doc__) dat...
belteki/alarms
Alarms_GitHub.ipynb
gpl-3.0
import IPython import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt import os import sys import pickle import scipy as sp from scipy import stats from pandas import Series, DataFrame from datetime import datetime, timedelta %matplotlib inline matplotlib.style.use('classic') matplot...
European-XFEL/h5tools-py
docs/apply_geometry.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import h5py from karabo_data import RunDirectory, stack_detector_data from karabo_data.geometry2 import LPD_1MGeometry run = RunDirectory('/gpfs/exfel/exp/FXE/201830/p900020/proc/r0221/') run.info() # Find a train with some data in empty = np.asar...
timkpaine/lantern
experimental/ipysheet.ipynb
apache-2.0
import ipysheet sheet = ipysheet.sheet() sheet """ Explanation: Spreadsheet widget for the Jupyter Notebook Installation To install use pip: $ pip install ipysheet To make it work for Jupyter lab: $ jupyter labextension ipysheet If you have notebook 5.2 or below, you also need to execute: $ jupyter nbextension enable ...
julienchastang/unidata-python-workshop
notebooks/Declarative_Plotting/Satellite_Declarative.ipynb
mit
from siphon.catalog import TDSCatalog from datetime import datetime # Create variables for URL generation image_date = datetime.utcnow().date() region = 'Mesoscale-1' channel = 8 # Create the URL to provide to siphon data_url = ('https://thredds.ucar.edu/thredds/catalog/satellite/goes/east/products/' f'C...
snowicecat/umich-eecs445-f16
handsOn_lecture06_MLE-MAP-Coding/HandsOn06_MAP-coding.ipynb
mit
# all the packages you need import numpy as np import matplotlib.pyplot as plt import scipy.io from numpy.linalg import inv # load data from .mat mat = scipy.io.loadmat('mnist_49_3000.mat') print (mat.keys()) x = mat['x'].T y = mat['y'].T print (x.shape, y.shape) # show example image plt.imshow (x[4, :].reshape(28, ...
alepoydes/introduction-to-numerical-simulation
practice/covid/COVID-19.ipynb
mit
# Устанавливаем библиотеки, если это не было сделано ранее. # ! pip3 install seaborn matplotlib numpy pandas # Импорт библиотек import numpy as np import matplotlib.pyplot as plt import urllib.request import pandas as pd import seaborn as sns # Используем настройки seaborn по-умолчанию, устанавливаем только размер ри...
mitdbg/modeldb
demos/webinar-2020-5-6/02-mdb_versioned/01-train/02 Positive Data NLP.ipynb
mit
from __future__ import unicode_literals, print_function import boto3 import json import numpy as np import pandas as pd import spacy """ Explanation: Versioning Example (Part 2/3) In part 1, we trained and logged a tweet sentiment classifier using ModelDB's versioning system. Now we'll see how that can come in handy ...
Danghor/Algorithms
Python/Chapter-04/Merge-Sort-Iterative.ipynb
gpl-2.0
def sort(L): A = L[:] # A is a copy of L mergeSort(L, A) """ Explanation: An Iterative Implementation of Merge Sort The function $\texttt{sort}(L)$ sorts the list $L$ in place using <em style="color:blue">merge sort</em>. It takes advantage of the fact that, in Python, lists are stored internally as arrays. T...
bashtage/statsmodels
examples/notebooks/mediation_survival.ipynb
bsd-3-clause
import pandas as pd import numpy as np import statsmodels.api as sm from statsmodels.stats.mediation import Mediation """ Explanation: Mediation analysis with duration data This notebook demonstrates mediation analysis when the mediator and outcome are duration variables, modeled using proportional hazards regression....
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/gfdl-cm4/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-cm4', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: GFDL-CM4 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Ener...
gdsfactory/gdsfactory
docs/notebooks/common_mistakes.ipynb
mit
import gdsfactory as gf @gf.cell def wg(length: float = 3): return gf.components.straight(length=length) print(wg(length=5)) print(wg(length=50)) """ Explanation: Common mistakes 1. Creating cells without cell decorator The cell decorator names cells deterministically and uniquely based on the name of the func...
Kaggle/learntools
notebooks/game_ai/raw/tut_halite.ipynb
apache-2.0
#$HIDE_INPUT$ from kaggle_environments import make, evaluate env = make("halite", debug=True) env.run(["random", "random", "random", "random"]) env.render(mode="ipython", width=800, height=600) """ Explanation: Halite is an online multiplayer game created by Two Sigma. In the game, four participants command ships to ...
swirlingsand/self-driving-car-nanodegree-nd013
CarND-LaneLines-P1-1/P1.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 import math %matplotlib inline #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg') #printing out some stats and plotting print('This image is:', type(image), 'with dim...
Nikea/scikit-xray-examples
demos/time_correlation/two-time-with-partial-data.ipynb
bsd-3-clause
import skbeam.core.correlation as corr from skbeam.core.correlation import two_time_corr, two_time_state_to_results import skbeam.core.roi as roi import skbeam.core.utils as utils from xray_vision.mpl_plotting.roi import show_label_array_on_image import numpy as np import time as ttime import matplotlib.pyplot as plt...
jonnydyer/pypropep
ipython_doc/BasicRocketPerformance.ipynb
gpl-3.0
p = ppp.ShiftingPerformance() o2 = ppp.PROPELLANTS['OXYGEN (GAS)'] ch4 = ppp.PROPELLANTS['METHANE'] p.add_propellants([(ch4, 1.0), (o2, 1.0)]) p.set_state(P=10, Pe=0.01) print p for k,v in p.composition.items(): print "{} : ".format(k) pprint.pprint(v[0:8], indent=4) OF = np.linspace(1, 5) m_CH4 = 1.0 cstar...
pysg/pyther
practica_de_flash_isotermico.ipynb
mit
def Ki_wilson(self): """Equation of wilson for to calculate the Ki(T,P)""" variable_0 = 5.373 * (1 + self.w) * (1 - self.Tc / self.T) lnKi = np.log(self.Pc / self.P) + variable_0 self.Ki = np.exp(lnKi) return self.Ki """ Explanation: Práctico flash isotermico Jose Euliser M...
tpin3694/tpin3694.github.io
machine-learning/converting_a_dictionary_into_a_matrix.ipynb
mit
# Load library from sklearn.feature_extraction import DictVectorizer """ Explanation: Title: Converting A Dictionary Into A Matrix Slug: converting_a_dictionary_into_a_matrix Summary: How to convert a dictionary into a feature matrix for machine learning in Python. Date: 2016-09-06 12:00 Category: Machine Learning T...
mrcslws/nupic.research
projects/archive/dynamic_sparse/notebooks/mcaporale/2019-10-11-ExperimentAnalysis-SmallDense.ipynb
agpl-3.0
from IPython.display import Markdown, display %load_ext autoreload %autoreload 2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands i...
tu-rbo/concarne
example/concarne_multiview_demo.ipynb
mit
from __future__ import print_function import concarne import concarne.patterns import concarne.training import lasagne import theano.tensor as T %pylab inline try: import sklearn.linear_model as sklm except: print ( """You don't have scikit-learn installed; install it to compare learning with side informati...
andreyf/machine-learning-examples
decision_trees_knn/practice_trees_titanic.ipynb
gpl-3.0
import numpy as np import pandas as pd from sklearn.tree import DecisionTreeClassifier, export_graphviz from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import GridSearchCV from sklearn.metrics import roc_auc_score, accuracy_score, confusion_matrix %matplotlib inline from matplotlib impo...
juditacs/labor
notebooks/bi_ea_demo/cryptocurrency_prediction_failed.ipynb
lgpl-3.0
import os import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from keras.layers import Input, Dense, Bidirectional, Dropout from keras.layers.recurrent import LSTM from keras.models import Model from keras.callbacks import EarlyStopping import numpy as np os.listdir("data/cryptocurrency/") """ Ex...
idekerlab/deep-cell
data-builder/yeastnet_raw_interactions.ipynb
mit
import pandas as pd from os import listdir from os.path import isfile, join import numpy as np from goatools import obo_parser # Annotation file for the CLIXO terms clixo_mapping = './data/alignments_FDR_0.1_t_0.1' oboUrl = './data/go.obo' clixo_align = pd.read_csv(clixo_mapping, sep='\t', names=['term', 'go', 'score...
PedramNavid/MachineLearningNanodegree
3_Titanic/.ipynb_checkpoints/titanic_survival_exploration-checkpoint.ipynb
gpl-3.0
import sys print(sys.version) import numpy as np import pandas as pd # RMS Titanic data visualization code from titanic_visualizations import survival_stats from IPython.display import display %matplotlib inline # Load the dataset in_file = 'titanic_data.csv' full_data = pd.read_csv(in_file) # Print the first few ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/migration/UJ9 Custom Training Prebuilt Container XGBoost.ipynb
apache-2.0
! pip3 install -U google-cloud-aiplatform --user """ Explanation: Vertex SDK: Train and deploy an XGBoost model with pre-built containers (formerly hosted runtimes) Installation Install the latest (preview) version of Vertex SDK. End of explanation """ ! pip3 install google-cloud-storage """ Explanation: Install th...
softEcon/course
lectures/economic_models/generalized_roy/module/lecture.ipynb
mit
from IPython.core.display import HTML, display display(HTML('material/images/grm.html')) """ Explanation: Module As your code grows more and more complex, it is useful to collect all code in a an external file. Here we store all the functions form our notebook in a single file grm.py. Nothing new happens, we just cop...
dougalsutherland/pummeler
notebooks/election data by region.ipynb
mit
from __future__ import division, print_function %matplotlib inline import numpy as np import pandas as pd import re import six from IPython.display import display import sys sys.path.append('..') from pummeler.data import geocode_data county_to_region = geocode_data('county_region_10').region.to_dict() """ Explan...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/emac-2-53-aerchem/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-aerchem', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: EMAC-2-53-AERCHEM Topic: Aerosol...
mwickert/SP-Comm-Tutorial-using-scikit-dsp-comm
tutorial_part2/RealTime-DSP.ipynb
bsd-2-clause
Image('PyAudio_RT_flow@300dpi.png',width='90%') pah.available_devices() """ Explanation: Introduction A simplified block diagram of PyAudio streaming-based (nonblocking) signal processing. End of explanation """ # define a pass through, y = x, callback def callback(in_data, frame_count, time_info, status): DSP_...
NeuPhysics/aNN
ipynb/.ipynb_checkpoints/vacuumClean-checkpoint.ipynb
mit
# This line configures matplotlib to show figures embedded in the notebook, # instead of opening a new window for each figure. More about that later. # If you are using an old version of IPython, try using '%pylab inline' instead. %matplotlib inline %load_ext snakeviz import numpy as np from scipy.optimize import mi...
bmeaut/python_nlp_2017_fall
course_material/11_Machine_Translation/11_Machine_Translation_lab.ipynb
mit
import os import shutil import urllib import nltk def download_file(url, directory=''): real_dir = os.path.realpath(directory) if not os.path.isdir(real_dir): os.makedirs(real_dir) file_name = url.rsplit('/', 1)[-1] real_file = os.path.join(real_dir, file_name) if not os.path.isfile(...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_read_bem_surfaces.ipynb
bsd-3-clause
# Author: Jaakko Leppakangas <jaeilepp@gmail.com> # # License: BSD (3-clause) import os.path as op from mayavi import mlab import mne from mne.datasets.sample import data_path print(__doc__) data_path = data_path() fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(fname) ...
maelick/GitHub-Analysis
SANER2016/notebooks/CRAN Distribution of GitHub Packages.ipynb
gpl-2.0
import pandas from matplotlib import pyplot as plt %matplotlib inline from IPython.display import set_matplotlib_formats #set_matplotlib_formats('pdf') cran_release = pandas.DataFrame.from_csv('../data/cran-packages-150601.csv', index_col=None) data = pandas.DataFrame.from_csv('../data/github-cran-bioc-alldata-150420...
mxbu/logbook
blog-notebooks/optimization.ipynb
mit
import pandas as pd import numpy as np from math import sqrt import sys from bokeh.plotting import figure, show, ColumnDataSource, save from bokeh.models import Range1d, HoverTool from bokeh.io import output_notebook, output_file import quandl from gurobipy import * # output_notebook() #To enable Bokeh output in notebo...
tensorflow/docs-l10n
site/ja/lite/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...
darkrun95/Applied-Data-Science
Applied Machine Learning in Python/Week 2/Assignment2.ipynb
gpl-3.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split np.random.seed(0) n = 15 x = np.linspace(0,10,n) + np.random.randn(n)/5 y = np.sin(x)+x/6 + np.random.randn(n)/10 X_train, X_test, y_train, y_test = train_test_split(x, y, random_state=0) # Y...
ODZ-UJF-AV-CR/osciloskop
cerf.ipynb
gpl-3.0
import matplotlib.pyplot as plt import sys import os import time import h5py import numpy as np import glob import vxi11 # Step 0: # Connect oscilloscope via direct Ethernet link # Step 1: # Run "Record" on the oscilloscope # and wait for 508 frames to be acquired. # Step 2: # Run this cell to initialize grabbing. #...
ES-DOC/esdoc-jupyterhub
notebooks/snu/cmip6/models/sandbox-3/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'snu', 'sandbox-3', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: SNU Source ID: SANDBOX-3 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/3c_bqml_dnn_babyweight.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst %%bash pip freeze | grep google-cloud-bigquery==1.6.1 || \ pip install google-cloud-bigquery==1.6.1 """ Explanation: LAB 3c: BigQuery ML Model Deep Neural Network. Learning Objectives Create and evaluate DNN model with BigQuery ML. Create and evalua...
TheOregonian/long-term-care-db
notebooks/analysis/.ipynb_checkpoints/facilities-analysis-checkpoint.ipynb
mit
import pandas as pd import numpy as np from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) df = pd.read_csv('../../data/processed/facilities-3-29-scrape.csv') """ Explanation: This is a dataset of Assisted Living, Nursing and Residential Care facilities...
bayesimpact/bob-emploi
data_analysis/notebooks/datasets/rome/update_from_v329_to_v330.ipynb
gpl-3.0
import collections import glob import os from os import path import matplotlib_venn import pandas rome_path = path.join(os.getenv('DATA_FOLDER'), 'rome/csv') OLD_VERSION = '329' NEW_VERSION = '330' old_version_files = frozenset(glob.glob(rome_path + '/*{}*'.format(OLD_VERSION))) new_version_files = frozenset(glob.g...
numeristical/introspective
examples/SplineCalib_Multiclass_MNIST.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from sklearn.ensemble import RandomForestClassifier from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.metrics import roc_auc_score, log_loss from sklearn.metrics import accuracy_s...
DamienIrving/ocean-analysis
development/hfbasin.ipynb
mit
import matplotlib.pyplot as plt import iris import iris.plot as iplt import iris.coord_categorisation import cf_units import numpy %matplotlib inline infile = '/g/data/ua6/DRSv2/CMIP5/NorESM1-M/rcp85/mon/ocean/r1i1p1/hfbasin/latest/hfbasin_Omon_NorESM1-M_rcp85_r1i1p1_200601-210012.nc' cube = iris.load_cube(infile) ...
hydrosquall/tiingo-python
examples/basic-usage-with-pandas.ipynb
mit
TIINGO_API_KEY = 'REPLACE-THIS-TEXT-WITH-A-REAL-API-KEY' # This is here to remind you to change your API key. if not TIINGO_API_KEY or (TIINGO_API_KEY == 'REPLACE-THIS-TEXT-WITH-A-REAL-API-KEY'): raise Exception("Please provide a valid Tiingo API key!") from tiingo import TiingoClient config = { 'api_key': T...
GEMScienceTools/rmtk
notebooks/vulnerability/derivation_fragility/NLTHA_on_SDOF/2MSA_on_SDOF.ipynb
agpl-3.0
import numpy from rmtk.vulnerability.common import utils from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF import MSA_utils from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF.read_pinching_parameters import read_parameters from rmtk.vulnerability.derivation_fragility.NLTHA_on_SDOF import double_MSA_on_...
tensorflow/fairness-indicators
g3doc/tutorials/_Deprecated_Fairness_Indicators_Lineage_Case_Study.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...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Regular Expressions-checkpoint.ipynb
apache-2.0
import re # List of patterns to search for patterns = [ 'term1', 'term2' ] # Text to parse text = 'This is a string with term1, but it does not have the other term.' for pattern in patterns: print 'Searching for "%s" in: \n"%s"' % (pattern, text), #Check for match if re.search(pattern, text): ...
jfconavarrete/kaggle-facebook
notebooks/1.0-toni-preprocessing.ipynb
mit
train_X = train.values[:,:-1] train_t = train.values[:,-1] print train_X.shape print train_t.shape train.describe() train.head() train.tail() """ Explanation: The number of unique values is huge. This makes me think in a direction where we could center basis functions at the centers of discovered clusters. Discove...