repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
teoguso/sol_1116 | slides.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
with plt.xkcd():
plt.rcParams['figure.figsize'] = (6., 4.)
x = np.linspace(-5, 5, 50)
gauss = np.exp(-(x**2) / 2)/np.sqrt(2 * np.pi)
ax = plt.subplot(111)
ax.plot(x, gauss, label="Best curve ever")
cdf = np.array([np.trapz(gau... |
statsmodels/statsmodels.github.io | v0.12.1/examples/notebooks/generated/pca_fertility_factors.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.multivariate.pca import PCA
plt.rc("figure", figsize=(16,8))
plt.rc("font", size=14)
"""
Explanation: statsmodels Principal Component Analysis
Key ideas: Principal component analysis, world bank data, fertility
In this n... |
rubensfernando/mba-analytics-big-data | Python/2016-07-29/aula4-parte1-atualizando-status.ipynb | mit | import tweepy
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
"""
Explanation: Atualizando Status
Para utilizar qualquer API do Twitter temos que importar os módulos e definir as chaves e tokens de acesso. Adicione suas chaves nas 4 strings abaixo.
End of explanation
"""
autorizar ... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-tetrad.ipynb | gpl-3.0 | # conda install ipyrad -c bioconda
# conda install tetrad -c eaton-lab -c conda-forge
import ipyrad.analysis as ipa
import toytree
"""
Explanation: <span style="color:gray">ipyrad-analysis toolkit:</span> tetrad
tetrad is a species tree inference tool based on the SVDQuartets algorithm of Chifman and Kubatko. It uses... |
abitrolly/capture-asteroid | doc/s314search.ipynb | mit | class MPCORB:
"""class for accessing MRCORB database records"""
def __init__(self, file='MRCORB.DAT'):
self.file = file
class MPOrbit:
"""parse and process MPCORB entries
http://www.minorplanetcenter.org/iau/info/MPOrbitFormat.html
"""
def __init__(self, line):
"""parse line ... |
mjvakili/ccppabc | ccppabc/code/notebooks/Ehbc-OD.ipynb | mit | model = Zheng07(threshold = -20.5)
print 'Data HOD Parameters ', model.param_dict
n_avg = 25
avg_nz, avg_corr = 0., 0.
xis = []
for i in xrange(n_avg):
model.populate_mock()
# number density
avg_nz += model.mock.number_density
# 6th element of xi(r) array
r, xi_r = model.mock.compu... |
mined-gatech/pymks_overview | 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)
"""
Explanat... |
mohanprasath/Course-Work | numpy/numpy_exercises_from_kyubyong/Mathematical_functions.ipynb | gpl-3.0 | import numpy as np
np.__version__
__author__ = "kyubyong. kbpark.linguist@gmail.com. https://github.com/kyubyong"
"""
Explanation: Mathematical functions
End of explanation
"""
x = np.array([0., 1., 30, 90])
"""
Explanation: Trigonometric functions
Q1. Calculate sine, cosine, and tangent of x, element-wise.
End ... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/ukesm1-0-ll/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'ukesm1-0-ll', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NERC
Source ID: UKESM1-0-LL
Topic: Aerosol
Sub-Topics: Transport, Emissions, C... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NCC
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties: 3... |
hglanz/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
"""
# left, top, right, bottom
x = np.hstack((np.array([-5]*10), np.linspace(-5, 5, 10), np.array([5]... |
mne-tools/mne-tools.github.io | dev/_downloads/299b3deaa8eb66e88d34f06090d06628/evoked_ers_source_power.ipynb | bsd-3-clause | # Authors: Luke Bloy <luke.bloy@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
import mne
from mne.cov import compute_covariance
from mne.datasets import somato
from mne.time_frequency import csd_morlet
from mne.beamformer import (make_dic... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-clade_weights.ipynb | gpl-3.0 | # conda install ipyrad -c bioconda
# conda install toyplot -c eaton-lab
import ipyrad.analysis as ipa
import toyplot
from ipyrad.analysis.clade_weights import *
"""
Explanation: <span style="color:gray">ipyrad-analysis toolkit:</span> clade_weights
<h5><span style="color:red">(Reference only method)</span></h5>
The... |
jdfekete/progressivis | notebooks/VegaIssue.ipynb | bsd-2-clause | import numpy as np
import time
import asyncio as aio
import pandas as pd
from vega.widget import VegaWidget
nbins = 50
spec_no_data = {
'$schema': 'https://vega.github.io/schema/vega-lite/v4.8.1.json',
'config': {'view': {'continuousHeight': 300, 'continuousWidth': 400}},
'data': {'name': 'data'},
'e... |
theandygross/HIV_Methylation | Parallel/Age_HIV_Features.ipynb | mit | import os
if os.getcwd().endswith('Parallel'):
os.chdir('..')
import NotebookImport
from HIV_Age_Advancement import *
def size_normalize(vec, order, s=10001):
p = int(np.ceil(s / 2.) - 1)
rank = lambda v: np.mean(v < v[p])
vec = vec.ix[order.order().index].dropna()
rolling_rank = pd.rolling_apply... |
Cyb3rWard0g/HELK | docker/helk-jupyter/notebooks/tutorials/03-intro-to-pandas.ipynb | gpl-3.0 | import pandas as pd
"""
Explanation: Introduction to Pandas
Goals:
Learn how to use pandas dataframes
Plot basic charts using dataframes and matplotlib
Reference:
* https://pandas.pydata.org/pandas-docs/stable/getting_started/overview.html
* https://pandas.pydata.org/pandas-docs/stable/reference/frame.html
* https... |
Danghor/Formal-Languages | ANTLR4-Python/SLR-Parser-Generator/SLR-Table-Generator.ipynb | gpl-2.0 | !cat Examples/c-grammar.g
"""
Explanation: Implementing an SLR-Table-Generator
A Grammar for Grammars
As the goal is to generate an SLR-table-generator we first need to implement a parser for context free grammars.
The file simple.g contains an example grammar that describes arithmetic expressions.
End of explanation
... |
Bio204-class/bio204-notebooks | 2016-04-11-Sampling-Distribution-Correlation-Coefficient.ipynb | cc0-1.0 | # generate bivariate normal data for uncorrelated variables
# See the docs on scipy.stats.multivariate_normal
# bivariate mean
mean = [0,0]
# covariance matrix
cov = np.array([[1,0],
[0,1]])
sample = stats.multivariate_normal.rvs(mean=mean, cov=cov, size=30)
sbn.jointplot(sample[:,0], sample[:,1... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-2/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-2', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-2
Sub-Topics: Radiative Forcings.
Propertie... |
printedheart/h2o-3 | h2o-py/demos/kmeans_aic_bic_diagnostics_NOPASS.ipynb | apache-2.0 | import h2o
# Start a local instance of the H2O engine.
h2o.init();
"""
Explanation: Much data produced is unlabeled data, data where the target vale or class is unknown. Unsupervised learning gives us the tools to find hidden structure in unlabeled data. There are many techniques, one of which is clustering of the ... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a_ml/ml_lasso_rf_grid_search_enonce.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
%matplotlib inline
"""
Explanation: Hyperparamètres, LassoRandomForestRregressor et grid_search (énoncé)
Le notebook explore l'optimisation des hyper paramaètres du modèle LassoRandomForestRegressor, et fait varier le nombre d'arbre et le paramètres alph... |
mayank-johri/LearnSeleniumUsingPython | Section 3 - Machine Learning/ThirdParty-scikit-learn-videos-master/08_grid_search.ipynb | gpl-3.0 | from sklearn.datasets import load_iris
from sklearn.neighbors import KNeighborsClassifier
from sklearn.cross_validation import cross_val_score
import matplotlib.pyplot as plt
%matplotlib inline
# read in the iris data
iris = load_iris()
# create X (features) and y (response)
X = iris.data
y = iris.target
# 10-fold c... |
yabirgb/DGIIM | lmd/problemas.ipynb | mit | numero = 78277485
a = numero % 1000; a
b = numero % 100; b
"""
Explanation: Yábir García Benchakhtir
End of explanation
"""
from mpmath import mp #Librería usada para modiuficar la precision decimal de PI
from math import sqrt
mp.dps = 1000 #Establecer la precisión que queremos
pi_1000 = mp.pi
print(pi_1000)
"... |
datapythonista/datapythonista.github.io | docs/pandas-internals/Demystifying pandas internals.ipynb | apache-2.0 | import pandas
titanic = pandas.read_csv('data/titanic.csv')
titanic.head()
# basic statistics
titanic[['Age', 'Fare']].describe()
# percentage of missing values
titanic[['Age', 'Fare']].isna().mean()
# imputing missing values with the median
titanic['Age'].fillna(titanic['Age'].median(), inplace=True)
titanic[['... |
liganega/Gongsu-DataSci | previous/y2017/W10-stats-correlation/GongSu22_Statistics_Population_Variance.ipynb | gpl-3.0 | from GongSu21_Statistics_Averages import *
"""
Explanation: 자료 안내: 여기서 다루는 내용은 아래 사이트의 내용을 참고하여 생성되었음.
https://github.com/rouseguy/intro2stats
모집단 분산 점추정
안내사항
지난 시간에 다룬 21장 내용을 활용하고자 한다.
따라서 아래와 같이 21장 내용을 모듈로 담고 있는 파이썬 파일을 임포트 해야 한다.
주의: GongSu21_Statistics_Averages.py 파일이 동일한 디렉토리에 있어야 한다.
End of explanation
"""
p... |
rickiepark/python-tutorial | Titanic.ipynb | mit | import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
from statsmodels.nonparametric.kde import KDEUnivariate
from statsmodels.nonparametric import smoothers_lowess
from pandas import Series, DataFrame
from patsy import dmatrices
from sklearn import datas... |
dlsun/symbulate | docs/mc.ipynb | mit | from symbulate import *
%matplotlib inline
"""
Explanation: Symbulate Documentation
Markov Processes
<a id='mc'></a>
Random processes are typically collections of dependent random variables, but allowing arbitrary associations between values at different points in time makes analysis intractable. Markov processes are... |
dlegor/Tutorial-Pandas-Python | Code/Capitulo_5.-Informalidad laboral y brecha entre las tasas netas de participacion femenina y masculina. Parte1.ipynb | cc0-1.0 | #Se cargan las librerías requeridas
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from __future__ import division
plt.style.use('ggplot')
plt.rcParams['figure.figsize']=(20,7)
#Se carga el primer archivo, la informacion es la población en trabajos infor... |
gitreset/Data-Science-45min-Intros | error_statistics-101/error_stats_and_severity.ipynb | unlicense | from scipy.stats import norm # properties of the distribution
from numpy.random import normal # samples from the distribution
import numpy as np
import scipy
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: This notebook provides an interactive overview to some if the ideas developed in a paper... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/labs/5b_deploy_keras_ai_platform_babyweight.ipynb | apache-2.0 | import os
"""
Explanation: LAB 5b: Deploy and predict with Keras model on Cloud AI Platform.
Learning Objectives
Setup up the environment
Deploy trained Keras model to Cloud AI Platform
Online predict from model on Cloud AI Platform
Batch predict from model on Cloud AI Platform
Introduction
In this notebook, we'll ... |
goodwordalchemy/thinkstats_notes_and_exercises | code/.ipynb_checkpoints/chap05ex-checkpoint.ipynb | gpl-3.0 | from __future__ import print_function, division
import thinkstats2
import thinkplot
%matplotlib inline
"""
Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br>
Allen Downey
End of explanation
"""
import scipy.stats
"""
Explanation: Exercise 5.1
In the BRFSS (see Section 5.4), the distribution... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sam0-unicon/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sam0-unicon', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: SNU
Source ID: SAM0-UNICON
Sub-Topics: Radiative Forcings.
Properties: 85 (4... |
mne-tools/mne-tools.github.io | 0.17/_downloads/793e913bab4b20ad5f4863ca669c17f8/plot_tf_lcmv.ipynb | bsd-3-clause | # Author: Roman Goj <roman.goj@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import compute_covariance
from mne.datasets import sample
from mne.event import make_fixed_length_events
from mne.beamformer import tf_lcmv
from mne.viz import plot_source_spectrogram
print(__doc__)
data_path = sample.data_path... |
RafaelNH/Reproduce-Hoy-et-al-2014 | notebook/supplementary_notebook_1.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import time
import sys
import os
%matplotlib inline
# Change directory to the code folder
os.chdir('..//code')
# Functions to sample the diffusion-weighted gradient directions
from dipy.core.sphere import disperse_charges, HemiSphere
# Function to... |
kit-cel/wt | mloc/ch6_Unsupervised_Learning/GMMs_in_Zero_Dispersion_Optical_Channel.ipynb | gpl-2.0 | import matplotlib.pyplot as plt
import numpy as np
from ipywidgets import interactive
import ipywidgets as widgets
from sklearn import mixture
%matplotlib inline
"""
Explanation: Use of GMMs to Model Zero-Dispersion Optical Channel
This code is provided as supplementary material of the lecture Machine Learning and Op... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-3/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Topic... |
trangel/Data-Science | .ipynb_checkpoints/logistic-regression-sciki-checkpoint.ipynb | gpl-3.0 | print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
import pandas as pd
#I use this dataset because this has clearly separated cathegories,
#Read the database using pandas,
#Note that bad lines are omitted with error_bad_lines=False
df = pd.read_csv('https://archive.i... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/image_models/labs/2_mnist_models_vertex.ipynb | apache-2.0 | import os
from datetime import datetime
REGION = "us-central1"
PROJECT = !(gcloud config get-value core/project)
PROJECT = PROJECT[0]
BUCKET = PROJECT
MODEL_TYPE = "cnn" # "linear", "dnn", "dnn_dropout", or "cnn"
# Do not change these
os.environ["PROJECT"] = PROJECT
os.environ["BUCKET"] = BUCKET
os.environ["REGION"]... |
BadWizard/Inflation | Disaggregated-Data/weather-like-plot-HICP-by-item-ver-2.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
import numpy as np
from matplotlib.ticker import FixedLocator, FixedFormatter
#import seaborn as sns
from matplotlib.ticker import FixedLocator, FixedFormatter
import seaborn as sns
ls
df_ind_items = pd.read_csv('ra... |
msalvaris/gpu_monitor | examples/notebooks/InfluxDBLoggerExample.ipynb | mit | from gpumon import device_count, device_name
device_count() # Returns the number of GPUs available
device_name() # Returns the type of GPU available
"""
Explanation: InfluxDB Logger Example
This notebook is a small demo of how to use gpumon in Jupyter notebooks and some convenience methods for working with GPUs
You ... |
nadvamir/deep-learning | gan_mnist/Intro_to_GANs_Solution.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... |
ML4DS/ML4all | P2.Numpy/old/numpy_professor.ipynb | mit | # Import some libraries that will be necessary for working with data and displaying plots
import numpy as np
import hashlib
# Test functions
def hashstr(str1):
"""Implements the secure hash of a string"""
return hashlib.sha1(str1).hexdigest()
def test_arrayequal(x1, x2, err_msg, ok_msg='Test passed'):
"... |
opesci/notebooks | AcousticFWI/OP.ipynb | bsd-3-clause | # Arithmetic operations
k = symbols('k')
s = symbols('s')
# 1D stencil
# multiplication addition
AI_dxi = k + k - 1
AI_dxxi = k + 1 + k - 1
AI_dxxij = (k+1)**2 - 2*k + 1 + 1 + (k+1)**2 - 2*k + 1 -1
# I/O operations
# lo... |
flaxandteal/python-course-lecturer-notebooks | 04 - interactions.ipynb | mit | from bokeh.io import output_notebook, show
output_notebook()
"""
Explanation: <table style="float:left; border:none">
<tr style="border:none">
<td style="border:none">
<a href="http://bokeh.pydata.org/">
<img
src="http://bokeh.pydata.org/en/latest/_static/bokeh-tra... |
jskonhovd/football | football.ipynb | mit | %pylab inline
import pandas as pd
import matplotlib.pyplot as plt
import requests
import string
from lxml import html
import datetime
def QB_HEADER():
str1 = "idx, DATE,OPPONENT,RESULT,CMP,PATT,PCT,PYDS,PAVG,PTD,INT,SAC,SYDS,RATE,"
str1 += "RATT,RYDS,RAVG,RLG,RTD,FUM\n"
return str1
def writeCSV(fileName,... |
ELind77/gensim | docs/notebooks/summarization_tutorial.ipynb | lgpl-2.1 | import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
from gensim.summarization import summarize
"""
Explanation: <h1>Tutorial: automatic summarization using Gensim</h1>
This module automatically summarizes the given text, by extracting one or more important sente... |
tensorflow/docs | site/en/guide/migrate/tpu_estimator.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... |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/tensorflow/optimize/03_Train_Model_CPU.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow.python.client import timeline
import pylab
import numpy as np
import os
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
tf.logging.set_verbosity(tf.logging.INFO)
"""
Explanation: Train Model with CPU
End of explanation
"""
tf.reset_default_graph()
"""
Expl... |
blua/deep-learning | embeddings/.ipynb_checkpoints/Skip-Grams-Solution-checkpoint.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
hunterherrin/phys202-2015-work | assignments/assignment08/InterpolationEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.interpolate import interp1d
"""
Explanation: Interpolation Exercise 1
End of explanation
"""
file=np.load('trajectory.npz')
t=file['t']
x=file['x']
y=file['y']
x
t
assert isinstance(x, np.ndarray) and len(x)==40
... |
tensorflow/cloud | g3doc/tutorials/overview.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... |
stijnvanhoey/course_gis_scripting | _solved/06-gis-python-rasters.ipynb | bsd-3-clause | bodem = np.load("../data/nete_bodem.npy") # Should be applied to a real DEM data set...
def shaded_relief(elev, altitude=np.pi/4.,
azimuth=np.pi/2.):
"""
Make a shaded relief version of a numpy array.
Parameters
----------
dem : 2D numpy array
altitude : float
Altitude... |
Evfro/polara | examples/Custom_evaluation.ipynb | mit | import numpy as np
from polara.datasets.movielens import get_movielens_data
seed = 0
def random_state(seed=seed): # to fix random state in experiments
return np.random.RandomState(seed=seed)
"""
Explanation: Using Polara for custom evaluation scenarios
Polara is designed to automate the process of model prototypi... |
sfegan/calin | examples/calib/ipno spe fits poisson gaussian.ipynb | gpl-2.0 | %pylab inline
import calin.diagnostics.functional
import calin.io.sql_transceiver
import calin.calib.spe_fit
import calin.math.histogram
import calin.math.optimizer
import calin.math.pdf_1d
import calin.iact_data.ipno
import calin.plotting
import calin.math.data_modeling
"""
Explanation: Fit a simple poisson/gaussian ... |
mfinkle/user-data-analytics | android-addons.ipynb | mit | def safe_str(obj):
""" return the byte string representation of obj """
if obj is None:
return unicode("")
return unicode(obj)
def dedupe_pings(rdd):
return rdd.filter(lambda p: p["meta/clientId"] is not None)\
.map(lambda p: (p["meta/documentId"], p))\
.reduceByKey(... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/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', 'messy-consortium', 'sandbox-3', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-3
Topic: Seaice
Sub-Topics: Dynami... |
xgcm/xrft | doc/chunk_example.ipynb | mit | n = int(2**8)
da = xr.DataArray(np.random.rand(n,int(n/2),int(n/2)), dims=['time','y','x'])
da
"""
Explanation: Parallelized Bartlett's Method
For long data sets that have reached statistical equilibrium, it is useful to chunk the data, calculate the periodogram for each chunk and then take the average to reduce varia... |
aasensio/SolarnetGranada | notebooks/Simple diagnostics.ipynb | mit | lambda0 = 6301.5
JUp = 1.0
JLow = 1.0
gUp = 2.5
gLow = 0.0
lambdaStart = 6300.8
lambdaStep = 0.01
nLambda = 150
wavelength = lambdaStart + np.arange(nLambda) * lambdaStep
lineInfo = np.asarray([lambda0, JUp, JLow, gUp, gLow, lambdaStart, lambdaStep])
s = pymilne.milne(nLambda, lineInfo)
BField = 100.0
BTheta = 0.0
BC... |
dtamayo/MachineLearning | Day3/restaurants_intermediate.ipynb | gpl-3.0 | ## Similar to Regressors_simple...
import pandas as pd
import numpy as np
import csv as csv
from datetime import datetime
from sklearn.ensemble import RandomForestRegressor
from sklearn.preprocessing import LabelEncoder
import scipy as sp
import re
import sklearn
from sklearn.cross_validation import train_test_split... |
QuantStack/quantstack-talks | 2019-07-10-CICM/src/notebooks/bqplot.ipynb | bsd-3-clause | from __future__ import print_function
from IPython.display import display
from ipywidgets import *
from traitlets import *
import numpy as np
import pandas as pd
import bqplot as bq
import datetime as dt
np.random.seed(0)
size = 100
y_data = np.cumsum(np.random.randn(size) * 100.0)
y_data_2 = np.cumsum(np.random.rand... |
mdietrichstein/vgg16-transfer-learning | dogs-vs-cats-redux.ipynb | bsd-2-clause | #reset python environment
%reset -f
from pathlib import Path
import numpy as np
import tensorflow as tf
import time
import os
current_dir = os.getcwd()
home_directory = Path(os.getcwd())
dataset_directory = home_directory / "datasets" / "dogs-vs-cats-redux-kernels-edition"
training_dataset_dir = dataset_directory ... |
springcoil/Bayesian_Examples_PyMC3 | Bayesian_LogReg.ipynb | mit | %matplotlib inline
import pandas as pd
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt
import seaborn
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: Bayesian Logistic Regression with PyMC3
This is a reproduction with a few slight alterations of Bayesian Log Reg by J. Benjamin... |
probml/pyprobml | notebooks/misc/clip_imagenette_make_dataset_pytorch.ipynb | mit | !nvidia-smi
"""
Explanation: <a href="https://colab.research.google.com/github/always-newbie161/pyprobml/blob/hermissue127/notebooks/clip_imagenette_make_dataset_pytorch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
This notebook shows the pipelin... |
VectorBlox/PYNQ | docs/source/5_programming_onboard.ipynb | bsd-3-clause | from pynq import Overlay
from pynq.board import LED
from pynq.board import RGBLED
from pynq.board import Switch
from pynq.board import Button
Overlay("base.bit").download()
"""
Explanation: Programming PYNQ-Z1's onboard peripherals
LEDs, switches and buttons
PYNQ-Z1 has the following on-board LEDs, pushbuttons and sw... |
mathurtx/hinge-ranking | src/exploration/Exploration.ipynb | gpl-3.0 | data.loc[data.player_age < 18,"player_age"] = data.loc[(data.player_age >= 18) & (data.player_age <= 30),"player_age"].mean(skipna=True)
data.loc[data.player_age > 100,"player_age"] = data.loc[(data.player_age >= 30) & (data.player_age <= 100),"player_age"].mean(skipna=True)
data["player_age"].fillna(data["player_age"... |
berkeley-dsc/purchasing | script/preprocessing/text_analysis.ipynb | isc | import re
import random
#import lda
import csv
import numpy as np
import pandas as pd
from collections import Counter
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from sklearn.feature_extraction.text import CountVectorizer
"""
Explanation: Text Analysis
Notebook by: Juan Shishido
In this n... |
tclaudioe/Scientific-Computing | SC1/08_Interpolation_Splines.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import scipy as sp
from scipy import interpolate
import ipywidgets as widgets
import matplotlib as mpl
mpl.rcParams['font.size'] = 14
mpl.rcParams['axes.labelsize'] = 20
mpl.rcParams['xtick.labelsize'] = 14
mpl.rcParams['ytick.labelsize'] = 14
from s... |
mrklees/kaggle-solutions | Titanic/.ipynb_checkpoints/Keras Titanic-checkpoint.ipynb | apache-2.0 | # core python
from itertools import product
import re
# Data Structures
import pandas as pd
import numpy as np
# Data Visualization
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
# Prediction
import tensorflow as tf
import edward as ed
from sklearn.model_selection import train_test_split, G... |
kit-cel/lecture-examples | sigNT/signals_transforms/wiener_khinchin.ipynb | gpl-2.0 | # importing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 20}
plt.rc('font', **font)
plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(18, 10) )
"""
Explanation: Content and Objectives
Show effect ... |
molpopgen/fwdpy | docs/examples/copypops.ipynb | gpl-3.0 | import fwdpy as fp
import numpy as np
#Let's set up a simulation and evolve some populations...
nregions = [fp.Region(0,1,1),fp.Region(2,3,1)]
sregions = [fp.ExpS(1,2,1,-0.1),fp.ExpS(1,2,0.01,0.001)]
rregions = [fp.Region(0,3,1)]
rng = fp.GSLrng(201)
popsizes = np.array([1000],dtype=np.uint32)
popsizes=np.tile(popsizes... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/05_review/labs/3_tensorflow_dnn.ipynb | apache-2.0 | PROJECT = "cloud-training-demos" # Replace with your PROJECT
BUCKET = "cloud-training-bucket" # Replace with your BUCKET
REGION = "us-central1" # Choose an available region for Cloud MLE
TFVERSION = "1.14" # TF version for CMLE to use
import os
os.environ["BUCKET"] = BUCKET
os.environ["PROJ... |
amirziai/learning | deep-learning/Convolution.ipynb | mit | import numpy as np
np.random.seed(0)
image = np.random.randint(0, 10, size=(6, 6))
image
# Vertical edge detection
kernel = np.array([[1, 0, -1], [1, 0, -1], [1, 0, -1]])
kernel
from scipy.signal import convolve
# Negate the kernel
kernel_flipped = np.negative(kernel)
convolve(image, kernel_flipped, 'valid')
ima... |
pligor/predicting-future-product-prices | 04_time_series_prediction/.ipynb_checkpoints/21_price_history_seq2seq-dyn_dec_ins-checkpoint.ipynb | agpl-3.0 | from __future__ import division
import tensorflow as tf
from os import path, remove
import numpy as np
import pandas as pd
import csv
from sklearn.model_selection import StratifiedShuffleSplit
from time import time
from matplotlib import pyplot as plt
import seaborn as sns
from mylibs.jupyter_notebook_helper import sho... |
ledeprogram/algorithms | class7/homework/Emelike_Mercy_7_1.ipynb | gpl-3.0 | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
from sklearn import datasets
from sklearn.cross_validation import train_test_split
from sklearn import tree
"""
Explanation: We covered a lot of information today and I'd like you to practice developing classification trees on your own. For each e... |
sahilm89/lhsmdu | lhsmdu/benchmark/.ipynb_checkpoints/Comparing LHSMDU and MC sampling-checkpoint.ipynb | mit | import numpy as np
import lhsmdu
import matplotlib.pyplot as plt
def simpleaxis(axes, every=False):
if not isinstance(axes, (list, np.ndarray)):
axes = [axes]
for ax in axes:
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
if every:
ax.spine... |
sidazhang/udacity-dlnd | intro-to-tensorflow/intro_to_tensorflow.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... |
landlab/landlab | notebooks/tutorials/flow_direction_and_accumulation/the_FlowDirectors.ipynb | mit | %matplotlib inline
# import plotting tools
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib as mpl
# import numpy
import numpy as np
# import necessary landlab components
from landlab im... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Python-for-Data-Visualization/Seaborn/Regression Plots.ipynb | mit | import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips')
tips.head()
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Regression Plots
Seaborn has many built-in capabilities for regression plots, however we won't really discuss regression until the ma... |
crystalzhaizhai/cs207_yi_zhai | lectures/L19/L19.ipynb | mit | import sqlite3
import numpy as np
import pandas as pd
import time
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('display.notebook_repr_html', True)
db = sqlite3.connect('L19DB_demo.sqlite')
cursor = db.cursor()
cursor.execute("DROP TABLE IF EXISTS candidates")
cursor.execu... |
4dsolutions/Python5 | NewPyx.ipynb | mit | import tetravolume
Ø = (1 + 5**0.5)/2
from math import sqrt
Emod = sqrt(2)/8 * Ø**-3
Emod
"""
Explanation: The E-module in Tetravolumes
by D. Koski & K. Urner, June 2018
The E-module has long been a standard module, starting with Synergetics and persisting through the writings and research of several students of polyh... |
h-mayorquin/time_series_basic | presentations/2016-01-27(Predictiong-With-SLM).ipynb | bsd-3-clause | import numpy as np
import h5py
from sklearn import svm, cross_validation, preprocessing
"""
Explanation: Predictiong with SLM
In this notebook we compare how accurate is a SVM prediction using SLM as its features when the latter are normalized (its values are only 0, 1) in opposition to the current state where its val... |
KraljSamo/AnalizaPodatkov | Analiza podatkov -- Project Euler.ipynb | mit | podatki.head(10)
"""
Explanation: Za projekt analize podatkov pri predmetu programiranje 1 sem si izbral spletno stran Project Euler in analiziral podatke s te strani. Glavno kar me je zanimalo je, za katere naloge so najboljši reševalci potrebovali največ časa in katere naloge so najzahtevnejše in jih je do sedaj reš... |
flohorovicic/pynoddy | docs/notebooks/Feature-Sampling.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
import sys, os
import matplotlib.pyplot as plt
# adjust some settings for matplotlib
from matplotlib import rcParams
# print rcParams
rcParams['font.size'] = 15
# determine path of repository to set paths corretly below
rep... |
pastas/pastas | examples/notebooks/17_changing_responses.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pastas as ps
ps.set_log_level("ERROR")
ps.show_versions(numba=True)
"""
Explanation: Changing response functions
R.A. Collenteur, University of Graz, 2021
In this notebook the new ChangeModel is tested, based on the work by Obergfjell et al... |
tensorflow/examples | courses/udacity_intro_to_tensorflow_lite/tflite_c02_transfer_learning.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... |
spacecoffin/GravelKicker | Notebooks/Experiments/17_01_09_batching.ipynb | apache-2.0 | import hurry.filesize
hurry.filesize.size(903168, system=hurry.filesize.alternative)
hurry.filesize.size(882102, system=hurry.filesize.si)
hurry.filesize.size(882000, system=hurry.filesize.si)
hurry.filesize.size(1073741824, system=hurry.filesize.alternative)
hurry.filesize.size(1073741824, system=hurry.filesize.s... |
daniestevez/jupyter_notebooks | Falcon-9/Falcon-9 frames.ipynb | gpl-3.0 | x = np.fromfile('falcon9_frames_20210324_084608.u8', dtype = 'uint8')
x = x.reshape((-1, 1195))
"""
Explanation: This notebook shows an analysis of the Falcon-9 upper stage S-band telemetry frames. It is based on r00t.cz's analysis.
The frames are CCSDS Reed-Solomon frames with an interleaving depth of 5, a (255,239) ... |
mne-tools/mne-tools.github.io | 0.17/_downloads/4db67f73b2950e88bd1e641ba8cf44c0/plot_modifying_data_inplace.ipynb | bsd-3-clause | import mne
import os.path as op
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: Modifying data in-place
It is often necessary to modify data once you have loaded it into memory.
Common examples of this are signal processing, feature extraction, and data
cleaning. Some functionality is pre-buil... |
slundberg/shap | notebooks/text_examples/sentiment_analysis/Keras LSTM for IMDB Sentiment Classification.ipynb | mit | # This model training code is directly from:
# https://github.com/keras-team/keras/blob/master/examples/imdb_lstm.py
'''Trains an LSTM model on the IMDB sentiment classification task.
The dataset is actually too small for LSTM to be of any advantage
compared to simpler, much faster methods such as TF-IDF + LogReg.
# N... |
tensorflow/docs-l10n | site/zh-cn/federated/tutorials/custom_federated_algorithms_2.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... |
btw2111/intro-numerical-methods | 0_intro_numerical_methods.ipynb | mit | %matplotlib inline
import numpy
import matplotlib.pyplot as plt
def A(P, r, n):
return P / r * ((1 + r)**n - 1)
n = numpy.linspace(0, 20, 100)
target = 5000
plt.hold(True)
for r in [0.02, 0.05, 0.08, 0.1, 0.12]:
plt.plot(n, A(100, r, n))
plt.plot(n, numpy.ones(n.shape) * target, 'k--')
plt.legend(["r = 0.02",... |
rchaks/retrieve-and-rank-tuning | examples/3.0 - Create Discovery Collection & Evaluate.ipynb | apache-2.0 | import sys
from os import path, getcwd
import json
from tempfile import mkdtemp
import glob
sys.path.extend([path.abspath(path.join(getcwd(), path.pardir))])
from rnr_debug_helpers.utils.discovery_wrappers import DiscoveryProxy
from rnr_debug_helpers.utils.io_helpers import load_config, smart_file_open, \
RankerR... |
facaiy/book_notes | Introduction_to_Algorithms/26_Maximum_Flow/note.ipynb | cc0-1.0 | plt.imshow(plt.imread('./res/fig26_1.png'))
# Exercise
"""
Explanation: 26 Maximum Flow
each directed edge in a flow network like a conduit for the material: Each conduit has a stated capacity, vertices are conduit junctions.
In the maximum-flow problem, we wish to compute the greatest rate at which we can ship mater... |
liganega/Gongsu-DataSci | previous/y2017/W11-pandas-intro/GongSu25_Statistics_Sampling_Distribution.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
from scipy import stats
"""
Explanation: 자료 안내: 여기서 다루는 내용은 아래 사이트의 내용을 참고하여 생성되었음.
https://github.com/rouseguy/intro2stats
표본분포와 신뢰구간
주요내용
앞서 GongSu22에서 표본 데이터를 이용하여 모집단의 평균과 분산에 대한 점추정을 알아보았다.
여기서는 표본분포를 이용하여 미국 51개 주에서 거래된 담배(식물) 도매가의 평균에 대한 신뢰구간을 구하는 방법을 알아본다.
주요 예제
캘리포니아 주에... |
awhite40/pymks | notebooks/mks_elasticity_3D_hexagonal_polycrystal.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Linear Elasticity in 3D for Polycrystalline Microstructures
Authors: Noah Paulson, Andrew Medford, David Brough
Introduction
This example demonstrates the use of MKS to predict strain fields in a ... |
ceteri/pytextrank | archive/example.ipynb | apache-2.0 | import pytextrank
import sys
path_stage0 = "dat/mih.json"
path_stage1 = "o1.json"
with open(path_stage1, 'w') as f:
for graf in pytextrank.parse_doc(pytextrank.json_iter(path_stage0)):
f.write("%s\n" % pytextrank.pretty_print(graf._asdict()))
# to view output in this notebook
print(pytextr... |
getsmarter/bda | module_2/M2_NB2_FunFIntroduction.ipynb | mit | import pandas as pd
import numpy as np
import folium
import matplotlib.pylab as plt
import matplotlib
%matplotlib inline
matplotlib.rcParams['figure.figsize'] = (10, 8)
"""
Explanation: <div align="right">Python 3.6 Jupyter Notebook</div>
Introduction to Funf
Your completion of the notebook exercises will be graded b... |
tensorflow/docs-l10n | site/zh-cn/tfx/tutorials/transform/census.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... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec7_head-simulation-convolution.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfc
from scipy.signal import lfilter
import pandas as pd
"""
Explanation: Groundwater system behavior simulation with convolution
IHE, transient groundwater
Olsthoorn, 2019-01-05
A solution, which shows the deline of the head in a strip due ... |
kevinsung/OpenFermion | docs/tutorials/circuits_1_basis_change.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.