repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
turbomanage/training-data-analyst | quests/endtoendml/labs/6_deploy.ipynb | apache-2.0 | # change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.environ['PROJECT'] = PROJECT
os.environ['REGION'] = REGION
os.environ['TFVERSION'] = '1.13'
%%bash
if ! gsutil ls | grep -q gs://${BUCKET}/bab... |
wcmckee/garrison-wow-track | garissonwow.ipynb | mit | import battlenet
import dominate
from dominate.tags import *
import json
import arrow
import requests
import datetime
from battlenet import Character
from battlenet import Realm
#Realm.to_json()
realm = Realm(battlenet.UNITED_STATES, "jubei'thos")
realm
print realm.is_online()
print realm.to_json()
rejs = js... |
enoordeh/StatisticalMethods | code/mc1_sandbox.ipynb | gpl-2.0 | import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import scipy.stats
%matplotlib inline
"""
Explanation: Metropolis Sandbox
This notebook is for playing with the Metropolis algorithm in the context of fitting a linear model. Tinker with how it works and see if you can make it... |
hannorein/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 ... |
ksooklall/deep_learning_foundation | autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
beangoben/HistoriaDatos_Higgs | Dia3/.ipynb_checkpoints/5_Machine_Learning_Intro-checkpoint.ipynb | gpl-2.0 | from IPython.core.display import HTML
import os
def css_styling():
"""Load default custom.css file from ipython profile"""
base = os.getcwd()
styles = "<style>\n%s\n</style>" % (open(os.path.join(base,'files/custom.css'),'r').read())
return HTML(styles)
css_styling()
"""
Explanation: <i class="fa fa-di... |
nteract/papermill | papermill/tests/notebooks/gcs/gcs_in/gcs-simple_notebook.ipynb | bsd-3-clause | a = 10
print(a)
"""
Explanation: Running Code
First and foremost, the Jupyter Notebook is an interactive environment for writing and running code. The notebook is capable of running code in a wide range of languages. However, each notebook is associated with a single kernel. This notebook is associated with the IPyt... |
qutip/qutip-notebooks | examples/nbv3format_copies/example-control-pulseoptim-CRAB-2qubitInerac.v3.ipynb | lgpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import datetime
from qutip import Qobj, identity, sigmax, sigmaz, tensor
import random
import qutip.logging_utils as logging
logger = logging.get_logger()
#Set this to None or logging.WARN for 'quiet' execution
log_level = logging.INFO
#QuTiP contro... |
wllmtrng/udacity_data_analyst_nanodegree | P2 Statistical Significance/P2_Analyzing_the_NYC_Subway_Dataset.ipynb | mit | df = pd.read_csv("./turnstile_weather_v2.csv")
df_rain = df[df['rain'] == 1]
df_no_rain = df[df['rain'] == 0]
df_rain_entries = df_rain.ENTRIESn_hourly
df_no_rain_entries = df_no_rain.ENTRIESn_hourly
gp.ggplot(gp.aes(x="ENTRIESn_hourly", fill='rain',color='rain'), data=df) +\
gp.geom_histogram(alpha=0.6, binwidt... |
oliverhuangchao/thunder | doc/source/tutorials/source/regression.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from thunder import Colorize
image = Colorize.image
tile = Colorize.tile
sns.set_context('notebook')
sns.set_style('darkgrid')
"""
Explanation: Regression
Linear regression is a simple and powerful tool for describing relationships between a res... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/expression.expansion.ipynb | gpl-3.0 | import vcsn
from IPython.display import Latex
def diffs(r, ss):
eqs = [r'd\left({0}\right) &= {1}'.format(r.format('latex'), r.expansion().format('latex')),
r'c\left({0}\right) &= {1}'.format(r.format('latex'), r.constant_term().format('latex'))]
for s in ss:
eqs.append(r'\frac{{\partial}}{{... |
ogaway/Game-Theory | StochasticEvolution/SimultaneousRevisions.ipynb | gpl-3.0 | %matplotlib inline
from scipy.stats import binom
import matplotlib.pyplot as plt
"""
Explanation: 同時改訂(simultaneous revisions)とは
「各 t 期において,N 人全員が行動を (変えたければ) 変えることができる.」
協調ゲーム (coordination game)
以下の利得表のもと各人は戦略をとる場合を考える。
[(4, 4), (0, 3)]
[(3, 0), (2, 2)]
混合戦略ナッシュ均衡の組は、
(1, 0), (1, 0)
(2/3, 1/3), (2/3, 1/3)
(0, 1)... |
GoogleCloudPlatform/documentai-notebooks | general/async_form_parser.ipynb | apache-2.0 | # Install necessary Python libraries and restart your kernel after.
!pip install -r ../requirements.txt
from google.cloud import documentai_v1beta3 as documentai
from google.cloud import storage
import os
import re
import pandas as pd
"""
Explanation: Document AI Form Parser (async)
This notebook shows you how to an... |
ethen8181/machine-learning | python/factory_pattern.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 to print version
# 2. magic so that the notebo... |
kuo77122/deep-learning-nd | Project1-First-Neural-Network/DLND Your first neural network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
vzg100/Post-Translational-Modification-Prediction | .ipynb_checkpoints/Phosphorylation Sequence Tests -Bagging -dbptm+ELM -EnzmeBenchmarks-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"]
benchmarks = ["Data/Benchmarks/phos_CDK1.csv", "Data/Benchmarks/phos_CK2.csv", "Data/B... |
jpzhangvincent/MobileAppMarketAnalysis | notebooks/patterns for the apps improving higher current version ratings comparing to overall ratings.ipynb | mit | index = ratio>0.05#get the index of ratio larger than 0.05
appfilter = app.loc[index]#filter the apps which number of current rating over number of overall rating larger than 0.1
#use histogram to show the range of current_rating-overall_rating
plt.hist(appfilter['current_rating']-appfilter['overall_rating'],bins = 2... |
jaidevd/inmantec_fdp | notebooks/day4/05_intro_keras.ipynb | mit | # simulate data
X, Y = backprop_make_classification()
plt.scatter(X[:, 0], X[:, 1], c=Y.argmax(1))
"""
Explanation: Getting started with the Keras Sequential model
The Sequential model is a linear stack of layers.
End of explanation
"""
model = Sequential()
model.add(Dense(3, input_dim=2)) # input layer is implicit
... |
quantopian/research_public | notebooks/lectures/Introduction_to_Pairs_Trading/answers/notebook.ipynb | apache-2.0 | # Useful Functions
def find_cointegrated_pairs(data):
n = data.shape[1]
score_matrix = np.zeros((n, n))
pvalue_matrix = np.ones((n, n))
keys = data.keys()
pairs = []
for i in range(n):
for j in range(i+1, n):
S1 = data[keys[i]]
S2 = data[keys[j]]
resul... |
uber/pyro | tutorial/source/forecasting_ii.ipynb | apache-2.0 | import math
import torch
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.contrib.examples.bart import load_bart_od
from pyro.contrib.forecast import ForecastingModel, Forecaster, eval_crps
from pyro.infer.reparam import LinearHMMReparam, StableReparam, SymmetricStableReparam
from ... |
janelia-flyem/neuroglancer | python/examples/jupyter-notebook-demo.ipynb | apache-2.0 | viewer = neuroglancer.Viewer()
"""
Explanation: Create a new (initially empty) viewer. This starts a webserver in a background thread, which serves a copy of the Neuroglancer client, and which also can serve local volume data and handles sending and receiving Neuroglancer state updates.
End of explanation
"""
viewe... |
mne-tools/mne-tools.github.io | 0.17/_downloads/e4c80995312cbf444f08bae49b269d8b/plot_parcellation.ipynb | bsd-3-clause | # Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
from surfer import Brain
import mne
subjects_dir = mne.datasets.sample.data_path() + '/subjects'
mne.datasets.fetch_hcp_mmp_parcellation(subjects_dir=subjects_dir,
verbose=True)
labels = mne.read_label... |
kingtaurus/cs224d | old_assignments/assignment2/part2-RNNLM.ipynb | mit | import sys, os
from numpy import *
from matplotlib.pyplot import *
%matplotlib inline
matplotlib.rcParams['savefig.dpi'] = 100
%load_ext autoreload
%autoreload 2
"""
Explanation: CS 224D Assignment #2
Part [2]: Recurrent Neural Networks
This notebook will provide starter code, testing snippets, and additional guidanc... |
lwcook/horsetail-matching | notebooks/Introduction.ipynb | mit | from horsetailmatching import UncertainParameter, UniformParameter, GaussianParameter, HorsetailMatching
from horsetailmatching.demoproblems import TP1
"""
Explanation: Horsetail matching is a method for optimizing under uncertainty.
We are looking to minimize a quantity of interest, q, which is a function of design ... |
elenduuche/deep-learning | intro-to-tensorflow/.ipynb_checkpoints/intro_to_tensorflow-checkpoint.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
VenkateshElango/One-shot-face-verification | Face-Verification-Siamese-Network.ipynb | mit | def createCompressedTwin(inputDim, normalStddev, biasMean, lambdaConv, lambdaDense):
'''
Builds a Siamese twin to be shared by the two inputs. A trimmed network architecture based on Koch et al. (2015).
@param: inputDim - shape of the input image
@param: normalStddev - standard deviation of the zero mean Gaussian ... |
vadim-ivlev/STUDY | handson-data-science-python/DataScience-Python3/PolynomialRegression.ipynb | mit | %matplotlib inline
from pylab import *
import numpy as np
np.random.seed(2)
pageSpeeds = np.random.normal(3.0, 1.0, 1000)
purchaseAmount = np.random.normal(50.0, 10.0, 1000) / pageSpeeds
scatter(pageSpeeds, purchaseAmount)
"""
Explanation: Polynomial Regression
What if your data doesn't look linear at all? Let's loo... |
rhiever/sklearn-benchmarks | notebooks/metalearning.ipynb | mit | # get best classifier for each dataset
from tqdm import tqdm
best_method = dict()
for i,(dataset, group_data) in enumerate(tqdm(data.groupby('dataset'))):
best_method[dataset] = group_data['classifier'][np.argmax(group_data['accuracy'])]
# print(best_method)
# make new dataset combining metafeatures and best met... |
mdenker/elephant | doc/tutorials/spade.ipynb | bsd-3-clause | import numpy as np
import quantities as pq
import neo
import elephant
import viziphant
np.random.seed(4542)
"""
Explanation: SPADE Tutorial
End of explanation
"""
spiketrains = elephant.spike_train_generation.compound_poisson_process(
rate=5*pq.Hz, A=[0]+[0.98]+[0]*8+[0.02], t_stop=10*pq.s)
len(spiketrains)
"""
... |
jonwright/ImageD11 | sandbox/weighted_kde/3DXRD diffractogram from filtered peaks.ipynb | gpl-2.0 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from ImageD11.columnfile import columnfile
from ImageD11 import weighted_kde as wkde
%matplotlib inline
plt.rcParams['figure.figsize'] = (6,4)
plt.rcParams['figure.dpi'] = 150
plt.rcParams['mathtext.fontset'] = 'cm'
plt.rcParams['font.size'] =... |
HarllanAndrye/nilmtk | docs/manual/user_guide/disaggregation_and_metrics.ipynb | apache-2.0 | from __future__ import print_function, division
import time
from matplotlib import rcParams
import matplotlib.pyplot as plt
%matplotlib inline
rcParams['figure.figsize'] = (13, 6)
plt.style.use('ggplot')
from nilmtk import DataSet, TimeFrame, MeterGroup, HDFDataStore
from nilmtk.disaggregate import CombinatorialOptimi... |
mercybenzaquen/foundations-homework | foundations_hw/05/Homework5_Graded.ipynb | mit | #my IPA key b577eb5b46ad4bec8ee159c89208e220
#base url http://api.nytimes.com/svc/books/{version}/lists
"""
Explanation: What books topped the Hardcover Fiction NYT best-sellers list on Mother's Day in 2009 and 2010? How about Father's Day?
End of explanation
"""
import requests
response = requests.get("http://api.n... |
KiraHG/pyscbwrapper | pyscbwrapper.ipynb | gpl-3.0 | !pip install -q pyscbwrapper
from pyscbwrapper import SCB
"""
Explanation: <a href="https://colab.research.google.com/github/kirajcg/pyscbwrapper/blob/master/pyscbwrapper.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Inledning
Vi vill konstruera e... |
google/fuzzbench | analysis/notebooks/ranking.ipynb | apache-2.0 | exp_snapshot_df.pivot_table(index='benchmark', columns='fuzzer', values='edges_covered', aggfunc='median')
"""
Explanation: Median Edge Coverage
End of explanation
"""
default_report_rank = data_utils.experiment_level_ranking(
exp_snapshot_df,
data_utils.benchmark_rank_by_mean,
data_utils.experiment_ra... |
DS-100/sp17-materials | sp17/labs/lab02/lab02.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
# These lines load the tests.
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('lab02.ok')
"""
Explanation: Lab 2
Due 11:59pm 01/27/2017 (Completion-based)
In this lab you will see some examples of some commonly used data wrangling tools in Python. In ... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_configuration.ipynb | bsd-3-clause | import os.path as op
import mne
from mne.datasets.sample import data_path
fname = op.join(data_path(), 'MEG', 'sample', 'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(fname).crop(0, 10)
original_level = mne.get_config('MNE_LOGGING_LEVEL', 'INFO')
"""
Explanation: Background information on configurations
This tut... |
vzg100/Post-Translational-Modification-Prediction | old/Phosphorylation Sequence Tests -MLP -dbptm+ELM -scalesTrain-VectorAvr.-phos_stripped.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"]
scale = [-1, "standard", "robust", "minmax", "max"]
for i in par:
for j in scale... |
wtgme/labeldoc2vec | docs/notebooks/word2vec.ipynb | lgpl-2.1 | # import modules & set up logging
import gensim, logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
sentences = [['first', 'sentence'], ['second', 'sentence']]
# train word2vec on the two sentences
model = gensim.models.Word2Vec(sentences, min_count=1)
"""
Explanation:... |
amueller/scipy-2017-sklearn | notebooks/20.Unsupervised_learning-Hierarchical_and_density-based_clustering_algorithms.ipynb | cc0-1.0 | from sklearn.datasets import load_iris
iris = load_iris()
X = iris.data[:, [2, 3]]
y = iris.target
n_samples, n_features = X.shape
plt.scatter(X[:, 0], X[:, 1], c=y);
"""
Explanation: Unsupervised learning: Hierarchical and density-based clustering algorithms
In a previous notebook, "08 Unsupervised Learning - Clust... |
manishbisht/Competitive-Programming | Algorithms/Array/02 Missing Number in array.ipynb | mit | data = [1, 2, 3, 4, 5, 6, 8]
def find_missing_number(data):
ans = ((len(data) + 1) * (len(data) + 2)) / 2
for x in data:
ans -= x
return ans
print find_missing_number(data)
"""
Explanation: Introduction
You are given a list of n-1 integers and these integers are in the range of 1 to n. There are ... |
juditacs/snippets | misc/argmax.ipynb | lgpl-3.0 | basket = [("apple", 12), ("pear", 3), ("plum", 14)]
max(basket, key=lambda pair: pair[1])
"""
Explanation: Computing argmax in Python
Which fruit is the most frequent in this basket?
End of explanation
"""
max(basket, key=lambda pair: pair[1])[0]
"""
Explanation: Returns a tuple, let's get its first element.
End of... |
mne-tools/mne-tools.github.io | 0.24/_downloads/98d9662291626be9c938eee7a8fcc9bd/sensor_noise_level.ipynb | bsd-3-clause | # Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import mne
data_path = mne.datasets.sample.data_path()
raw_erm = mne.io.read_raw_fif(op.join(data_path, 'MEG', 'sample',
'ernoise_raw.fif'), preload=True)
"""
Explanation: Show noise ... |
Naereen/notebooks | Using_Python_to_solve_Regexp_CrossWord_Puzzles.ipynb | mit | problem1 = {
"left_lines": [
r"HE|LL|O+", # HE|LL|O+ line 1
r"[PLEASE]+", # [PLEASE]+ line 2
],
"right_lines": None,
"top_columns": [
r"[^SPEAK]+", # [^SPEAK]+ column 1
r"EP|IP|EF", # EP|IP|EF column 2
],
"bottom_columns": None,
}
"""
Explanation: Usi... |
DoWhatILove/turtle | programming/python/notebooks/scikit/decomposition/plot_pca_vs_fa_model_selection.ipynb | mit | # Authors: Alexandre Gramfort
# Denis A. Engemann
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from scipy import linalg
from sklearn.decomposition import PCA, FactorAnalysis
from sklearn.covariance import ShrunkCovariance, LedoitWolf
from sklearn.model_selection import cross_val... |
CyberCRI/dataanalysis-herocoli-redmetrics | v1.52.2/Functions/Summary.ipynb | cc0-1.0 | %run "../Functions/8. RM-GF correlations.ipynb"
%run "../Functions/Plot.ipynb"
"""
Explanation: Hero.Coli Data Analysis Summary
Interactive list of readworthy results from Hero.Coli data analysis.
Table of Contents
Preparation
1. Google form analysis
2. Game sessions
3. Per session and per user analysis
4. User compar... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session14/Day3/Autoencoders.ipynb | mit | !pip install astronn
import torch
import matplotlib.pyplot as plt
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import IsolationForest
from astroNN.datasets import load_galaxy10
from astroNN.datasets.galaxy10 import galaxy10cls_lookup
"""
Explanation: Creating a Simple... |
mne-tools/mne-tools.github.io | 0.17/_downloads/6282ffffa1a074ca0a88e33605afaf0b/plot_object_evoked.ipynb | bsd-3-clause | import os.path as op
import mne
"""
Explanation: The :class:Evoked <mne.Evoked> data structure: evoked/averaged data
The :class:Evoked <mne.Evoked> data structure is mainly used for storing
averaged data over trials. In MNE the evoked objects are usually created by
averaging epochs data with :func:mne.Epo... |
PMEAL/OpenPNM-Examples | Simulations/advection_diffusion.ipynb | mit | import openpnm as op
net = op.network.Cubic(shape=[1, 10, 10], spacing=1e-4)
"""
Explanation: Summary
One of the main applications of OpenPNM is simulating transport phenomena such as Fickian diffusion, advection diffusion, reactive transport, etc. In this example, we will learn how to perform advection diffusion on a... |
codehacken/CodingProwess | Python/data_structures/Arrays-Strings.ipynb | mit | # With Hashmap.
# Time Complexity: O(n)
def if_unique(string):
chr_dict = {}
for char in string:
if char not in chr_dict:
chr_dict[char] = 1
else:
return False
return True
# Without additional memory.
# Time Complexity: O(n^2)
def if_unique_m(string):
for id... |
Hyperparticle/deep-learning-foundation | lessons/gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
heureuxchaquejour/Course_Project_of_Cryptography_HUST_2017 | code/rainbowTable.ipynb | bsd-2-clause | LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
LETTERS += LETTERS.lower()
LETTERS += '0123456789'
PASSWORDSIZE = 8
plainSpace = len(LETTERS) ** PASSWORDSIZE
CHAINLENGTH = 2 ** 20
COVERRATEESTIMATED = 0.99
# CHAINLENGTH = 10 ** 4
# COVERRATEESTIMATED = 0.9999
# plainSpace = 36 ** 6
alpha = CHAINLENGTH / plainSpace
def nextCo... |
zambzamb/zpic | zdf/zdf_view.ipynb | agpl-3.0 | import zdf
"""
Explanation: Accessing ZDF data files with Python
Access to ZDF data with Python requires importing the zdf module
End of explanation
"""
zdf.list("test/E1-000072.zdf", printRec = True)
"""
Explanation: You can list the contents of ZDF files using the list command:
End of explanation
"""
(data,info... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/00-Crash-Course-Topics/01-Crash-Course-Pandas/05-Operations.ipynb | apache-2.0 | import pandas as pd
df = pd.DataFrame({'col1':[1,2,3,4],'col2':[444,555,666,444],'col3':['abc','def','ghi','xyz']})
df.head()
"""
Explanation: <a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>
<center><em>Copyright Pierian Data</em></center>
<center><em>For more information, visit us at <... |
vascotenner/holoviews | doc/Examples/Earthquake_Visualization.ipynb | bsd-3-clause | basemap = Basemap()
kdims = ['Longitude', 'Latitude']
continents = hv.Polygons([poly.get_coords() for poly in basemap.landpolygons],
group='Continents', kdims=kdims)
countries = hv.Contours([np.array(country) for path in basemap._readboundarydata('countries')
for count... |
phanrahan/magmathon | notebooks/advanced/lut.ipynb | mit | import magma as m
m.set_mantle_target("ice40")
"""
Explanation: LUTs (Lookup Tables)
At the heart of an FPGA are lookup tables (LUTs).
The lattice ice40 series has 4-bit lookup tables.
Each table is configured with 16 single bit values,
and the output is selected with an input which is a 4-bit address.
This notebook ... |
dinrker/Algorithms_DataStructures | 00_strStr.ipynb | mit | # Corner case!!!
"" is None
class Solution:
def strStr(self, source, target):
# write your code here
if source is None or target is None:
return -1
m = len(source)
n = len(target)
for i in range(m-n+1):
j = 0
while j < n:
i... |
nproctor/phys202-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
"""
xt = np.arange(-5,6,1)
yt = np.zeros_like(xt)
yt.fill(5)
ft = np.zeros_like(xt)
yl = np.arange(-... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/machine_learning_in_the_enterprise/labs/intro_to_vertex_pipelines.ipynb | apache-2.0 | USER_FLAG = "--user"
"""
Explanation: Introduction to Vertex Pipelines
Learning Objectives
Use the Kubeflow Pipelines SDK to build scalable ML pipelines.
Create and run a 3-step intro pipeline that takes text input.
Introduction
In this notebook, you will learn how to create and run ML pipelines with Vertex Pipe... |
aidiary/notebooks | pytorch/180202-convolutional-neural-network.ipynb | mit | import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
# Hyperparameters
num_epochs = 10
batch_size = 100
learning_rate = 0.001
"""
Explanation: Convolutional Neural Network
https://github.com/yunjey/pytorch-tutorial/b... |
scikit-learn-contrib/hdbscan | notebooks/How HDBSCAN Works.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn.datasets as data
%matplotlib inline
sns.set_context('poster')
sns.set_style('white')
sns.set_color_codes()
plot_kwds = {'alpha' : 0.5, 's' : 80, 'linewidths':0}
"""
Explanation: How HDBSCAN Works
HDBSCAN is a clustering algorithm d... |
pysal/pysal | notebooks/explore/pointpats/process.ipynb | bsd-3-clause | from pysal.explore.pointpats import PoissonPointProcess, PoissonClusterPointProcess, Window, poly_from_bbox, PointPattern
import pysal.lib as ps
from pysal.lib.cg import shapely_ext
%matplotlib inline
import numpy as np
#import matplotlib.pyplot as plt
"""
Explanation: Point Processes
Author: Serge Rey sj... |
turnerbw/JNBinder | Floridas_Water_Budget.ipynb | mit | # Import modules that contain functions we need
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
# Our data is a table and is defined as the word 'data'.
# 'data' is set equal to the .csv file that is read by the pandas function.
# The .csv file must be in the same disrectory a... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/time_series_prediction/labs/4_modeling_keras.ipynb | apache-2.0 | import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from google.cloud import bigquery
from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard
from tensorflow.keras.layers import (
GRU,
LSTM,
RNN,
Bidirectional,
... |
ocefpaf/waves_and_tides_intro | images/fake_tides.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
from matplotlib import style
import matplotlib.pyplot as plt
style.use('ggplot')
def diurnal_tide(t, K1amp, K1phase, O1amp, O1phase, randamp):
out = K1amp * np.sin(2 * np.pi * t / 23.9344 - K1phase)
out += O1amp * np.sin(2 * np.pi * t / 25.8194 - O1phase)
out += rand... |
mne-tools/mne-tools.github.io | dev/_downloads/d2352ab4b72ce7d1dc05c76bda6ef71d/55_setting_eeg_reference.ipynb | bsd-3-clause | import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
raw.crop(tmax=60).load_data()
raw.pick(['EEG 0{:... |
physion/ovation-python | examples/verify-uploads.ipynb | gpl-3.0 | session = connect(input('Email: '), org=int(input("Organization (enter for default): ") or 0))
"""
Explanation: Connect
End of explanation
"""
parent_id = input('Parent UUID: ')
parent = get_entity(session, parent_id)
"""
Explanation: Walk directory
Starting with a parent directory or project...
End of explanation... |
n-witt/MachineLearningWithText_SS2017 | tutorials/1 Numpy.ipynb | gpl-3.0 | import numpy as np
"""
Explanation: Introduction to NumPy
numpy is a powerful set of tools to perform mathematical operations of on lists of numbers. It works faster than normal python lists operations and can manupilate high dimentional arrays too.
Additional material:
* Another tutorial
* Numpy Reference
Import NumP... |
hmc-cs-nsuaysom/BigDataProject | Average_RM_YIELD_location.ipynb | mit | location_map = list(set(TRAINING_DATA_GRAD["LOCATION"]))
location_map.sort()
# print(location_map)
list_location = []
list_avg_rm = []
list_avg_yield = []
for val in location_map:
avg_rm = np.average(TRAINING_DATA_GRAD[EXPERIMENT_DATA["LOCATION"] == str(val)]["RM"])
avg_yield = np.average(TRAINING_DATA_GRAD[EX... |
zoltanctoth/bigdata-training | python/Python basics.ipynb | gpl-2.0 | 1 + 1
12 * 44
Hello Data Skills!
'Hello Data Skills!'
print 'Hello Data Skills!'
print "Hello Data Skills!"
print 'Hello Data Skills!'
print """Hello Data Skills!"""
"""
Explanation: Python tutorial
Launch this notebook with:
1. Open terminal
2. type cd training/python
3. type ipython notebook
basics
End of expl... |
transcranial/keras-js | notebooks/layers/convolutional/UpSampling2D.ipynb | mit | data_in_shape = (3, 3, 3)
L = UpSampling2D(size=(2, 2), 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(250)
data_in = 2 * np.random.random(data_in_shape) - 1
res... |
crocha700/qg_vertical_modes | beta_eady_problem/wave_structure_fd.ipynb | mit | from __future__ import division
import numpy as np
from numpy import pi, sqrt,cos
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 25, 'legend.handlelength' : 1.25})
%matplotlib inline
import seaborn as sns
#sns.set(style="darkgrid")
sns.set_context("paper", font_scale=5, rc={"lines.linewidth": 1.5... |
cloudmesh/book | notebooks/opencv/secchi/data/secchi.ipynb | apache-2.0 | import os, sys
from os.path import expanduser
os.path
home = expanduser("~")
sys.path.append('/usr/local/Cellar/opencv/3.3.1_1/lib/python3.6/site-packages/')
sys.path.append(home + '/.pyenv/versions/OPENCV/lib/python3.6/site-packages/')
import cv2
cv2.__version__
! pip install numpy > tmp.log
! pip install matplotlib >... |
mdeff/ntds_2016 | project/reports/twitter_gender/NTDS_project.ipynb | mit | import pandas as pd
import numpy as np
from IPython.display import display
import re
#graph
from bokeh.plotting import output_notebook, figure, show
from bokeh.layouts import gridplot
from bokeh.models import ColumnDataSource
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams.update({'figure.max_open_wa... |
bigdata-i523/hid335 | experiment/Python-Pandas01-DataFrames.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: PANDAS
Module 1: Data Structure and Applications
pandas is an open source, BSD-licensed Python library providing fast, flexible, easy-to-use, data structures and data analysis tools for working with “relational”... |
quoniammm/happy-machine-learning | Udacity-ML/boston_housing-master_3/boston_housing.ipynb | mit | # Import libraries necessary for this project
# 载入此项目所需要的库
import numpy as np
import pandas as pd
import visuals as vs # Supplementary code
from sklearn.model_selection import ShuffleSplit
# Pretty display for notebooks
# 让结果在notebook中显示
%matplotlib inline
# Load the Boston housing dataset
# 载入波士顿房屋的数据集
data = pd.rea... |
rasbt/algorithms_in_ipython_notebooks | ipython_nbs/efficiency/greatest-common-divisor.ipynb | gpl-3.0 | def naive_gcd(a, b):
gcd = 0
if a < b:
n = a
else:
n = a
for d in range(1, n + 1):
if not a % d and not b % d:
gcd = d
return gcd
print('In: 1/1,', 'Out:', naive_gcd(1, 1))
print('In: 1/2,', 'Out:', naive_gcd(1, 2))
print('In: 3/9,', 'Out:', naive_gcd(3, 9))
prin... |
emiliom/stuff | odm2api_sample_fromsqlite-OLD.ipynb | cc0-1.0 | %matplotlib inline
import sys
import os
import matplotlib.pyplot as plt
from matplotlib import dates
from odm2api.ODMconnection import dbconnection
from odm2api.ODM2.services.readService import *
# Create a connection to the ODM2 database
# ----------------------------------------
odm2db_fpth = '/home/mayorga/Desktop... |
tbarrongh/cosc-learning-labs | src/notebook/05_acl_list.ipynb | apache-2.0 | help('learning_lab.05_acl_list')
"""
Explanation: COSC Learning Lab
05_acl_list.py
Related Scripts:
* 03_interface_names.py
* 03_interface_properties.py
* 03_interface_configuration.py
Table of Contents
Table of Contents
Documentation
Implementation
Execution
HTTP
Documentation
End of explanation
"""
from importli... |
aroberge/notebooks-fr | Les matrices numpy.ipynb | cc0-1.0 | import numpy as np # Presque tous les programmeurs utilisent l'abbréviation np
ma_liste = [1, 2, 3, 4, 5]
array1 = np.array(ma_liste)
print("ma liste:", ma_liste)
print("objet numpy: ", array1)
"""
Explanation: Les matrices numpy (numpy arrays)
Vous êtes familiers avec les listes en Python. Les "arrays" de numpy ... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/tensorflow_extended/solutions/components_keras.ipynb | apache-2.0 | import sys
if 'google.colab' in sys.modules:
!pip install --upgrade pip
"""
Explanation: Interacting with TFX Keras Components
This notebook will interactively walk through each built-in component of TensorFlow Extended (TFX).
It covers every step in an end-to-end machine learning pipeline, from data ingestion to pu... |
LSSTDESC/LSSTDarkMatter | macho/LSST MACHO MAF Hack.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
# import lsst sims maf modules
import lsst.sims.maf
import lsst.sims.maf.db as db
import lsst.sims.maf.metrics as lsst_metrics
import lsst.sims.maf.slicers as slicers
import lsst.sims.maf.stackers as stackers
import lsst.sims.maf.plots as plots
import lsst.sims.maf.me... |
tensorflow/docs-l10n | site/zh-cn/io/tutorials/prometheus.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... |
awhite40/pymks | notebooks/elasticity_2D.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
n = 21
from pymks.tools import draw_microstructures
from pymks.datasets import make_delta_microstructures
X_delta = make_delta_microstructures(n_phases=2, size=(n, n))
draw_microstructures(X_delta)
"""
Explan... |
alfkjartan/control-computarizado | state-space/notebooks/Sampling-continuous-time-state-space.ipynb | mit | A = np.array([[2, -2], [1, 0]])
B = np.array([[1],[0]])
C = np.array([[0,1]])
D = np.array([[0]])
As = sy.Matrix(A)
Bs = sy.Matrix(B)
Cs = sy.Matrix(C)
l1,l2 = sy.symbols("l1 l2")
L = sy.Matrix([[l1, l2]])
Ac = A+B*L
pc = Ac.eigenvals()
pc
l1l2 = sy.solve([l1/2+1+2, l1**2+4*l1+4*l2-4 + 4], (l1,l2))
L = np.array([flo... |
trangel/Data-Science | .ipynb_checkpoints/seeds-sciki-mfeatures-checkpoint.ipynb | gpl-3.0 | print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.datasets import load_digits
from sklearn.model_selection import learning_curve
from sklearn.model_selection import ShuffleSplit
def plot_learning_curve(estimator, titl... |
mne-tools/mne-tools.github.io | stable/_downloads/1b3716673f2aeae3f2b0c6c336812aba/80_fix_bem_in_blender.ipynb | bsd-3-clause | # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Ezequiel Mikulan <e.mikulan@gmail.com>
# Manorama Kadwani <manorama.kadwani@gmail.com>
#
# License: BSD-3-Clause
import os
import os.path as op
import shutil
import mne
data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data_path... |
InsightLab/data-science-cookbook | 2019/12-spark/14-spark-mllib-classification/mllibClass_OtacilioBezerra.ipynb | mit | from pyspark.ml.classification import LogisticRegression
from pyspark.ml.evaluation import RegressionEvaluator, MulticlassClassificationEvaluator
from pyspark.ml import Pipeline
from pyspark.mllib.regression import LabeledPoint
from pyspark.ml.linalg import Vectors
from pyspark.ml.feature import StringIndexer
from pysp... |
ES-DOC/esdoc-jupyterhub | notebooks/cas/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cas', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CAS
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties: 6... |
planetlabs/notebooks | jupyter-notebooks/analysis-ready-data/ard_2_use_case_1.ipynb | apache-2.0 | from copy import copy
import datetime
import os
from pathlib import Path
from pprint import pprint
import shutil
import time
from zipfile import ZipFile
import numpy as np
from planet import api
from planet.api import downloader, filters
"""
Explanation: Analysis Ready Data Tutorial Part 2: Use Case 1
Time-series ana... |
maojrs/riemann_book | Shallow_water_approximate.ipynb | bsd-3-clause | %matplotlib inline
%config InlineBackend.figure_format = 'svg'
import numpy as np
import matplotlib.pyplot as plt
from exact_solvers import shallow_water as sw
from utils import riemann_tools as rt
from ipywidgets import interact
from ipywidgets import widgets
def shallow_water_roe(q_l, q_r, grav=1.):
"""
Ap... |
mne-tools/mne-tools.github.io | 0.13/_downloads/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... |
Alexoner/mooc | cs231n/2016/assignment2/Dropout.ipynb | apache-2.0 | # As usual, a bit of setup
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.solver import Solver
%matplotlib inline
... |
bambinos/bambi | docs/notebooks/beta_regression.ipynb | mit | import arviz as az
import bambi as bmb
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
from scipy.special import expit
az.style.use("arviz-darkgrid")
"""
Explanation: Beta Regression
This example has been contributed by Tyler James Burch (\@tjburch on GitHub).
End of exp... |
metpy/MetPy | v0.4/_downloads/Find_Natural_Neighbors_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import Delaunay
from metpy.gridding.triangles import find_natural_neighbors
# Create test observations, test points, and plot the triangulation and points.
gx, gy = np.meshgrid(np.arange(0, 20, 4), np.arange(0, 20, 4))
pts = np.vstack([gx.ravel(), ... |
ShorensteinCenter/Shorenstein-Center-Notebooks | Shorenstein_Center_Notebook_1.ipynb | mit | # this is a comment
# comments are used throughout this notebook to explain what is happening in each cell
# this is a cell
# the In [] to the left stands for input
# when you click inside the cell it will turn green and you can edit the code
# run the cells in this notebook in order by pressing shift + enter
# you ... |
maartenbreddels/ipyvolume | docs/source/examples/bqplot.ipynb | mit | import numpy as np
import vaex
ds = vaex.example()
N = 2000 # for performance reasons we only do a subset
x, y, z, vx, vy, vz, Lz, E = [ds.columns[k][:N] for k in "x y z vx vy vz Lz E".split()]
"""
Explanation: ipyvolume & bqplot
This example shows how the selection from a ipyvolume quiver plot can be controlled with... |
roebius/deeplearning_keras2 | nbs2/meanshift.ipynb | apache-2.0 | %matplotlib inline
import math, numpy as np, matplotlib.pyplot as plt, operator, torch
"""
Explanation: Clustering
Clustering techniques are unsupervised learning algorithms that try to group unlabelled data into "clusters", using the (typically spatial) structure of the data itself.
The easiest way to demonstrate how... |
flaviocordova/udacity_deep_learn_project | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
temmeand/scikit-rf | doc/source/examples/metrology/Measuring a Mutiport Device with a 2-Port Network Analyzer.ipynb | bsd-3-clause | import skrf as rf
from itertools import combinations
%matplotlib inline
from pylab import *
rf.stylely()
"""
Explanation: Measuring a Multiport Device with a 2-Port Network Analyzer
Introduction
In microwave measurements, one commonly needs to measure a n-port device with a m-port network analyzer ($m<n$ of course). ... |
danresende/deep-learning | sentiment_network/.ipynb_checkpoints/Sentiment Classification - Mini Project 3-checkpoint.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.