repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
catalyst-cooperative/pudl | notebooks/work-in-progress/CEMS_by_utility.ipynb | mit | # Standard libraries
import logging
import os
import pathlib
import sys
# 3rd party libraries
import geopandas as gpd
import geoplot as gplt
import dask.dataframe as dd
from dask.distributed import Client
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import pandas as pd
import seaborn as ... |
pacificclimate/climate-explorer-netcdf-tests | notebooks/storage-requirements.ipynb | gpl-3.0 | import sys
sys.path.append('../util')
import numpy as np
from matplotlib import pyplot as plt, ticker
import matplotlib.patheffects as path_effects
from mpl_toolkits.mplot3d import Axes3D
pe = [path_effects.Stroke(linewidth=2, foreground='black'), path_effects.Normal()]
timescales = {
# Number of time steps in ... |
PMEAL/OpenPNM | examples/getting_started/intro_to_openpnm_basic.ipynb | mit | foo = dict() # Create an empty dict
foo['bar'] = 1 # Store an integer under the key 'bar'
print(foo['bar']) # Retrieve the integer stored in 'bar'
"""
Explanation: Tutorial 1 - Basic
Tutorial 1 of 3: Getting Started with OpenPNM
This tutorial is intended to show the basic outline of how OpenPNM works, and ... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/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', 'nerc', 'sandbox-3', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-3
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radi... |
AllenDowney/ThinkBayes2 | examples/normal.ipynb | mit | # If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
# Get utils.py and create directories
import os
if not os.path.exists('utils.py'):
!wget https://github.com/AllenDowney/Th... |
mne-tools/mne-tools.github.io | 0.17/_downloads/78709b76a2a2e07e4ff056048455fb17/plot_objects_from_arrays.ipynb | bsd-3-clause | # Author: Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
import numpy as np
import neo
import mne
print(__doc__)
"""
Explanation: Creating MNE objects from data arrays
In this simple example, the creation of MNE objects from
numpy arrays is demonstrated. In the last example case, a
NEO fil... |
peastman/deepchem | examples/tutorials/Modeling_Protein_Ligand_Interactions_With_Atomic_Convolutions.ipynb | mit | !curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import conda_installer
conda_installer.install()
!/root/miniconda/bin/conda info -e
!/root/miniconda/bin/conda install -c conda-forge mdtraj -y -q # needed for AtomicConvs
!pip install --pre deepchem
impo... |
amueller/advanced_training | 01.2 Linear models.ipynb | bsd-2-clause | from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
X, y, true_coefficient = make_regression(n_samples=80, n_features=30, n_informative=10, noise=100, coef=True, random_state=5)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=5)
print(X_train.shape)
... |
Becksteinlab/PSAnalysisTutorial | psa_identifier_example.ipynb | gpl-3.0 | %matplotlib inline
%load_ext autoreload
%autoreload 2
# Suppress FutureWarning about element-wise comparison to None
# Occurs when calling PSA plotting functions
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: Using PairID to extract PSA data
Here we will use the convenience class PSAIdentifier to ... |
Chipe1/aima-python | logic.ipynb | mit | from utils import *
from logic import *
from notebook import psource
"""
Explanation: Logic
This Jupyter notebook acts as supporting material for topics covered in Chapter 6 Logical Agents, Chapter 7 First-Order Logic and Chapter 8 Inference in First-Order Logic of the book Artificial Intelligence: A Modern Approach. ... |
mjabri/holoviews | doc/Tutorials/Containers.ipynb | bsd-3-clause | import numpy as np
import holoviews as hv
%reload_ext holoviews.ipython
"""
Explanation: This notebook serves as a reference for all the container types in HoloViews, with an extensive list of small, self-contained examples wherever possible, allowing each container type to be understood and tested independently. The ... |
fullmetalfelix/ML-CSC-tutorial | tSNE.ipynb | gpl-3.0 | from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import numpy
import pickle
from dscribe.descriptors import MBTR
from visualise import view
"""
Explanation: t-distributed Stochastic Neighbour Embedding
t-SNE is a nonlinear dimensionality reduction technique for high-dimensional data.
More info in the ... |
d00d/quantNotebooks | Notebooks/quantopian_research_public/notebooks/lectures/The_Dangers_of_Overfitting/notebook.ipynb | unlicense | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import statsmodels.api as sm
from statsmodels import regression
from scipy import poly1d
x = np.arange(10)
y = 2*np.random.randn(10) + x**2
xs = np.linspace(-0.25, 9.25, 200)
lin = np.polyfit(x, y, 1)
quad = np.polyfit(x, y, 2)
many = np.polyfit(x... |
xpharry/Udacity-DLFoudation | tutorials/sentiment_network/.ipynb_checkpoints/Sentiment Classification - How to Best Frame a Problem for a Neural Network-checkpoint.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r')
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r')
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()
"""
Explanation: Introduction
Hi, my n... |
fedjo/thesis | project/aat/object_detection/object_detection_tutorial.ipynb | apache-2.0 | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
"""
Explanation: Object Detection Demo
Welcome to the object detection ... |
jrg365/gpytorch | examples/02_Scalable_Exact_GPs/KISSGP_Regression.ipynb | mit | import math
import torch
import gpytorch
from matplotlib import pyplot as plt
# Make plots inline
%matplotlib inline
"""
Explanation: Structured Kernel Interpollation (SKI/KISS-GP)
Overview
SKI (or KISS-GP) is a great way to scale a GP up to very large datasets (100,000+ data points).
Kernel interpolation for scalabl... |
nadvamir/deep-learning | transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/TODO/GAN/cycle-gan/CycleGAN_Exercise.ipynb | apache-2.0 | # loading in and transforming data
import os
import torch
from torch.utils.data import DataLoader
import torchvision
import torchvision.datasets as datasets
import torchvision.transforms as transforms
# visualizing data
import matplotlib.pyplot as plt
import numpy as np
import warnings
%matplotlib inline
"""
Explana... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/sandbox-3/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-3', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MOHC
Source ID: SANDBOX-3
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
manipopopo/tensorflow | tensorflow/contrib/eager/python/examples/nmt_with_attention/nmt_with_attention.ipynb | apache-2.0 | from __future__ import absolute_import, division, print_function
# Import TensorFlow >= 1.10 and enable eager execution
import tensorflow as tf
tf.enable_eager_execution()
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import unicodedata
import re
import numpy as np
import os
i... |
mne-tools/mne-tools.github.io | 0.18/_downloads/f51d54a1c1f3584f45318492102672d3/plot_creating_data_structures.ipynb | bsd-3-clause | import mne
import numpy as np
"""
Explanation: Creating MNE's data structures from scratch
MNE provides mechanisms for creating various core objects directly from
NumPy arrays.
End of explanation
"""
# Create some dummy metadata
n_channels = 32
sampling_rate = 200
info = mne.create_info(n_channels, sampling_rate)
pr... |
tbarrongh/cosc-learning-labs | src/notebook/03_interface_configuration.ipynb | apache-2.0 | help('learning_lab.03_interface_configuration')
"""
Explanation: COSC Learning Lab
03_interface_configuration.py
Related Scripts:
* 03_interface_names.py
* 03_interface_properties.py
* 03_interface_configuration_update.py
Table of Contents
Table of Contents
Documentation
Implementation
Execution
HTTP
Documentation
E... |
nwjs/chromium.src | third_party/tensorflow-text/src/docs/tutorials/text_generation.ipynb | bsd-3-clause | #@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... |
planetlabs/notebooks | jupyter-notebooks/proserve-interactive-trainings/data-API.ipynb | apache-2.0 | import os
import json
import requests
PLANET_API_KEY = os.getenv('PL_API_KEY')
# Setup Planet Data API base URL
URL = "https://api.planet.com/data/v1"
# Setup the session
session = requests.Session()
# Authenticate
session.auth = (PLANET_API_KEY, "")
res = session.get(URL)
res.status_code
# Helper function to pri... |
whitead/numerical_stats | unit_9/lectures/lecture_2.ipynb | gpl-3.0 | import random
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, pi, erf
import scipy.stats
import numpy.linalg
"""
Explanation: Linear Algebra in NumPy
Unit 9, Lecture 2
Numerical Methods and Statistics
Prof. Andrew White, March 30, 2020
End of explanation
"""
matrix = [ [4,3], [6, 2] ]
prin... |
quantopian/research_public | notebooks/lectures/Introduction_to_Futures/notebook.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Introduction to Futures Contracts
by Maxwell Margenot and Delaney Mackenzie
Part of the Quantopian Lecture Series:
www.quantopian.com/lectures
github.com/quantopian/research_public
Futures contracts are derivatives and they are ... |
gpotter2/scapy | doc/notebooks/Scapy in 15 minutes.ipynb | gpl-2.0 | send(IP(dst="1.2.3.4")/TCP(dport=502, options=[("MSS", 0)]))
"""
Explanation: Scapy in 15 minutes (or longer)
Guillaume Valadon & Pierre Lalet
Scapy is a powerful Python-based interactive packet manipulation program and library. It can be used to forge or decode packets for a wide number of protocols, send them on the... |
magwenelab/mini-term-2016 | ode-modeling1.ipynb | cc0-1.0 | # import statements to make numeric and plotting functions available
%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
## define your function in this cell
def hill_activating(X, B, K, n):
f = (B * X**n)/(K**n + X**n)
return f
## generate a plot using your hill_activating function define... |
wanderer2/pymc3 | docs/source/notebooks/GLM-robust-with-outlier-detection.ipynb | apache-2.0 | %matplotlib inline
%qtconsole --colors=linux
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import optimize
import pymc3 as pm
import theano as thno
import theano.tensor as T
# configure some basic options
sn... |
miykael/nipype_tutorial | notebooks/advanced_aws.ipynb | bsd-3-clause | from nipype.interfaces.io import DataSink
ds = DataSink()
ds.inputs.base_directory = 's3://mybucket/path/to/output/dir'
"""
Explanation: Using Nipype with Amazon Web Services (AWS)
Several groups have been successfully using Nipype on AWS. This procedure
involves setting a temporary cluster using StarCluster and poten... |
limu007/TPX | ExperimentEval.ipynb | mit | x=np.r_[-3:3:20j]
sigy=3.
tres=[0.5,0.2,7,-0.5,0] #skutecne parametry
ytrue=np.polyval(tres,x)
pl.plot(x,ytrue,'k')
y=ytrue+np.random.normal(0,sigy,size=x.shape)
pl.plot(x,y,'*')
"""
Explanation: <footer id="attribution" style="float:right; color:#999; background:#fff;">
Sitola seminar 2019</footer>
Variance decompos... |
nwjs/chromium.src | third_party/tensorflow-text/src/docs/guide/bert_preprocessing_guide.ipynb | bsd-3-clause | #@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... |
blanton144/exex | docs/notebooks/images.ipynb | bsd-3-clause | A1, A2 = 10, 1
sig1 = 1.
sig2 = 2.47 * sig1
xc, yc = 13.3, 14.1 #real center
a = 2 * np.sqrt(2 * np.log(2)) # a ~ 2.4
FWHM1, FWHM2 = a * sig1, a * sig2
dx, dy = 1, 1 #dx,dy<=sqrt(2*np.log(2))*sig1~1.2
x = np.arange(0, 30., dx)
y = np.arange(0.,30., dy)
xx, yy = np.meshgrid(x, y) #xx,yy=i,j
Nx = len(x)
Ny = len(... |
rubensfernando/mba-analytics-big-data | Python/2016-08-08/aula7-parte5-er.ipynb | mit | import re
texto = 'um exemplo palavra:python!!'
match = re.search('python', texto)
print(match)
if match:
print('encontrou: ' + match.group())
else:
print('não encontrou')
"""
Explanation: Expressão Regular
Pesquisando
End of explanation
"""
texto = "GGATCGGAGCGGATGCC"
match = re.search(r'a[tg]c', texto... |
robotcator/gensim | docs/notebooks/sklearn_wrapper.ipynb | lgpl-2.1 | from gensim.sklearn_integration.sklearn_wrapper_gensim_ldamodel import SklearnWrapperLdaModel
"""
Explanation: Using wrappers for Scikit learn API
This tutorial is about using gensim models as a part of your scikit learn workflow with the help of wrappers found at gensim.sklearn_integration
The wrapper available (as o... |
schaber/deep-learning | 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... |
johnhw/summerschool2016 | unsupervised_image_learning/manifold_2.ipynb | mit | import numpy as np
import sklearn.datasets, sklearn.linear_model, sklearn.neighbors
import sklearn.manifold, sklearn.cluster
import matplotlib.pyplot as plt
import seaborn as sns
import sys, os, time
import scipy.io.wavfile, scipy.signal
import cv2
%matplotlib inline
import matplotlib as mpl
mpl.rcParams['figure.figsiz... |
bumblebeefr/poppy_rate | [remote] Webservice REST.ipynb | gpl-2.0 | #imports and initilaize virutal poppy using vrep
from pypot.vrep import from_vrep
from poppy.creatures import PoppyHumanoid
robot = PoppyHumanoid(simulator='vrep')
#import and initialize physical poppy
from poppy.creatures import PoppyHumanoid
robot = PoppyHumanoid()
from pypot.server import HTTPRobotServer
server = ... |
csadorf/signac | doc/signac_102_Exploring_Data.ipynb | bsd-3-clause | import signac
project = signac.get_project('projects/tutorial')
"""
Explanation: 1.2 Exploring Data
Finding jobs
In section one of this tutorial, we evaluated the ideal gas equation and stored the results in the job document and in a file called V.txt.
Let's now have a look at how we can explore our data space for bas... |
dadavidson/Python_Lab | Complete-Python-Bootcamp/Strings.ipynb | mit | # Single word
'hello'
# Entire phrase
'This is also a string'
# We can also use double quote
"String built with double quotes"
# Be careful with quotes!
' I'm using single quotes, but will create an error'
"""
Explanation: Strings
Strings are used in Python to record text information, such as name. Strings in Pyth... |
molgor/spystats | notebooks/Sandboxes/Sketches_for_geopystats.ipynb | bsd-2-clause | from external_plugins.spystats import tools
%run ../HEC_runs/fit_fia_logbiomass_logspp_GLS.py
from external_plugins.spystats import tools
hx = np.linspace(0,800000,100)
"""
Explanation: Sketches for automating spatial models
This notebook is for designing the tool box and methods for fitting spatial data.
I´m using ... |
ethen8181/machine-learning | model_deployment/fastapi_kubernetes/tree_model_deployment.ipynb | mit | # 1. magic for inline plot
# 2. magic to print version
# 3. magic so that the notebook will reload external python modules
# 4. magic to enable retina (high resolution) plots
# https://gist.github.com/minrk/3301035
%matplotlib inline
%load_ext watermark
%load_ext autoreload
%autoreload 2
%config InlineBackend.figure_fo... |
ryan-leung/PHYS4650_Python_Tutorial | notebooks/05-Python-Functions-Class.ipynb | bsd-3-clause | def hello(a,b):
return a+b
# Lazy definition of function
hello(1,1)
hello('a','b')
"""
Explanation: Python Functions and Classes
Sometimes you need to define your own functions to work with custom data or solve some problems. A function can be defined with a prefix def. A class is like an umbrella that can conta... |
shoyer/qspectra | examples/HEOM vs Redfield vs ZOFE.ipynb | bsd-2-clause | import qspectra as qs
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Parameters of the electronic Hamiltonian
ham = qs.ElectronicHamiltonian(np.array([[12881., 120.], [120., 12719.]]),
bath=qs.DebyeBath(qs.CM_K * 77., 35., 106.),
di... |
lemonyhermit/CodingYoga | python-for-developers/Chapter2/Chapter2_Syntax.ipynb | gpl-2.0 | #!/usr/bin/env python
# A code line that shows the result of 7 times 3
print 7 * 3
"""
Explanation: Python for Developers
First edition
Chapter 2: Syntax
A program written in Python consists of lines, which may continue on the following lines, by using the backslash character (\) at the end of the line or parenthese... |
monicathieu/cu-psych-r-tutorial | content/tutorials/python/2-datacleaning/.ipynb_checkpoints/index-checkpoint.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context("poster")
sns.set(style="ticks",font="Arial",font_scale=2)
"""
Explanation: title: "Data Cleaning in Python"
subtitle: "CU Psych Scientific Computing Workshop"
weight: 1201
tags: ["core", "python"]
Goals of t... |
phuongxuanpham/SelfDrivingCar | CarND-TensorFlow-Lab/lab.ipynb | gpl-3.0 | 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... |
ThierryMondeel/FBA_python_tutorial | FBA_tutorials/extra_exploring_ecoli_core.ipynb | mit | import cobra
from cobra.flux_analysis import pfba
import pandas as pd # for nice tables
pd.set_option('display.max_colwidth', -1)
from utils import show_map
import escher
map_loc = './maps/e_coli_core.Core metabolism.json' # the escher map used below
from IPython.core.interactiveshell import InteractiveShell
Interact... |
cuttlefishh/emp | code/04-subsets-prevalence/matches_deblur_to_gg_silva.ipynb | bsd-3-clause | !source activate qiime
import re
import sys
"""
Explanation: author: jonsan@gmail.com<br>
date: 9 Oct 2017<br>
language: Python 3.5<br>
license: BSD3<br>
matches_deblur_to_gg_silva.ipynb
End of explanation
"""
def fix_silva(silva_fp, output_fp):
with open(output_fp, 'w') as f_o:
with open(silva_fp, 'r') ... |
transcranial/keras-js | notebooks/layers/convolutional/UpSampling1D.ipynb | mit | data_in_shape = (3, 5)
L = UpSampling1D(size=2)
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(230)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in... |
karlstroetmann/Formal-Languages | ANTLR4-Python/Interpreter/Interpreter.ipynb | gpl-2.0 | !type Pure.g4
!cat -n Pure.g4
"""
Explanation: An Interpreter for a Simple Programming Language
$\neg$, $\wedge$, $\vee$
In this notebook we develop an interpreter for a small programming language.
The grammar for this language is stored in the file Pure.g4.
End of explanation
"""
!type sum.sl
!cat sum.sl
"""
Ex... |
makism/dyfunconn | tutorials/EEG - 0 - Retrieve and parse.ipynb | bsd-3-clause | import numpy as np
import pyedflib # please check the "requirements.txt" file
import tqdm
import pathlib
import os
"""
Explanation: Go through all subjects from the dataset, read the EDF files and store them into NumPy arrays.
Notes
In addition to the module's dependacies, please consult the file requirements.txt fo... |
kit-cel/wt | nt1/vorlesung/1_quellencodierung/Uniform_Quantization_Sine.ipynb | gpl-2.0 | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
# plotting options
font = {'size' : 20}
plt.rc('font', **font)
plt.rc('text', usetex=matplotlib.checkdep_usetex(True))
matplotlib.rc('figure', figsize=(18, 6) )
"""
Explanation: Illustration of Uniform Quantization
This code i... |
mrustl/flopy | examples/Notebooks/flopy3_swi2package_ex1.ipynb | bsd-3-clause | %matplotlib inline
import os
import platform
import numpy as np
import matplotlib.pyplot as plt
import flopy.modflow as mf
import flopy.utils as fu
import flopy.plot as fp
"""
Explanation: FloPy
SWI2 Example 1. Rotating Interface
This example problem is the first example problem in the SWI2 documentation (http://pubs... |
Hugovdberg/timml | notebooks/timml_notebook4_sol.ipynb | mit | %matplotlib inline
import numpy as np
from timml import *
figsize = (6, 6)
z = [20, 15, 10, 8, 6, 5.5, 5.2, 4.8, 4.4, 4, 2, 0]
ml = Model3D(kaq=10, z=z, kzoverkh=0.1)
ls1 = LineSinkDitch(ml, x1=-100, y1=0, x2=100, y2=0, Qls=10000, order=5, layers=6)
ls2 = HeadLineSinkString(ml, [(200, -1000), (200, -200), (200, 0), (2... |
google/applied-machine-learning-intensive | content/05_deep_learning/01_recurrent_neural_networks/colab.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... |
jasonkitbaby/udacity-homework | student_intervention/student_intervention.ipynb | apache-2.0 | # 载入所需要的库
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics import f1_score
# 载入学生数据集
student_data = pd.read_csv("student-data.csv")
print "Student data read successfully!"
"""
Explanation: 机器学习工程师纳米学位
监督学习
项目 2: 搭建一个学生干预系统
欢迎来到机器学习工程师纳米学位的第二个项目!在此文件中,有些示例代码已经提供给你,但你还需要实现更多的功能让项目成功运行。除... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_stats_cluster_time_frequency.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: N... |
zhuanxuhit/deep-learning | autoencoder/Simple_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)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
weikang9009/pysal | tools/gitcount-tables.ipynb | bsd-3-clause | from __future__ import print_function
import os
import json
import re
import sys
import pandas
import subprocess
from subprocess import check_output
#import yaml
from datetime import datetime, timedelta
from dateutil.parser import parse
import pytz
utc=pytz.UTC
from datetime import datetime, timedelta
from time imp... |
tbrx/compiled-inference | notebooks/Linear-Regression.ipynb | gpl-3.0 | import numpy as np
import torch
from torch.autograd import Variable
import sys, inspect
sys.path.insert(0, '..')
%matplotlib inline
import pymc
import matplotlib.pyplot as plt
from learn_smc_proposals import cde
from learn_smc_proposals.utils import systematic_resample
import seaborn as sns
sns.set_context("notebook... |
f-guitart/data_mining | notes/01 - Apache Spark Introduction.ipynb | gpl-3.0 | import pyspark
sc = pyspark.SparkContext(appName="my_spark_app")
sc
"""
Explanation: Using Apache Spark
Spark applications run as independent sets of processes on a cluster, coordinated by the SparkContext object in your main program (called the driver program).
SparkContext allocate resources across applications.
... |
oditorium/blog | iPython/MonteCarlo2-Cholesky.ipynb | agpl-3.0 | import numpy as np
d = 4
R = np.random.uniform(-1,1,(d,d))+np.eye(d)
C = np.dot(R.T, R)
#C, sort(eigvalsh(C))[::-1]
"""
Explanation: iPython Cookbook - Monte Carlo II
Generating a Monte Carlo vector using Cholesky Decomposition
Theory
Before we go into the implementation, a bit of theory on Monte Carlo and linear a... |
ratt-ru/bullseye | writing_and_wiki/notebooks/Error relations.ipynb | gpl-2.0 | %install_ext https://raw.githubusercontent.com/mkrphys/ipython-tikzmagic/master/tikzmagic.py
%load_ext tikzmagic
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Setup
End of explanation
"""
%%tikz --scale 2 --size 600,600 -f png
\draw [black, domain=0:180] plot ({2*cos(\... |
debsankha/network_course_python | talks/01-pythonbasics-builtins.ipynb | gpl-2.0 | # print( # Tab now should display the docstring
# Also woks:
print??
"""
Explanation: Table of Contents
1. Introduction to Interactive Network Analysis and Visualization with Python
1.1 What is Python?
1.1.1 How to use Python
1.2 A short intro to jupyter
1.2.1 Markdown is cool
1.2.1.1 This is a heading
1.2.2 Us... |
mne-tools/mne-tools.github.io | 0.17/_downloads/64973b551d79441db82e99316267b5b7/plot_whitened.ipynb | bsd-3-clause | import mne
from mne.datasets import sample
"""
Explanation: Plotting whitened data
This tutorial demonstrates how to plot whitened evoked data.
Data are whitened for many processes, including dipole fitting, source
localization and some decoding algorithms. Viewing whitened data thus gives
a different perspective on t... |
supergis/git_notebook | geospatial/openstreetmap/osm-json2geometry.ipynb | gpl-3.0 | from pprint import *
import pyspark
from pyspark import SparkConf, SparkContext
sc = None
print(pyspark.status)
"""
Explanation: 采用Spark处理OpenStreetMap的osm文件。
Spark DataFrame参考: https://spark.apache.org/docs/1.3.0/sql-programming-guide.html#interoperating-with-rdds
by openthings@163.com,2016-4-23. License: ... |
hunterherrin/phys202-2015-work | assignments/assignment05/InteractEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
"""Print the sum of the arguments a and b."""
... |
chetan51/nupic.research | projects/sdr_math/sdr_math_neuron_paper.ipynb | gpl-3.0 | oxp = Symbol("Omega_x'")
b = Symbol("b")
n = Symbol("n")
theta = Symbol("theta")
s = Symbol("s")
a = Symbol("a")
subsampledOmega = (binomial(s, b) * binomial(n - s, a - b)) / binomial(n, a)
subsampledFpF = Sum(subsampledOmega, (b, theta, s))
subsampledOmegaSlow = (binomial(s, b) * binomial(n - s, a - b))
subsampledFp... |
ThyrixYang/LearningNotes | MOOC/stanford_cnn_cs231n/assignment3(without_extra)/.ipynb_checkpoints/StyleTransfer-TensorFlow-checkpoint.ipynb | gpl-3.0 |
%load_ext autoreload
%autoreload 2
from scipy.misc import imread, imresize
import numpy as np
from scipy.misc import imread
import matplotlib.pyplot as plt
# Helper functions to deal with image preprocessing
from cs231n.image_utils import load_image, preprocess_image, deprocess_image
%matplotlib inline
def get_ses... |
marcinofulus/PR2014 | CUDA/iCSE_PR_Rownanie_Logistyczne.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pycuda.gpuarray as gpuarray
from pycuda.curandom import rand as curand
from pycuda.compiler import SourceModule
import pycuda.driver as cuda
try:
ctx.pop()
ctx.detach()
except:
print ("No CTX!")
cuda.init()
device = cuda.Devic... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/10_recommend/cf_softmax_model/solution/cfmodel_softmax_model_solution.ipynb | apache-2.0 | # Ensure the right version of Tensorflow is installed.
!pip freeze | grep tensorflow==2.6
from __future__ import print_function
import numpy as np
import pandas as pd
import collections
from mpl_toolkits.mplot3d import Axes3D
from IPython import display
from matplotlib import pyplot as plt
import sklearn
import sklea... |
google/earthengine-api | python/examples/ipynb/AI_platform_demo.ipynb | apache-2.0 | # Cloud authentication.
from google.colab import auth
auth.authenticate_user()
# Import and initialize the Earth Engine library.
import ee
ee.Authenticate()
ee.Initialize()
# Tensorflow setup.
import tensorflow as tf
print(tf.__version__)
# Folium setup.
import folium
print(folium.__version__)
"""
Explanation: <tab... |
hetaodie/hetaodie.github.io | assets/media/uda-ml/qinghua/shijianchafenfangfa/迷你项目:时间差分方法(第 0 部分和第 1 部分)/Temporal_Difference_Solution-zh.ipynb | mit | import gym
env = gym.make('CliffWalking-v0')
"""
Explanation: 迷你项目:时间差分方法
在此 notebook 中,你将自己编写很多时间差分 (TD) 方法的实现。
虽然我们提供了一些起始代码,但是你可以删掉这些提示并从头编写代码。
第 0 部分:探索 CliffWalkingEnv
请使用以下代码单元格创建 CliffWalking 环境的实例。
End of explanation
"""
[[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
[12, 13, 14, 15, 16, 17, 18, 19, 20,... |
saashimi/code_guild | wk4/notebooks/wk4.2.ipynb | mit | """
def flatten(lst):
res = []
for elem in lst:
if type(elem) == type([]):
res += flatten(elem)
print(res)
else:
res.append(elem)
return res
"""
def flatten(lst):
res = []
def f(lst):
for elem in lst:
if type(elem) == type([]):... |
karenlmasters/ComputationalPhysicsUnit | StochasticMethods/In Class Exercises - Random Processes Lab 2.ipynb | apache-2.0 | from astropy import constants as const
import numpy as np
import matplotlib.pyplot as plt
#This just needed for the Notebook to show plots inline.
%matplotlib inline
print(const.e.value)
print(const.e)
#Atomic Number of Gold
Z = 72
e = const.e.value
E = 7.7e6*e
eps0 = const.eps0.value
sigma = const.a0.value/100.
#p... |
tensorflow/docs-l10n | site/zh-cn/guide/random_numbers.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... |
mercybenzaquen/foundations-homework | databases_hw/db04/Homework_4.ipynb | mit | numbers_str = '496,258,332,550,506,699,7,985,171,581,436,804,736,528,65,855,68,279,721,120'
"""
Explanation: Homework #4
These problem sets focus on list comprehensions, string operations and regular expressions.
Problem set #1: List slices and list comprehensions
Let's start with some data. The following cell contain... |
ucsd-ccbb/mali-dual-crispr-pipeline | dual_crispr/distributed_files/notebooks/Dual CRISPR 6-Scoring Preparation.ipynb | mit | g_dataset_name = "Notebook6Test"
g_library_fp = '~/dual_crispr/library_definitions/test_library_2.txt'
g_count_fps_or_dirs = '/home/ec2-user/dual_crispr/test_data/test_set_6a,/home/ec2-user/dual_crispr/test_data/test_set_6b'
g_time_prefixes = "T,D"
g_prepped_counts_run_prefix = ""
g_prepped_counts_dir = '~/dual_crispr/... |
dynaryu/rmtk | rmtk/vulnerability/derivation_fragility/hybrid_methods/CSM/CSM.ipynb | agpl-3.0 | import capacitySpectrumMethod
from rmtk.vulnerability.common import utils
%matplotlib inline
"""
Explanation: Capacity Spectrum Method (CSM)
The Capacity Spectrum Method (CSM) is a procedure capable of estimating the nonlinear response of structures, utilizing overdamped response spectra. These response spectra can e... |
mercye/foundations-homework | 07/.ipynb_checkpoints/Homework_7_Emelike-checkpoint.ipynb | mit | import pandas as pd
"""
Explanation: Part One
Use the csv I've attached to answer the following questions:
1) Import pandas with the right name
End of explanation
"""
!pip install matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: 2) Set all graphics from matplotlib to display inline
End... |
darcamo/pyphysim | ipython_notebooks/METIS Simple Scenario.ipynb | gpl-2.0 | %matplotlib inline
# xxxxxxxxxx Add the parent folder to the python path. xxxxxxxxxxxxxxxxxxxx
import sys
import os
sys.path.append('../')
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, int... |
gabrielhpbc/CD | APS8_QUESTOES.ipynb | mit | from scipy import stats
Prob = 1-(stats.norm.cdf(5,loc=5.5,scale=1.07))
Prob
"""
Explanation: APS 8
Entrega: 28/11 ao final do atendimento (17:15)
Questão 1
Assuma que $X$ seja uma variável aleatória contínua que descreve o preço de um multímetro digital em uma loja brasileira qualquer. Ainda, assuma que o preço médio... |
bjshaw/phys202-2015-work | assignments/assignment05/InteractEx02.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 2
Imports
End of explanation
"""
import math as math
def plot_sine1(a, b):
x = np.linspace(0,4*math.pi,... |
bigdata-i523/hid335 | experiment/Python_SKL_SupportVectorClassifier.ipynb | gpl-3.0 | import sklearn
import mglearn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Introduction to Machine Learning
Andreas Mueller and Sarah Guido (2017) O'Reilly
Ch. 2 Supervised Learning
Support Vector Machines (SVM)
Understanding SVMs
During Training:
* SVM l... |
zomansud/coursera | ml-foundations/week-6/Assignment - Image Classification and Image Retrieval.ipynb | mit | image_train = graphlab.SFrame('image_train_data/')
image_test = graphlab.SFrame('image_test_data/')
image_train.head()
"""
Explanation: Load the image dataset
End of explanation
"""
image_train['label'].sketch_summary()
"""
Explanation: Computing summary statistics of the data
Using the training data, compute the... |
constellationcolon/simplexity | lpsm.ipynb | mit | fig = plt.figure()
axes = fig.add_subplot(1,1,1)
# define view
r_min = 0.0
r_max = 3.0
s_min = 0.0
s_max = 5.0
res = 50
r = numpy.linspace(r_min, r_max, res)
# plot axes
axes.axhline(0, color='#B3B3B3', linewidth=5)
axes.axvline(0, color='#B3B3B3', linewidth=5)
# plot constraints
c_1 = lambda x: 4 - 2*x
c_2 = lambd... |
jserenson/Python_Bootcamp | Statements Assessment Test - Solutions.ipynb | gpl-3.0 | st = 'Print only the words that start with s in this sentence'
for word in st.split():
if word[0] == 's':
print word
"""
Explanation: Statements Assessment Solutions
Use for, split(), and if to create a Statement that will print out words that start with 's':
End of explanation
"""
range(0,11,2)
"""
E... |
cathalmccabe/PYNQ | boards/Pynq-Z1/base/notebooks/arduino/arduino_joystick.ipynb | bsd-3-clause | from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
"""
Explanation: Arduino Joystick Shield Example
This example shows how to use the Sparkfun Joystick
on the board. The Joystick shield contains an analog joystick which is
connected to A0 and A1 analog channels of the Arduino connector. It al... |
AllenDowney/ThinkBayes2 | soln/chap15.ipynb | mit | # If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
# Get utils.py
from os.path import basename, exists
def download(url):
filename = basename(url)
if not exists(filename... |
saalfeldlab/template-building | python/analysis/H5TranformFormatTables.ipynb | bsd-2-clause | import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:90% !important; }</style>"))
bridge_list = ['JRC2018F_FAFB', 'JRC2018F_FCWB', 'JRC2018F_JFRC2010', 'JRC2018F_JFRC2013', 'JR... |
fja05680/pinkfish | examples/C00.sp500-components-timeseries/sp500-components-timeseries.ipynb | mit | from datetime import datetime
import pandas as pd
import pinkfish as pf
# -*- encoding: utf-8 -*-
%matplotlib inline
"""
Explanation: S&P 500 Components Time Series
Get time series of all S&P 500 components
End of explanation
"""
filename = 'sp500.csv'
symbols = pd.read_csv(filename)
symbols = sorted(list(symbols[... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch5-Problem_5-01.ipynb | unlicense | %pylab notebook
%precision %.4g
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 5
Problem 5-1
Note: You should first click on "Cell → Run All" in order that the plots get generated.
End of explanation
"""
Vt = 480 # [V]
PF = 0.8
fse = 60 # [Hz]
p = 8
Pout = 400 *... |
yunqu/PYNQ | boards/Pynq-Z1/base/notebooks/arduino/arduino_grove_ledbar.ipynb | bsd-3-clause | # Make sure the base overlay is loaded
from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
"""
Explanation: Grove LED Bar Example
This example shows how to use the Grove LED Bar on the board. The LED bar has 10 LEDs: 8 green LEDs, 1 orange LED, and 1 red LED. The brightness for each LED can be s... |
liquidscorpio/python-data-analysis | 1-Working-with-relational-data-using-pandas.ipynb | gpl-2.0 | import pandas as pd
# Some basic data
users = [
{ 'name': 'John', 'age': 29, 'id': 1 },
{ 'name': 'Doe', 'age': 19, 'id': 2 },
{ 'name': 'Alex', 'age': 32, 'id': 3 },
{ 'name': 'Rahul', 'age': 27, 'id': 4 },
{ 'name': 'Ellen', 'age': 23, 'id': 5},
{ 'name': 'Shristy', 'age': 30, 'id': 6}
]
us... |
gouthambs/karuth-source | content/extra/notebooks/pandas_vs_numpy.ipynb | artistic-2.0 | import pandas as pd
import matplotlib.pyplot as plt
plt.style.use("seaborn-pastel")
%matplotlib inline
import seaborn.apionly as sns
import numpy as np
from timeit import timeit
import sys
iris = sns.load_dataset('iris')
data = pd.concat([iris]*100000)
data_rec = data.to_records()
print (len(data), len(data_rec))
... |
EmuKit/emukit | notebooks/Emukit-tutorial-Bayesian-optimization-introduction.ipynb | apache-2.0 | ### General imports
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
### --- Figure config
LEGEND_SIZE = 15
"""
Explanation: An Introduction to Bayesian Optimization with Emukit
Overview
End of explanation
"""
from emukit.test_functions import forrester_... |
mercybenzaquen/foundations-homework | foundations_hw/05/Homework_5_Spotify_graded.ipynb | mit | import requests
response = requests.get('https://api.spotify.com/v1/search?q=Lil&type=artist&market=US&limit=50')
Lil = response.json()
print(Lil.keys())
print(type(Lil['artists']))
print(Lil['artists'].keys())
Lil_info = Lil['artists']['items']
print(type(Lil_info))
print(Lil_info[1])
"""
Explanation: graded = 8... |
jeroarenas/MLBigData | 5_RecommenderSystems/Recommender systems - Part 2-Students.ipynb | mit | # Import some libraries
import numpy as np
import math
from test_helper import Test
# Define data file
ratingsFilename = 'u.data'
# Read data with spark
rawRatings = sc.textFile(ratingsFilename)
# Check file format
print rawRatings.take(10)
"""
Explanation: Recommender Systems in Spark
Recommender Systems are a set... |
amitkaps/hackermath | Module_2f_ABTesting.ipynb | mit | #import the necessary datasets
import pandas as pd
import numpy as np
pd.__version__
!pip install xlrd
#Read the dataset
shoes_before = pd.read_excel("data/shoe_sales_before.xlsx")
shoes_during = pd.read_excel("data/shoe_sales_during.xlsx")
shoes_after = pd.read_excel("data/shoe_sales_after.xlsx")
shoes_before.head... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.