repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
fhmartinezs/Dinamicos_UD | notebooks/03_Laplace.ipynb | apache-2.0 | import sympy
from sympy import *
sympy.init_printing()
s = Symbol('s')
t = Symbol('t', positive=True)
"""
Explanation: Analysis of Dynamic Systems
Schedule:
Getting started
Introduction
Mathematical bases
Bode diagrams
Modeling with linear elements
State variables
Block diagrams
Time response
Frequency response
Stabi... |
mrustl/flopy | examples/Notebooks/flopy3_swi2package_ex4.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 4. Upconing Below a Pumping Well in a Two-Aquifer Island System
This example problem is the fourth example pro... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/matplotlib/04.12-Three-Dimensional-Plotting.ipynb | mit | from mpl_toolkits import mplot3d
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png">
This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub.
The text is released under the CC-B... |
massimo-nocentini/on-python | UniFiCourseSpring2020/generators.ipynb | mit | __AUTHORS__ = {'am': ("Andrea Marino",
"andrea.marino@unifi.it",),
'mn': ("Massimo Nocentini",
"massimo.nocentini@unifi.it",
"https://github.com/massimo-nocentini/",)}
__KEYWORDS__ = ['Python', 'Jupyter', 'language', 'keynote',]
"""
E... |
Pencroff/deep-learning-course | lesson-1/1_notmnist.ipynb | mit | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import time
from datetime import timedelta
import tarfile
from IPython.display import display, Image
... |
maxhutch/mapcombine | examples/word_count/WordCount.ipynb | mit | def my_init(args, params, frame):
from copy import deepcopy
ans = {"words" : {}}
base = deepcopy(ans)
jobs = []
ans["fname"] = "/tmp/Dickens/TaleOfTwoCities.txt"
jobs.append(((0, 16271), params, args, deepcopy(ans)))
ans["fname"] = "/tmp/Dickens/ChristmasCarol.txt"
jobs.append(((0, 4236)... |
tensorflow/docs-l10n | site/en-snapshot/tfx/tutorials/transform/simple.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... |
DeepLearningUB/EBISS2017 | 2. Automatic Differentiation.ipynb | mit | !pip install autograd
"""
Explanation: Automatic Differentiation and Computational Graphs
The backpropagation algorithm was originally introduced in the 1970s, but its importance wasn't fully appreciated until a famous 1986 paper by David Rumelhart, Geoffrey Hinton, and Ronald Williams. (Michael Nielsen in "Neural Ne... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/official/automl/sdk_automl_image_object_detection_batch.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex AI SDK : AutoML training image object detection model for batch prediction
<table align=... |
Kaggle/learntools | notebooks/time_series/raw/tut4.ipynb | apache-2.0 | #$HIDE_INPUT$
import pandas as pd
# Federal Reserve dataset: https://www.kaggle.com/federalreserve/interest-rates
reserve = pd.read_csv(
"../input/ts-course-data/reserve.csv",
parse_dates={'Date': ['Year', 'Month', 'Day']},
index_col='Date',
)
y = reserve.loc[:, 'Unemployment Rate'].dropna().to_period('M'... |
dwhswenson/openpathsampling | examples/misc/tutorial_handle_nan.ipynb | mit | import openpathsampling as paths
import openpathsampling.engines.openmm as dyn_omm
import openpathsampling.engines as dyn
from simtk.openmm import app
import simtk.openmm as mm
import simtk.unit as unit
import mdtraj as md
import numpy as np
"""
Explanation: How to deal with errors in engines
Imports
End of explana... |
krondor/nlp-dsx-pot | Spark - Word2Vec Lab.ipynb | gpl-3.0 | # The code was removed by DSX for sharing.
"""
Explanation: ACTION REQUIRED to get your credentials:
Click on the empty cell below
Then look for the data icon on the top right (drawing with zeros and ones) and click on it
You should see the tweets.gz file, then click on "insert to code and choose the Spark SQLContex... |
sassoftware/sas-viya-machine-learning | Python-integration/The Data Science Pilot Action Set.ipynb | apache-2.0 | import swat
import numpy as np
import pandas as pd
conn = swat.CAS('localhost', 5570, authinfo='~/.authinfo', caslib="CASUSER")
"""
Explanation: The Data Science Pilot Action Set
The dataSciencePilot action set consists of actions that implement a policy-based, configurable, and scalable approach to automating data s... |
luofan18/deep-learning | tensorboard/Anna_KaRNNa_Summaries.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
rflamary/POT | docs/source/auto_examples/plot_otda_mapping.ipynb | mit | # Authors: Remi Flamary <remi.flamary@unice.fr>
# Stanislas Chambon <stan.chambon@gmail.com>
#
# License: MIT License
import numpy as np
import matplotlib.pylab as pl
import ot
"""
Explanation: OT mapping estimation for domain adaptation
This example presents how to use MappingTransport to estimate at the sa... |
iutzeler/Introduction-to-Python-for-Data-Sciences | 4-4_Going_Further.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
#import seaborn as sns
#sns.set()
N = 100 #points to generate
X = np.sort(10*np.random.rand(N, 1)**0.8 , axis=0) #abscisses
y = 4 + 0.4*np.random.rand(N) - 1. / (X.ravel() + 0.5)**2 - 1. / (10.5 - X.ravel() ) # some complicated function
plt.s... |
letsgoexploring/economicData | seigniorage/python/us_seigniorage_data.ipynb | mit | # Download monetary base and GDP deflator data
m_base = fp.series('BOGMBASE')
gdp_deflator = fp.series('A191RD3A086NBEA')
# Convert monetary base data to annual frequency
m_base = m_base.as_frequency('A')
# Equalize data ranges for monetary base and GDP deflator data
m_base, gdp_deflator = fp.window_equalize([m_base,... |
tarashor/vibrations | py/notebooks/draft/Corrugated geometries.ipynb | mit | from sympy import *
from sympy.vector import CoordSys3D
N = CoordSys3D('N')
x1, x2, x3 = symbols("x_1 x_2 x_3")
alpha1, alpha2, alpha3 = symbols("alpha_1 alpha_2 alpha3")
R, L, ga, gv = symbols("R L g_a g_v")
init_printing()
"""
Explanation: Corrugated Shells
Init symbols for sympy
End of explanation
"""
a1 = pi / 2... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_sensor_connectivity.ipynb | bsd-3-clause | # Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import numpy as np
from scipy import linalg
import mne
from mne import io
from mne.connectivity import spectral_connectivity
from mne.datasets import sample
print(__doc__)
"""
Explanation: Compute all-to-all connectivity in sensor spa... |
jrg365/gpytorch | examples/02_Scalable_Exact_GPs/Simple_MultiGPU_GP_Regression.ipynb | mit | import math
import torch
import gpytorch
import sys
from matplotlib import pyplot as plt
sys.path.append('../')
from LBFGS import FullBatchLBFGS
%matplotlib inline
%load_ext autoreload
%autoreload 2
"""
Explanation: Exact GP Regression with Multiple GPUs and Kernel Partitioning
Introduction
In this notebook, we'll de... |
alasdairtran/mclearn | projects/alasdair/notebooks/04_learning_curves.ipynb | bsd-3-clause | # remove after testing
%load_ext autoreload
%autoreload 2
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from itertools import product
from sklearn.svm import SVC, LinearSVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation imp... |
intel-analytics/BigDL | apps/variational-autoencoder/using_variational_autoencoder_to_generate_digital_numbers.ipynb | apache-2.0 | # a bit of setup
import numpy as np
from bigdl.dllib.nn.criterion import *
from bigdl.dllib.feature.dataset import mnist
from bigdl.dllib.keras.layers import *
from bigdl.dllib.keras.models import Model
from bigdl.dllib.keras.utils import *
import datetime as dt
IMAGE_SIZE = 784
IMAGE_ROWS = 28
IMAGE_COLS = 28
IMAGE_C... |
Amarchuk/2FInstability | data/n4258_u7353/.ipynb_checkpoints/n4258-checkpoint.ipynb | gpl-3.0 | from IPython.display import HTML
from IPython.display import Image
import os
%pylab
%matplotlib inline
%run ../../../utils/load_notebook.py
from photometry import *
from instabilities import *
name = 'N4258'
gtype = 'SA(s)ab'
incl = 70. #(adopted by Epinat+2008)
scale = 0.092 #kpc/arcsec according to ApJ 142 145(3... |
femtotrader/pyfolio | pyfolio/examples/single_stock_example.ipynb | apache-2.0 | %matplotlib inline
import pyfolio as pf
"""
Explanation: Single stock analysis example in pyfolio
Here's a simple example where we produce a set of plots, called a tear sheet, for a stock.
Import pyfolio
End of explanation
"""
stock_rets = pf.utils.get_symbol_rets('FB')
"""
Explanation: Fetch the daily returns for ... |
bakanchevn/DBCourseMirea2017 | Неделя 1/Задание в классе/Лекция 2.ipynb | gpl-3.0 | %load_ext sql
%sql sqlite://
%%sql
pragma foreign_keys = ON; -- WARNING: by default off in sqlite
drop table if exists product; -- This needs to be dropped if exists, see why further down!
drop table if exists company;
create table company (
cname varchar primary key, -- company name uniquely identifies the compan... |
ireapps/cfj-2017 | exercises/20. Exercise - Web scraping-working.ipynb | mit | # the URL to request
# get that page
# turn the page text into soup
# find the table of interest
"""
Explanation: Let's scrape some death row data
Texas executes a lot of criminals, and it has a web page that keeps track of people on its death row.
Using what you've learned so far, let's scrape this table into ... |
ergosimulation/mpslib | scikit-mps/examples/ex_mpslib_hard_and_soft.ipynb | lgpl-3.0 | import mpslib as mps
import numpy as np
import matplotlib.pyplot as plt
O=mps.mpslib(method='mps_snesim_tree', parameter_filename='mps_snesim.txt')
#O=mps.mpslib(method='mps_genesim', parameter_filename='mps_genesim.txt')
TI1, TI_filename1 = mps.trainingimages.strebelle(3, coarse3d=1)
O.par['soft_data_categories']=n... |
ml4a/ml4a-guides | examples/models/tacotron2.ipynb | gpl-2.0 | %tensorflow_version 1.x
!pip3 install --quiet ml4a
"""
Explanation: tacotron2: Text-to-speech synthesis
Generates speech audio from a text string. See the original code and paper.
Set up ml4a and enable GPU
If you don't already have ml4a installed, or you are opening this in Colab, first enable GPU (Runtime > Change ... |
eugen/mlstudy | 3. Logistic Regression/3. Binary Classification Exercise.ipynb | apache-2.0 | %matplotlib inline
import sqlite3
import pandas as pd
import numpy as np
import nltk
import string
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from sklearn import metrics
from sklearn.metr... |
usantamaria/iwi131 | ipynb/12-Actividad-FuncionesYCondicionales/Actividad2.ipynb | cc0-1.0 | def nota_minima(nota1, nota2):
nota3 = 164 - nota1 - nota2
return nota3
print nota_minima(0,0)
print nota_minima(35,65)
print nota_minima(88,70)
print nota_minima(100,100)
"""
Explanation: <header class="w3-container w3-teal">
<img src="images/utfsm.png" alt="" align="left"/>
<img src="images/inf.png" alt=""... |
fmfn/BayesianOptimization | examples/exploitation_vs_exploration.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from bayes_opt import BayesianOptimization
"""
Explanation: Exploitation vs Exploration
End of explanation
"""
np.random.seed(42)
xs = np.linspace(-2, 10, 10000)
def f(x):
return np.exp(-(x - 2) ** 2) + np.exp(-(x - 6) ** 2 / 10) + 1/ (x **... |
fastai/course-v3 | nbs/dl2/cyclegan.ipynb | apache-2.0 | #path = Config().data_path()
#! wget https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/horse2zebra.zip -P {path}
#! unzip -q -n {path}/horse2zebra.zip -d {path}
#! rm {path}/horse2zebra.zip
path = Config().data_path()/'horse2zebra'
path.ls()
"""
Explanation: Data
One-time download, uncomment the next ... |
Hexiang-Hu/mmds | final/Final-basic.ipynb | mit | ## Q2 Solution.
def hash(x):
return math.fmod(3 * x + 2, 11)
for i in xrange(1,12):
print hash(i)
"""
Explanation: Q1. Solution
3-shingles for "hello world":
hel, ell, llo, lo_, o_w ,_wo, wor, orl, rld => 9 in total
Q2. Solution
End of explanation
"""
## Q3 Solution.
prob = 1.0 / 10
a = (1 - prob)**4
pr... |
DaveBackus/Data_Bootcamp | Code/IPython/bootcamp_advgraphics_seaborn.ipynb | mit | import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import sys
%matplotlib inline
"""
Explanation: Graphics using Seaborn
We previously have covered how to do some basic graphics using matplotlib. In this notebook we introduce a package called seaborn. seaborn builds on ... |
ND-CSE-30151/tock | docs/source/tutorial/General.ipynb | mit | from tock import *
"""
Explanation: More general machines
End of explanation
"""
m1 = Machine([BASE, BASE, BASE, BASE], state=0, input=1)
"""
Explanation: We've seen finite automata, pushdown automata, and Turing machines, but many other kinds of automata can be created by instantiating a Machine directly.
End of e... |
xpharry/Udacity-DLFoudation | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
class DLProgress(tqdm):
last_block = 0
def hoo... |
CyberCRI/dataanalysis-herocoli-redmetrics | v1.52/Tests/1.6 Google form analysis - MCA.ipynb | cc0-1.0 | %run "../Functions/1. Google form analysis.ipynb"
"""
Explanation: Table of Contents
MCA
<br>
<br>
<br>
<br>
End of explanation
"""
import mca
np.set_printoptions(formatter={'float': '{: 0.4f}'.format})
pd.set_option('display.precision', 5)
pd.set_option('display.max_columns', 25)
"""
Explanation: MCA
<a id=MCA />... |
jhconning/Dev-II | notebooks/Village_sharing.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact, fixed, FloatSlider
%matplotlib inline
"""
Explanation: Village consumption smoothing
We simulate T periods of income for N individuals. Each individual receives a base level of income plus an income shocks. The income shocks can be i... |
MarsUniversity/ece387 | website/notes/AL5D/lynx_al5d-3.ipynb | mit | %matplotlib inline
from __future__ import print_function
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
from sympy import symbols, sin, cos, simplify, trigsimp, pi
from math import radians as d2r
from math import degrees as r2d
from math import atan2, sqrt, acos, fabs
class mD... |
google/uncertainty-baselines | experimental/language_structure/psl/colabs/gradient_based_constraint_learning_demo.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import random
import tensorflow as tf
from tensorflow import keras
"""
Explanation: Gradient Based Constraint Learning Demo
Licensed under the Apache License, Version 2.0.
This colab explores joint learning neural networks with soft constraints.
End of explanation
"""
# ======... |
microsoft/dowhy | docs/source/example_notebooks/DoWhy-The Causal Story Behind Hotel Booking Cancellations.ipynb | mit | %reload_ext autoreload
%autoreload 2
# Config dict to set the logging level
import logging.config
DEFAULT_LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'loggers': {
'': {
'level': 'INFO',
},
}
}
logging.config.dictConfig(DEFAULT_LOGGING)
# Disabling warnings ... |
kylepolich/dataskeptic | blog/b010_pushing-data-to-home-sales-api.ipynb | cc0-1.0 | import requests
from datetime import datetime
import json
"""
Explanation: Pushing property information to the Data Skeptic Home Sales Project API
Writing that title out makes me realize how poorly this project is named! Perhaps some volunteer might take up the challenge of branding these efforts...
In any event, I w... |
kaiping/incubator-singa | doc/en/docs/notebook/regression.ipynb | apache-2.0 | from __future__ import division
from __future__ import print_function
from builtins import range
from past.utils import old_div
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Train a linear regression model
In this notebook, we are going to use the tensor module from PySINGA to... |
mne-tools/mne-tools.github.io | 0.22/_downloads/ecc61038e0082bd1c13f6a49dd4cd752/plot_70_fnirs_processing.ipynb | bsd-3-clause | import os
import numpy as np
import matplotlib.pyplot as plt
from itertools import compress
import mne
fnirs_data_folder = mne.datasets.fnirs_motor.data_path()
fnirs_cw_amplitude_dir = os.path.join(fnirs_data_folder, 'Participant-1')
raw_intensity = mne.io.read_raw_nirx(fnirs_cw_amplitude_dir, verbose=True)
raw_inte... |
omartinsky/PYBOR | main.ipynb | mit | %pylab
%matplotlib inline
%run jupyter_helpers
%run yc_framework
figure_width = 16
"""
Explanation: PYBOR
PYBOR is a multi-curve interest rate framework and risk engine based on multivariate optimization techniques, written in Python.
Copyright © 2017 Ondrej Martinsky, All rights reserved
www.github.com/omartinsk... |
hackgnar/pyubertooth | notebooks/AHA_Demo-4-28-16.ipynb | gpl-2.0 | import time
import sys
sys.path.insert(0,"/Users/rholeman/src/pyubertooth")
from pyubertooth.ubertooth import Ubertooth, ubertooth_rx_to_stdout
from pylibbtbb.bluetooth_packet import BtbbPacket
import bluetooth
"""
Explanation: Python Ubertooth Bindings
bla bla bla bla jupyter has no spellcheck so drink when you find ... |
clarkkev/attention-analysis | General_Analysis.ipynb | mit | import collections
import pickle
import matplotlib
import numpy as np
import seaborn as sns
import sklearn
from matplotlib import pyplot as plt
from matplotlib import cm
from sklearn import manifold
sns.set_style("darkgrid")
"""
Explanation: General BERT Attention Analysis
This notebook contains code for analyzing ... |
OpenWIM/pywim | notebooks/presentations/scipyla2015/PyWIM-presentation.ipynb | mit | from IPython.display import display
from matplotlib import pyplot as plt
from scipy import signal
from scipy import constants
from scipy.signal import argrelextrema
from collections import defaultdict
from sklearn import metrics
import statsmodels.api as sm
import numpy as np
import pandas as pd
import numba as nb
imp... |
spencer2211/deep-learning | autoencoder/Simple_Autoencoder_Solution.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... |
celiasmith/syde556 | SYDE 556 Lecture 4 Transformation.ipynb | gpl-2.0 | %pylab inline
import numpy as np
import nengo
from nengo.dists import Uniform
from nengo.processes import WhiteSignal
from nengo.solvers import LstsqL2
T = 1.0
max_freq = 10
model = nengo.Network('Communication Channel', seed=3)
with model:
stim = nengo.Node(output=WhiteSignal(T, high=max_freq, rms=0.5))
en... |
gregunz/ada2017 | exam/data_cluedo/4-politicians.ipynb | mit | # Run the following to import necessary packages and import dataset. Do not use any additional plotting libraries.
import pandas as pd
from modules.util_politicians import evaluate, toggle_display
dataset = "dataset/politicians.csv"
df = pd.read_csv(dataset)
df.head()
"""
Explanation: <h1>Table of Contents<span clas... |
d-k-b/udacity-deep-learning | tensorboard/Anna_KaRNNa_Name_Scoped.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
dmolina/es_intro_python | 09-Errors-and-Exceptions.ipynb | gpl-3.0 | print(Q)
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="fig/cover-small.jpg">
This notebook contains an excerpt from the Whirlwind Tour of Python by Jake VanderPlas; the content is available on GitHub.
The text and code are released under the CC0 license; see also the compa... |
MarneeDear/softwarecarpentry | python lessons/Fundamentals/Functions.ipynb | mit | # a simple function that looks like a mathematical function
# define a function called add_two_numbers that take 2 arguments: num1 and num2
def add_two_numbers(num1, num2):
# Under the def must be indented
return num1 + num2 # use the return statment to tell the function what to return
"""
Explanation: Functio... |
google-research/rlds | rlds/examples/rlds_tfds_envlogger.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... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
P... |
enoordeh/StatisticalMethods | code/mc2_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: Efficient Sampling Sandbox
This notebook is for playing with different MCMC algorithms, given a few difficult posterior distributions, below.
Choose one of the speed-ups f... |
NlGG/various | mcmc.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pymc as pm2
import pymc3 as pm
import time
import math
import numpy.random as rd
import pandas as pd
from pymc3 import summary
from pymc3.backends.base import merge_traces
import theano.tensor as T
"""
Explanation: <p>参考にしました</p>
<p>http:/... |
oroszl/szamprob | notebooks/Package04/Interact.ipynb | gpl-3.0 | %pylab inline
from ipywidgets import * # az interaktivitásért felelős csomag
"""
Explanation: Interaktív függvények és ábrák
Az alábbiakban vizsgáljunk meg egy egyszerű módszert arra, hogy hogyan tehetjük Python-függvényeinket interaktívvá!
Ehhez az ipywidgets csomag lesz segítségünkre!
End of explanation
"""
t=lin... |
johntruckenbrodt/pyroSAR | datacube_prepare.ipynb | mit | from pyroSAR.datacube_util import Product, Dataset
from pyroSAR.ancillary import groupby, find_datasets
# define a directory containing processed SAR scenes
dir = '/path/to/some/data'
# define a name for the product YML; this is used for creating a new product in the datacube
yml_product = './product_def.yml'
# defi... |
fionapigott/Data-Science-45min-Intros | bandit-algorithms-101/bandit-algorithms-101.ipynb | unlicense | from IPython.display import Image
Image(filename='img/treat_aud_reward.jpg')
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
from numpy.random import binomial
from ggplot import *
import random
import sys
plt.figure(figsize=(6,6),dpi=80);
%matplotlib inli... |
molpopgen/fwdpy | docs/examples/views.ipynb | gpl-3.0 | from __future__ import print_function
import fwdpy as fp
import pandas as pd
from background_selection_setup import *
"""
Explanation: Example of taking 'views' from simulated populations
End of explanation
"""
mutations = [fp.view_mutations(i) for i in pops]
"""
Explanation: Get the mutations that are segregating ... |
thewtex/SimpleITK-Notebooks | 55_VH_Resample.ipynb | apache-2.0 | from __future__ import print_function
import matplotlib.pyplot as plt
%matplotlib inline
import SimpleITK as sitk
print(sitk.Version())
from myshow import myshow
# Download data to work on
from downloaddata import fetch_data as fdata
OUTPUT_DIR = "Output"
"""
Explanation: Resampling an Image onto Another's Physical ... |
buzmakov/tomography_scripts | tomo/yaivan/empty_frames.ipynb | mit | empty = plt.imread(data_root+'first_projection.tif').astype('float32')
corr = plt.imread(data_root+'first_projection_corr.tif').astype('float32')
tomo = plt.imread(data_root+'Raw/pin_2.24um_0000.tif').astype('float32')
white = np.fromfile(data_root+'white0202_2016-02-11.ffr',dtype='<u2').astype('float32').reshape((2096... |
ini-python-course/ss15 | notebooks/Avoiding numerical pitfalls.ipynb | mit | print repr(2-1.8)
print str(2-1.8)
"""
Explanation: Avoiding numerical pitfalls
The harmonic series is convergent in floating point arithmetics
\begin{align}
\sum_{n=1}^{\infty} \; \frac{1}{n} \quad = \quad 34.1220356680478715816207113675773143768310546875
\end{align}
(usually it is famously known to diverge to $\inft... |
HemantTiwariGitHub/AndroidNDSunshineProgress | HiddenMarkovModel_PoSTaggingFromScratch.ipynb | apache-2.0 | #Importing libraries
import nltk
import random
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import time
nltk.download('treebank')
nltk.download('universal_tagset')
# reading the Treebank tagged sentences
nltk_data ... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.reduce.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.reduce
Compute an equivalent automaton with a minimal number of states.
Preconditions:
- its labelset is free
- its weightset is a division ring or $\mathbb{Z}$.
Postconditions:
- the result is equivalent to the input automaton
- the result is both accessible and co-accessible
Ca... |
wehlutyk/brainscopypaste | notebooks/filter_evaluations.ipynb | gpl-3.0 | SAMPLE_SIZE = 100
"""
Explanation: Filter evaluations by precision-recall analysis
1 Setup
Flags and settings.
End of explanation
"""
from random import sample
from textwrap import indent, fill
import numpy as np
%cd -q ..
from brainscopypaste.conf import settings
%cd -q notebooks
from brainscopypaste.db import Cl... |
ljo/collatex-tutorial | unit3/CollateX.ipynb | gpl-3.0 | !pip install --pre --upgrade collatex
"""
Explanation: Collating for real with CollateX
Okay, let's do some serious hands-on collation.
First of all we want to make sure that you have the latest version of CollateX. That's why we do…
End of explanation
"""
from collatex import *
"""
Explanation: You don't need to d... |
rubennj/pvlib-python | docs/tutorials/tmy_and_diffuse_irrad_models.ipynb | bsd-3-clause | # built-in python modules
import os
import inspect
# scientific python add-ons
import numpy as np
import pandas as pd
# plotting stuff
# first line makes the plots appear in the notebook
%matplotlib inline
import matplotlib.pyplot as plt
# finally, we import the pvlib library
import pvlib
# Find the absolute file ... |
AnkitMalviya/Cognitive-Robot | notebooks/node_red_dsx_workflow.ipynb | apache-2.0 | !pip install websocket-client
"""
Explanation: Derive insights on Olympics data using Python Pandas
<font color='blue'> Expose an integration point using websockets for orchestration with Node-RED.</font>
1. Setup
To prepare your environment, you need to install some packages.
1.1 Install the necessary packages
You ne... |
farr/emcee | docs/_static/notebooks/parallel.ipynb | mit | import os
os.environ["OMP_NUM_THREADS"] = "1"
"""
Explanation: Parallelization
End of explanation
"""
import emcee
print(emcee.__version__)
"""
Explanation: With emcee, it's easy to make use of multiple CPUs to speed up slow sampling.
There will always be some computational overhead introduced by parallelization so... |
mobarski/sandbox | covid19/inverness_covid19_medical_care_bkp2.ipynb | mit | !pip install inverness
"""
Explanation: Notebook structure
Approach idea
Common section for all sub-tasks
Outcomes data for COVID-19 after mechanical ventilation adjusted for age -> results
Model recalculation
Approach idea
PROS
todo
todo
CONS
todo
todo
Common section for all sub-tasks
Installation of required p... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/cnrm-esm2-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'cnrm-esm2-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: CNRM-ESM2-1
Topic: Ocnbgchem
Sub-Topics: T... |
termanli/CLIOL | 你好,Colaboratory.ipynb | lgpl-3.0 | import tensorflow as tf
input1 = tf.ones((2, 3))
input2 = tf.reshape(tf.range(1, 7, dtype=tf.float32), (2, 3))
output = input1 + input2
with tf.Session():
result = output.eval()
result
#help(tf.reshape)
#help(tf.range)
#tf.range(1, 7, dtype=tf.float32)
#help(tf.reshape(tf.range(1, 10, dtype=tf.float32), (3, 3)))... |
y2ee201/Deep-Learning-Nanodegree | my-experiments/Autoencoders/Autoencoder Keras.ipynb | mit | import numpy as np
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import Adam
from sklearn.cross_validation import train_test_split
from PIL import Image
from matplotlib.pyplot import imshow
"""
Explanation: Simple Autoencoder using Keras
Autoencoders are models that try to co... |
probml/pyprobml | notebooks/book1/01/iris_dtree.ipynb | mit | # Python ≥3.5 is required
import sys
assert sys.version_info >= (3, 5)
# Scikit-Learn ≥0.20 is required
import sklearn
assert sklearn.__version__ >= "0.20"
# Common imports
import numpy as np
import os
import pandas as pd
from matplotlib.colors import ListedColormap
from sklearn.datasets import load_iris
import se... |
m3at/Labelizer | Labelizer_part2.ipynb | mit | %matplotlib inline
from __future__ import absolute_import
from __future__ import print_function
# import local library
import tools
import nnlstm
# import library to build the neural network
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.embeddings impor... |
0x4a50/udacity-0x4a50-deep-learning-nanodegree | 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... |
icrtiou/coursera-ML | ex6-SVM/3- search for the best parameters.ipynb | mit | mat = sio.loadmat('./data/ex6data3.mat')
print(mat.keys())
training = pd.DataFrame(mat.get('X'), columns=['X1', 'X2'])
training['y'] = mat.get('y')
cv = pd.DataFrame(mat.get('Xval'), columns=['X1', 'X2'])
cv['y'] = mat.get('yval')
print(training.shape)
training.head()
print(cv.shape)
cv.head()
"""
Explanation: loa... |
tensorflow/docs-l10n | site/es-419/tutorials/quickstart/advanced.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... |
biothings/biothings_explorer | jupyter notebooks/EXPLAIN_ACE2_hydroxychloroquine_demo.ipynb | apache-2.0 | !pip install git+https://github.com/biothings/biothings_explorer#egg=biothings_explorer
"""
Explanation: Introduction
This notebook demonstrates basic usage of BioThings Explorer, an engine for autonomously querying a distributed knowledge graph. BioThings Explorer can answer two classes of queries -- "PREDICT" and "E... |
OceanPARCELS/parcels | parcels/examples/tutorial_timevaryingdepthdimensions.ipynb | mit | %matplotlib inline
from parcels import FieldSet, ParticleSet, JITParticle, AdvectionRK4, ParticleFile, plotTrajectoriesFile
import numpy as np
from datetime import timedelta as delta
from os import path
"""
Explanation: Tutorial on how to use S-grids with time-evolving depth dimensions
Some hydrodynamic models (such a... |
suriyan/ethnicolr | ethnicolr/examples/ethnicolr_app_contrib20xx-census_ln.ipynb | mit | import pandas as pd
df = pd.read_csv('/opt/names/fec_contrib/contribDB_2000.csv', nrows=100)
df.columns
from ethnicolr import census_ln
"""
Explanation: Application: 2000/2010 Political Campaign Contributions by Race
Using ethnicolr, we look to answer three basic questions:
<ol>
<li>What proportion of contributions ... |
cranium/deep-learning | 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... |
sebp/scikit-survival | doc/user_guide/coxnet.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from sksurv.datasets import load_breast_cancer
from sksurv.linear_model import CoxPHSurvivalAnalysis, CoxnetSurvivalAnalysis
from sksurv.preprocessing import OneHotEncoder
from sklearn.model_selection import GridSearchCV, KFold
... |
kimkipyo/dss_git_kkp | Python 복습/12일차.금_Pandas의 고급기능_DB/12일차_4T_Pandas Basic (4) - 파일 입출력 ( csv, excel, sql ).ipynb | mit | -실제 엑셀 파일 데이터를 바탕으로 위의 것들을 다시 한 번 실습
-국가별 파일 입출력했음
번외로 수학계산을 해 볼 것이다. max, mean, min, sum
df = pd.DataFrame([{"Name": "KiPyo Kim", "Age": 29}, {"Name": "KiDong Kim", "Age": 33}])
df
# 옵션에 대해서만 알아가자
df.to_csv("fastcampus.csv")
df.to_csv("fastcampus.csv", index=False)
df.to_csv("fastcampus.csv", index=False, header=Fa... |
Yu-Group/scikit-learn-sandbox | benchmarks/examine_outputs_py.ipynb | mit | import py_irf_benchmarks_utils
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.insert(0, '../jupyter/utils')
from irf_jupyter_utils import _get_histogram
# recall output file
file_in = 'specs/iRF_mod01.yaml'
specs = py_irf_benchmarks_utils.yaml_to_dict(inp_yaml=file_in)
# specify output file
f... |
wasit7/book_pae | pae/nb/parallel forest.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt
import pickle
import os
%pylab inline
"""
Explanation: Parallel Forest Tutorial
This notebooke show the traing process of Parallel Random Forest. For cluster training please check https://github.com/wasit7/parallel_forest
import modules
Import all necessary modul... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch4-Problem_4-02.ipynb | unlicense | %pylab notebook
%precision 0
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 4
Problem 4-2
End of explanation
"""
Vl = 13.8e3 # [V]
PF = 0.9
Xs = 2.5 # [Ohm]
Ra = 0.2 # [Ohm]
P = 50e6 # [W]
Pf_w = 1.0e6 # [W]
Pcore = 1.5e6 # [W]
Pstray = 0 # [W]
n_m = 1800 # [r/mi... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/08_image/flowers_fromscratch_tpu.ipynb | apache-2.0 | %%bash
pip install apache-beam[gcp]
"""
Explanation: Flowers Image Classification with TensorFlow on Cloud ML Engine TPU
This notebook demonstrates how to do image classification from scratch on a flowers dataset using the Estimator API. Unlike flowers_fromscratch.ipynb, here we do it on a TPU.
Therefore, this will wo... |
YzPaul3/h2o-3 | h2o-py/demos/H2O_tutorial_eeg_eyestate.ipynb | apache-2.0 | import h2o
# Start an H2O Cluster on your local machine
h2o.init()
"""
Explanation: H2O Tutorial: EEG Eye State Classification
Author: Erin LeDell
Contact: erin@h2o.ai
This tutorial steps through a quick introduction to H2O's Python API. The goal of this tutorial is to introduce through a complete example H2O's capab... |
ralph-group/pymeasure | examples/Notebook Experiments/script2.ipynb | mit | %%writefile my_config.ini
[Filename]
prefix = my_data_
dated_folder = 1
directory = data
ext = csv
index =
datetimeformat = %Y%m%d_%H%M%S
[Logging]
console = 1
console_level = WARNING
filename = test.log
file_level = DEBUG
[matplotlib.rcParams]
axes.axisbelow = True
axes.prop_cycle = cycler('color', ['b', 'g', 'r', ... |
Upward-Spiral-Science/team1 | code/Assignment10_Emily.ipynb | apache-2.0 | plt.figure()
plt.figure(figsize=(28,7))
# x-direction
# sum up y-z plane at each x
plt.subplot(131)
unique_x = np.unique(csv_clean[:,0])
sum_x = [0]*len(unique_x)
i = 0
for x in unique_x:
sum_x[i] = np.sum(csv_clean[csv_clean[:,0] == x][4])*0.0001
i = i+1
plt.bar(unique_x, sum_x, 1)
plt.xlim(450, 3600)
plt.yla... |
peendebak/SPI-rack | examples/D5b.ipynb | mit | # Import SPI rack and D5b module
from spirack import SPI_rack, D5b_module
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
"""
Explanation: D5b example notebook
Example notebook of the D5b, 8 channel 18-bit module. The module contains the same DACs as in the 16 channel D5a m... |
hainm/mdtraj | examples/clustering.ipynb | lgpl-2.1 | from __future__ import print_function
%matplotlib inline
import mdtraj as md
import numpy as np
import matplotlib.pyplot as plt
import scipy.cluster.hierarchy
"""
Explanation: In this example, we cluster our alanine dipeptide trajectory using the RMSD distance metric and Ward's method.
End of explanation
"""
traj = ... |
jonathf/chaospy | docs/user_guide/fundamentals/quadrature_integration.ipynb | mit | import numpy
import chaospy
from problem_formulation import joint
joint
nodes = joint.sample(500, seed=1234)
weights = numpy.repeat(1/500, 500)
from matplotlib import pyplot
pyplot.scatter(*nodes)
pyplot.show()
"""
Explanation: Quadrature integration
Quadrature methods, or numerical integration, is broad class of... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/recommendation_systems/labs/1_content_based_by_hand.ipynb | apache-2.0 | !python3 -m pip freeze | grep tensorflow==2 || \
python3 -m pip --install tensorflow
"""
Explanation: Content Based Filtering by hand
This lab illustrates how to implement a content based filter using low level Tensorflow operations.
The code here follows the technique explained in Module 2 of Recommendation Engin... |
dwcaraway/intro-to-python-talk | python-intermediate.ipynb | unlicense | def say_hello():
print('hello, world!')
"""
Explanation: Python Course 2: Intermediate Python
Functions
Functions encapsulate repeatable code. They're defined with the def keyword
End of explanation
"""
say_hello()
def hi(name):
print('hi', name)
hi("pythonistas")
"""
Explanation: Functions are invoked us... |
jhamrick/original-nbgrader | examples/create_assignment/Assignment Template.ipynb | mit | def squares(n):
"""Compute the squares of numbers from 1 to n, such that the
ith element of the returned list equals i^2.
"""
{% if solution %}
if n < 1:
raise ValueError("n must be greater than or equal to 1")
return [i ** 2 for i in xrange(1, n + 1)]
{% else %}
# YOUR COD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.