repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
joommf/tutorial | workshops/Durham/reference/standard_problem3.ipynb | bsd-3-clause | import discretisedfield as df
import oommfc as oc
"""
Explanation: Micromagnetic standard problem 3
Authors: Marijan Beg, Ryan A. Pepper, and Hans Fangohr
Date: 12 December 2016
Problem specification
This problem is to calculate a single domain limit of a cubic magnetic particle. This is the size $L$ of equal energy f... |
piyueh/SEM-Toolbox | Huynh2007/check_fL_not_eq_f(uL).ipynb | mit | xi = quad.GaussJacobi(4).nodes
"""
Explanation: The coordinates of solution points using Gauss-Legendre quadrature points.
End of explanation
"""
Lk = poly.LagrangeBasis(xi)
"""
Explanation: The Lagrange basis using the Gauss-Legendre quadrature points.
End of explanation
"""
def u_exact(x):
'''exact solution... |
tensorflow/docs-l10n | site/en-snapshot/lattice/tutorials/keras_layers.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... |
tpin3694/tpin3694.github.io | machine-learning/preprocessing_iris_data.ipynb | mit | from sklearn import datasets
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
"""
Explanation: Title: Preprocessing Iris Data
Slug: preprocessing_iris_data
Summary: Preprocessing iris data using scikit learn.
Date: 2016-09-21 12:00
Category: Mach... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-2/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: TEST-INSTITUTE-2
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepp... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/solutions/als_bqml.ipynb | apache-2.0 | import os
import tensorflow as tf
PROJECT = "your-project-here" # REPLACE WITH YOUR PROJECT ID
# Do not change these
os.environ["PROJECT"] = PROJECT
os.environ["TFVERSION"] = '2.6'
%%bash
mkdir bqml_data
cd bqml_data
curl -O 'http://files.grouplens.org/datasets/movielens/ml-20m.zip'
unzip ml-20m.zip
yes | bq rm -r $P... |
trangel/Data-Science | deep_learning_ai/Tensorflow+Tutorial.ipynb | gpl-3.0 | import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict
%matplotlib inline
np.random.seed(1)
"""
Explanation: TensorFlow Tutorial
Welcome to this w... |
zerothi/ts-tbt-sisl-tutorial | A_03/run.ipynb | gpl-3.0 | # Create a Hall bar
"""
Explanation: Quantum Hall Effect
In this exercise, we will build on TB_07 to simulate the quantum hall effect.
Here, we will extract the Hall resistance from the transmissions calculated with TBtrans using the Landauer-Büttiker formalism.
Exercise Overview:
Create a Hall bar
Construct Hamilton... |
nick5435/Pokemon-Data-Analytics | Analytics2.ipynb | lgpl-3.0 | mons["AVERAGE_STAT"] = mons["STAT_TOTAL"]/6
gens = pd.Series([0 for i in range(len(mons.index))], index=mons.index)
for ID, mon in mons.iterrows():
if 0<mon.DEXID<=151:
gens[ID] = 1
elif 151<mon.DEXID<=251:
gens[ID] = 2
elif 251<mon.DEXID<=386:
gens[ID] = 3
elif 386<mon.DEXID<=4... |
phoebe-project/phoebe2-docs | 2.3/examples/sun_earth.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Sun-Earth System
NOTE: planets are currently under testing and not yet supported
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
imp... |
fabiencampillo/systemes_dynamiques_agronomie | 6.1_kalman_general.ipynb | gpl-3.0 | %matplotlib inline
from ipywidgets import interact, fixed
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
barZ = np.array([[1],[3]])
QZ = np.array([[3,1],[1,1]])
a = barZ[0]
b = QZ[0,0]
xx = np.linspace(-6, 10, 100)
R = QZ[0,0]-QZ[0,1]*QZ[0,1]/QZ[1,1]
def pltbayesgauss(obs):
hatX ... |
timothydmorton/isochrones | notebooks/triceratops_ebs.ipynb | mit | from isochrones import get_ichrone
mist = get_ichrone('mist', bands=['TESS', 'V', 'K'])
mass, age, feh = (0.8, 9.7, 0.0)
distance = 10 # pc
AV = 0.0
simulated_props = mist.generate(mass, age, feh, distance=distance, AV=AV)
simulated_props[['mass', 'radius', 'TESS_mag', 'V_mag', 'K_mag']]
"""
Explanation: Testing T... |
trangel/Data-Science | tmp/times-series.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib as plt
import seaborn as sns
users = pd.read_csv('timeseries_users.csv')
users.head()
events = pd.read_csv('timeseries_events.csv')
events.index = pd.to_datetime(events['event_date'], format='%Y-%m-%d %H:%M:%S')
del events['event_date']
even... |
ethen8181/machine-learning | trees/random_forest.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', 'notebook_format'))
from formats import load_style
load_style(css_style = 'custom2.css', plot_style = False)
os.chdir(path)
# 1. magic for inline plot
# ... |
liangjg/openmc | examples/jupyter/candu.ipynb | mit | %matplotlib inline
from math import pi, sin, cos
import numpy as np
import openmc
"""
Explanation: In this example, we will create a typical CANDU bundle with rings of fuel pins. At present, OpenMC does not have a specialized lattice for this type of fuel arrangement, so we must resort to manual creation of the array ... |
metpy/MetPy | dev/_downloads/0c4829bf9f81fa07605c78ac7049bb69/spc_convective_outlook.ipynb | bsd-3-clause | import geopandas
from metpy.cbook import get_test_data
from metpy.plots import MapPanel, PanelContainer, PlotGeometry
"""
Explanation: NOAA SPC Convective Outlook
Demonstrate the use of geoJSON and shapefile data with PlotGeometry in MetPy's simplified
plotting interface. This example walks through plotting the Day 1... |
ctk3b/msibi | msibi/tutorials/propane/propane.ipynb | mit | import itertools
import string
import os
import numpy as np
from msibi import MSIBI, State, Pair, mie
"""
Explanation: Propane Tutorial
Created by Davy Yue 2017-06-14
Imports
End of explanation
"""
os.system('rm rdfs/pair_C3*_state*-step*.txt f_fits.log')
os.system('rm state_*/*.txt state*/run.py state*/*query.dcd... |
GoogleCloudPlatform/gcp-getting-started-lab-jp | machine_learning/cloud_ai_building_blocks/conversation_ja.ipynb | apache-2.0 | import getpass
APIKEY = getpass.getpass()
"""
Explanation: <a href="https://colab.research.google.com/github/GoogleCloudPlatform/gcp-getting-started-lab-jp/blob/master/machine_learning/cloud_ai_building_blocks/conversation_ja.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" a... |
dewitt-li/deep-learning | 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'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
VVard0g/ThreatHunter-Playbook | docs/tutorials/jupyter/notebooks/03_intro_to_pandas.ipynb | mit | 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... |
AMICI-developer/AMICI | python/examples/example_constant_species/ExampleEquilibrationLogic.ipynb | bsd-2-clause | from IPython.display import Image
fig = Image(filename=('../../../documentation/gfx/steadystate_solver_workflow.png'))
fig
"""
Explanation: AMICI documentation example of the steady state solver logic
This is an example to document the internal logic of the steady state solver, which is used in preequilibration and po... |
yingchi/fastai-notes | deeplearning1/nbs/lesson4.ipynb | apache-2.0 | ratings = pd.read_csv(path+'ratings.csv')
ratings.head()
len(ratings)
"""
Explanation: Set up data
We're working with the movielens data, which contains one rating per row, like this:
End of explanation
"""
movie_names = pd.read_csv(path+'movies.csv').set_index('movieId')['title'].to_dict()
users = ratings.userId.... |
ES-DOC/esdoc-jupyterhub | notebooks/fio-ronm/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', 'fio-ronm', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: FIO-RONM
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Glaciers, Ice.
Pro... |
schaber/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
spulido99/NetworksAnalysis | DiderGonzalez/Ejercicios 1.1/Ejercicios 1.1 - Graphs, Paths & Components.ipynb | mit | edges = set([(1, 2), (3, 1), (3, 2), (2, 4)])
import networkx as nx
G=nx.Graph() #Se crea un grafo vacio y no dirigido
G.add_edges_from(edges)
G2=nx.DiGraph() #Se crea un grafo vacio y no dirigido
G2.add_edges_from(edges)
numNodes = G.number_of_nodes()
numEdges = G.number_of_edges() # el grafo se creo no dirigido, la ... |
d-li14/CS231n-Assignments | assignment3-winter1516/ImageGradients.ipynb | gpl-3.0 | # As usual, a bit of setup
import time, os, json
import numpy as np
import skimage.io
import matplotlib.pyplot as plt
from cs231n.classifiers.pretrained_cnn import PretrainedCNN
from cs231n.data_utils import load_tiny_imagenet
from cs231n.image_utils import blur_image, deprocess_image
%matplotlib inline
plt.rcParams... |
ToqueWillot/M2DAC | FDMS/TME3/Model_V5-Flo.ipynb | gpl-2.0 | # from __future__ import exam_success
from __future__ import absolute_import
from __future__ import print_function
# Standard imports
%matplotlib inline
import os
import sklearn
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import random
import pandas as pd
import scipy.stats as stats
# Sk ... |
sdpython/ensae_teaching_cs | _doc/notebooks/1a/structures_donnees_conversion.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.1 - D'une structure de données à l'autre
Ce notebook s'amuse à passer d'une structure de données à une autre, d'une liste à un dictionnaire, d'une liste de liste à un dictionnaire, avec toujours les mêmes données : list, dict, tuple.
E... |
drpjm/udacity-mle-project2 | student_intervention/student_intervention.ipynb | mit | # Import libraries
%matplotlib inline
import numpy as np
import pandas as pd
import sklearn as skl
import matplotlib.pyplot as plt
# Read student data
student_data = pd.read_csv("student-data.csv")
print "Student data read successfully!"
# Note: The last column 'passed' is the target/label, all other are feature colu... |
AnthonyD973/swarmlist-list-based | src/statistics/analysis.ipynb | mit | %%bash
if [ ! -e "$BUILD_DIR/experiment" ]
then
ARCHIVE="$SRC_DIR/statistics/results.tbz"
mkdir -p "$BUILD_DIR"
mkdir -p "$GRAPH_DIR"
tar -xjf "$ARCHIVE" -C "$BUILD_DIR"
fi
"""
Explanation: Data fetching
Extract bzipped result. One may put their own results under <git's root>/build/experi... |
OCDX/article-quality | src/generate_monthly_datasets.ipynb | mit | from ipynb.fs.full.article_quality.db_monthly_stats import DBMonthlyStats, dump_aggregation
"""
Explanation: Database-based monthly stats
In this notebook, we'll use a database table to aggregate monthly article quality scores. We'll be using an SQL query to do the aggregation, writing the aggregated data out to a fi... |
gtfierro/cs262-project | evaluation/single_node/Single Node Benchmark.ipynb | bsd-3-clause | FILENAME="data/10_pub_sub_pairs.csv"
df = parse_and_plot(FILENAME)
df.describe()
"""
Explanation: Forwarding Latency
It is being run from a desktop computer on the UC Berkeley network w/ avg ping latency of 5.03ms to a single broker running on EC2 running in standalone mode.
Pairs
10 pairs of pub/sub that share a quer... |
vzg100/Post-Translational-Modification-Prediction | old/Tyrosine Phosphorylation Example.ipynb | mit | from pred import Predictor
from pred import sequence_vector
"""
Explanation: Example of using ptm_pred to prototype phosphorylation classifiers
Histadine Phosphorylation is a quick place to start, not much data though. However, that means the code runs much faster.
Predictor is the class which handles reading the dat... |
DBWangGroupUNSW/COMP9318 | L3 - Preprocessing.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Data Preprocessing with Pandas
Import Modules
End of explanation
"""
df = pd.read_csv('./asset/Median Price of Established House Transfers.txt', sep='\t') # row 3 has a null value
df.head()
"""
Explanation: I... |
GPflow/GPflowOpt | doc/source/notebooks/firststeps.ipynb | apache-2.0 | import numpy as np
from gpflowopt.domain import ContinuousParameter
def branin(x):
x = np.atleast_2d(x)
x1 = x[:, 0]
x2 = x[:, 1]
a = 1.
b = 5.1 / (4. * np.pi ** 2)
c = 5. / np.pi
r = 6.
s = 10.
t = 1. / (8. * np.pi)
ret = a * (x2 - b * x1 ** 2 + c * x1 - r) ** 2 + s * (1 - t) *... |
jldbc/pybaseball | EXAMPLES/imputed_derivation.ipynb | mit | from pybaseball import statcast, utils
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pybaseball.plotting import plot_bb_profile
"""
Explanation: Isolate Imputations
An inital approach to isolate imputations was to copy and paste from the related article on Fangraphs. This notebook serves ... |
NuGrid/NuPyCEE | ChETEC_school/GCE Lab 1 - Solar Composition - Elemental Abundance Pattern.ipynb | bsd-3-clause | # Import the OMEGA+ code and standard packages
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
# Two-zone galactic chemical evolution code
import JINAPyCEE.omega_plus as omega_plus
# Run scripts for this notebook
%run script_solar_ab.py
# Matplotlib option
%matplotlib inline
"""
Explanation: GC... |
philmui/datascience2016fall | lecture05.viz.data.shaping/lecture05.data.shaping.ipynb | mit | import numpy as np
from pandas import Series, DataFrame
import pandas as pd
df1 = DataFrame({'key': ['b', 'b', 'a', 'c', 'a', 'a', 'b'],
'data1': range(7)})
df2 = df2 = DataFrame({'key': ['a', 'b', 'd'],
'data2': range(3)})
df1
df2
"""
Explanation: Shaping Data
Much of the pr... |
jwlockhart/data_workshops | ICOS_data_camp/ICOS Big Data Camp Data Analysis.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
import statsmodels.formula.api as smf
# This makes it so that plots show up here in the notebook.
# You do not need it if you are not using a notebook.
%matplotlib inline
from IPython.display import Image
"""
Explanat... |
sylvchev/coursIntroPython | cours/3-ApprendrePython-Structures.ipynb | gpl-3.0 | ma_liste = [66.6, 333, 333, 1, 1234.5]
print (ma_liste.count(333), ma_liste.count(66.6), ma_liste.count('x'))
ma_liste2 = list(ma_liste)
ma_liste2.sort()
print (ma_liste2)
ma_liste.insert(2, -1)
ma_liste.append(333)
ma_liste
ma_liste.index(333)
ma_liste.remove(333)
print(ma_liste)
ma_liste.reverse()
ma_liste
ma... |
mne-tools/mne-tools.github.io | 0.19/_downloads/804ea48504b27f5f04fd03d517675af5/plot_point_spread.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import mne
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, apply_inverse
from mne.simulation import simulate_stc, simulate_evoked
"""
Explanation: Corrupt known signal with point spread
The aim of this tutorial is to demonstrate how to put ... |
SolitonScientific/AtomicString | AFIntegrals.ipynb | mit | import numpy as np
import pylab as pl
pl.rcParams["figure.figsize"] = 9,6
###################################################################
##This script calculates the values of Atomic Function up(x) (1971)
###################################################################
################### One Pulse of atomic ... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/3a_bqml_baseline_babyweight.ipynb | apache-2.0 | %%bash
sudo pip freeze | grep google-cloud-bigquery==1.6.1 || \
sudo pip install google-cloud-bigquery==1.6.1
"""
Explanation: LAB 3a: BigQuery ML Model Baseline.
Learning Objectives
Create baseline model with BQML
Evaluate baseline model
Calculate RMSE of baseline model
Introduction
In this notebook, we will creat... |
blankon123/skripsi-news-classification | Skripsi- Parsing Engine.ipynb | mit | import feedparser
import sys
import time
from pymongo import MongoClient
"""
Explanation: Skripri - Feed Parsing Engine
Proses Pertama, inisialisasi link
Ceritanya list sudah ada di collection MongoLab, tetapi untuk testing digunakan inisiasi link manual
End of explanation
"""
# server = 'localhost'
# port = 27017
#... |
Autoplectic/dit | examples/hypothesis.ipynb | bsd-3-clause | from hypothesis import find
import dit
from dit.abc import *
from dit.pid import *
from dit.utils.testing import distribution_structures
dit.ditParams['repr.print'] = dit.ditParams['print.exact'] = True
"""
Explanation: Using hypothesis to find interesting examples
Hypothesis is a powerful and unique library for tes... |
robblack007/clase-dinamica-robot | Clases/.ipynb_checkpoints/Dinamica SCARA-checkpoint.ipynb | mit | from sympy import var, sin, cos, Matrix, Integer, eye, Function, Rational, exp, Symbol, I, solve, pi, trigsimp, dsolve, sinh, cosh, simplify
from sympy.physics.mechanics import mechanics_printing
mechanics_printing()
"""
Explanation: Dinámica del Robot Manipulador SCARA
Se tiene un robot manipulador tipo SCARA, como e... |
clintpgeorge/tutorials | exploratory-data-analysis/Exploratory-Data-Analysis-Fall-2016-student.ipynb | gpl-3.0 | # We will first read the wine data headers
f = open("wine.data")
header = f.readlines()[0]
"""
Explanation: Exploratory Data Analysis
In this tutorial we focus on two popular methods for exploring high dimensional datasets.
Principal Component Analysis
Latent Semantic Analysis
The first method is a general scheme... |
davidhamann/python-fmrest | examples/conf_dotfmp_2018.ipynb | mit | import fmrest
fmrest.__version__
"""
Explanation: An Introduction to python-fmrest (dotfmp demo)
python-fmrest is a wrapper around the FileMaker Data API.
No need to worry about manually requesting access tokens, setting the right http headers, parsing responses, ...
Use cases
Some things you may use the python-fmres... |
opesci/tutorial-hands-on | 02a_fwi.ipynb | mit | import numpy as np
%matplotlib inline
from devito import configuration
configuration['log_level'] = 'WARNING'
"""
Explanation: Full-Waveform Inversion (FWI)
This notebook is the third in a series of tutorial highlighting various aspects of seismic inversion based on Devito operators. In this second example we aim to ... |
tensorflow/docs-l10n | site/ko/tutorials/images/cnn.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... |
utensil/julia-playground | dl/hello_nn_vis.ipynb | mit | import tensorflow as tf
g = tf.Graph()
with g.as_default():
a = tf.placeholder(tf.float32, name="a")
b = tf.placeholder(tf.float32, name="b")
c = a + b
[node.name for node in g.as_graph_def().node]
g.as_graph_def().node[2].input
%%bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get instal... |
sjschmidt44/bike_share | bike_share_data.ipynb | mit | from pandas import Series, DataFrame
import pandas as pd
import numpy as np
weather = pd.read_table('daily_weather.tsv')
stations = pd.read_table('stations.tsv')
usage = pd.read_table('usage_2012.tsv')
newseasons = {'Summer': 'Spring', 'Spring': 'Winter', 'Fall': 'Summer', 'Winter': 'Fall'}
weather['season_desc'... |
kvr777/deep-learning | batch-norm/Batch_Normalization_Lesson.ipynb | mit | # Import necessary packages
import tensorflow as tf
import tqdm
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Import MNIST data so we have something for our experiments
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
"... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/solutions/basic_ranking.ipynb | apache-2.0 | !pip install -q tensorflow-recommenders
!pip install -q --upgrade tensorflow-datasets
"""
Explanation: Recommending movies: ranking
Learning Objectives
Get our data and split it into a training and test set.
Implement a ranking model.
Fit and evaluate it.
Introduction
The retrieval stage is responsible for selecting... |
Housebeer/Natural-Gas-Model | .ipynb_checkpoints/Matching Market v2-checkpoint.ipynb | mit | %matplotlib inline
import random as rnd
import pandas as pd
class Seller():
wta = []
def __init__(self,name):
self.name = name
# the supplier has n quantities that they can sell
# they may be willing to sell this quantity anywhere from a lower price of l
# to a higher price of u
de... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_artifacts_correction_maxwell_filtering.ipynb | bsd-3-clause | import mne
from mne.preprocessing import maxwell_filter
data_path = mne.datasets.sample.data_path()
"""
Explanation: Artifact correction with Maxwell filter
This tutorial shows how to clean MEG data with Maxwell filtering.
Maxwell filtering in MNE can be used to suppress sources of external
intereference and compensa... |
ankitpandey2708/ml | recommender-system/ml-1m/model.ipynb | mit | import pandas as pd
import numpy as np
r_cols = ['user_id', 'movie_id', 'rating']
m_cols = ['movie_id', 'title', 'genres']
ratings_df = pd.read_csv('ratings.dat',sep='::', names=r_cols, engine='python', usecols=range(3), dtype = int)
movies_df = pd.read_csv('movies.dat', sep='::', names=m_cols, engine='python')
movie... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_time_frequency_simulated.ipynb | bsd-3-clause | # Authors: Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from mne import create_info, EpochsArray
from mne.time_frequency import tfr_multitaper, tfr_stockwell, tfr_morlet
print(__doc__)
"""
Explanation: =================... |
austinjalexander/sandbox | python/py/nanodegree/intro_ds/final_project/IntroDS-ProjectOne-Section1.ipynb | mit | import inflect # for string manipulation
import numpy as np
import pandas as pd
import scipy as sp
import scipy.stats as st
import matplotlib.pyplot as plt
%matplotlib inline
filename = '/Users/excalibur/py/nanodegree/intro_ds/final_project/improved-dataset/turnstile_weather_v2.csv'
# import data
data = pd.read_csv(f... |
dawenl/content_wmf | code/processTasteProfile.ipynb | mit | # tid2sid.json contains a mapping between track id and song id, which can obtained from track_metadata.db
with open('tid2sid.json', 'r') as f:
tid2sid = json.load(f)
bad_audio = []
with open('tracks_bad_audio.txt', 'r') as f:
for line in f:
bad_audio.append(line.strip())
bad_sid = [tid2sid[k] for k i... |
jasdumas/jasdumas.github.io | post_data/KMEANS-POKER-ANALYSIS.ipynb | mit | # read training and test data from the url link and save the file to your working directory
url = "http://archive.ics.uci.edu/ml/machine-learning-databases/poker/poker-hand-training-true.data"
urllib.request.urlretrieve(url, "poker_train.csv")
url2 = "http://archive.ics.uci.edu/ml/machine-learning-databases/poker/pok... |
Pittsburgh-NEH-Institute/Institute-Materials-2017 | schedule/week_2/Integrating_XML_with_Python.ipynb | gpl-3.0 | import nltk
# nltk.download()
"""
Explanation: Integrating XML with Python
NLTK, the Python Natural Languge ToolKit package, is designed to work with plain text input, but sometimes your input is in XML. There are two principal paths to reconciliation: either use an XML environment that supports NLP (natural language ... |
jkibele/OpticalRS | docs/notebooks/depth/LyzengaDepth.ipynb | bsd-3-clause | %pylab inline
import geopandas as gpd
import pandas as pd
from OpticalRS import *
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from sklearn.cross_validation import train_test_split
import itertools
import statsmodels.formula.api as smf
from collections import OrderedD... |
econandrew/povcalnetjson | notebooks/3-empirical-splines.ipynb | mit | # Choose our lorenz curve. India is:
# with open("../jsoncache/IND_5_2011.5_0.json", "r") as f:
# Good ones
# IND_2_1977.5.json
# MYS_3_1997.json
# CHN_1_1999.json
# JAM_3_1988.json
with open("../jsoncache/CHL_3_2003.json", "r") as f:
d = json.loads(f.read())
L = [0.0] + d['lorenz']['L']
p = [0.0] + d['lorenz'][... |
mne-tools/mne-tools.github.io | 0.19/_downloads/7cf7296709bf473b6e7fed6bc98287be/plot_ems_filtering.ipynb | bsd-3-clause | # Author: Denis Engemann <denis.engemann@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io, EvokedArray
from mne.datasets import sample
from mne.decoding import EMS, compute_ems
from sklearn.model_... |
probml/pyprobml | notebooks/misc/bnn_mnist_sgld_jaxbayes.ipynb | mit | %%capture
!pip install git+https://github.com/deepmind/dm-haiku
!pip install git+https://github.com/jamesvuc/jax-bayes
import haiku as hk
import jax.numpy as jnp
from jax.experimental import optimizers
import jax
import jax_bayes
import sys, os, math, time
import numpy as onp
import numpy as np
from functools impor... |
zakandrewking/cobrapy | documentation_builder/simulating.ipynb | lgpl-2.1 | import cobra.test
model = cobra.test.create_test_model("textbook")
"""
Explanation: Simulating with FBA
Simulations using flux balance analysis can be solved using Model.optimize(). This will maximize or minimize (maximizing is the default) flux through the objective reactions.
End of explanation
"""
solution = mode... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_brainstorm_auditory.ipynb | bsd-3-clause | # Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
import os.path as op
import pandas as pd
import numpy as np
import mne
from mne import combine_evoked
from mne.minimum_norm impor... |
AllenDowney/ModSimPy | notebooks/chap11.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
xmnlab/notebooks | probability/LeaPkgStudies.ipynb | mit | from IPython.display import display, HTML
from nxpd import draw
import networkx as nx
def draw_graph(
graph, labels=None
):
# create networkx graph
G = nx.DiGraph()
G.graph['dpi'] = 120
G.add_nodes_from(set([
graph[k1][k2]
for k1 in range(len(graph))
for k2 in range(len(... |
GoogleCloudPlatform/practical-ml-vision-book | 07_training/07b_gpumax.ipynb | apache-2.0 | import tensorflow as tf
print('TensorFlow version' + tf.version.VERSION)
print('Built with GPU support? ' + ('Yes!' if tf.test.is_built_with_cuda() else 'Noooo!'))
print('There are {} GPUs'.format(len(tf.config.experimental.list_physical_devices("GPU"))))
device_name = tf.test.gpu_device_name()
if device_name != '/devi... |
halimacc/CS231n-assignments | assignment2/ConvolutionalNetworks.ipynb | unlicense | # As usual, a bit of setup
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.cnn import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient
from cs231n.layers import *
fro... |
MelroLeandro/Matematica-Discreta-para-Hackers | jpynb_source/Chapter1_Introducao/.ipynb_checkpoints/Chapter1_Introducao-checkpoint.ipynb | gpl-2.0 | 2+2
"""
Explanation: Matemática Discreta para Hackers
Version 0.1
Bem vindo a Matemática Discreta para Hackers. O repositório Github está desponivel em github/Matematica-Discreta-e-Programacao-Usando-Python. Esperamos que goste deste livro, e encorajamos que contribuira na sua melhoria!
Capítulo 1
Python
A linguagem... |
ngoldschlag/HighTechIndustries | CalculateHT.ipynb | gpl-3.0 | # import libraries
import pandas as pd
import numpy as np
# data paths
xwalkPath = ''
blsPath = ''
"""
Explanation: High Tech Industries (STEM Concentration)
This notebook uses BLS Industry-Occupation employment data to identify a set of High Tech industries according to the methodology in Hecker (2005). The resultin... |
zambzamb/zpic | zdf/legacy/zdf_view.ipynb | agpl-3.0 | from zdf import zdf_read_grid, zdf_read_particles
"""
Explanation: Plotting ZDF data files
To Plot ZDF data files you must first import the ZDF module
End of explanation
"""
(data, info) = zdf_read_grid( "J3-000500.zdf" )
"""
Explanation: Next you need to read the data. You should also read the metadata while you a... |
rmcgibbo/mdtraj | examples/solvent-accessible-surface-area.ipynb | lgpl-2.1 | from __future__ import print_function
%matplotlib inline
import numpy as np
import mdtraj as md
"""
Explanation: In this example, we'll compute the solvent accessible surface area of one of the residues in our protien
accross each frame in a MD trajectory. We're going to use our trustly alanine dipeptide trajectory fo... |
willingc/jupyter-data-seeker | JupyterDataSeeker.ipynb | gpl-2.0 | import github3
"""
Explanation: Jupyter Data Seeker
This notebook uses the github3py project maintained by Ian Cordasco.
This notebook is a starter notebook for finding information about repositories that are managed by the Jupyter team. Repos are from the Jupyter and IPython GitHub organizations.
End of explanation
"... |
Pretendi/Team_Jimmy_Paul | pcube.ipynb | mit | %matplotlib inline
import os
import datetime as dt
import numpy as np
import pandas as pd
import statsmodels as sm
from IPython.display import display, HTML
import matplotlib.pyplot as plt
"""
Explanation: <span style="color: #f2cf4a ; font-family: Babas; font-size: 3em;">$$P^3$$</span>
<center> <span style="color: ... |
tensorflow/neural-structured-learning | workshops/kdd_2020/graph_regularization_pheme_natural_graph.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 u... |
lpfann/fri | docs/Guide.ipynb | mit | import numpy as np
# fixed Seed for demonstration
STATE = np.random.RandomState(123)
from fri import genClassificationData
"""
Explanation: Quick start guide
Installation
Stable
Fri can be installed via the Python Package Index (PyPI).
If you have pip installed just execute the command
pip install fri
to get the new... |
MicrosoftGenomics/PySnpTools | doc/ipynb/tutorial.ipynb | apache-2.0 | # set some ipython notebook properties
%matplotlib inline
# set degree of verbosity (adapt to INFO for more verbose output)
import logging
logging.basicConfig(level=logging.WARNING)
# set figure sizes
import pylab
pylab.rcParams['figure.figsize'] = (10.0, 8.0)
"""
Explanation: PySnpTools Tutorial
Step up notebook
En... |
google/starthinker | colabs/kv_uploader.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: Tag Key Value Uploader
A tool for bulk editing key value pairs for CM placements.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... |
maxvogel/NetworKit-mirror2 | Doc/Notebooks/NetworKit_Tutorial_Part_4.ipynb | mit | from networkit import *
%matplotlib inline
cd ~/workspace/NetworKit
G = readGraph("input/PGPgiantcompo.graph", Format.METIS)
# Code for 7-1)
# exact computation
# Code for 7-2)
# approximate computation
"""
Explanation: Tutorial "Algorithmic Methods for Network Analysis with NetworKit" (Part 4)
Determining Impo... |
GoogleCloudPlatform/mlops-on-gcp | workshops/kfp-caip-sklearn/lab-03-kfp-cicd/lab-03.ipynb | apache-2.0 | ENDPOINT = '<YOUR_ENDPOINT>'
PROJECT_ID = !(gcloud config get-value core/project)
PROJECT_ID = PROJECT_ID[0]
"""
Explanation: CI/CD for a KFP pipeline
Learning Objectives:
1. Learn how to create a custom Cloud Build builder to pilote CAIP Pipelines
1. Learn how to write a Cloud Build config file to build and push all ... |
mamrehn/machine-learning-tutorials | ipynb/[scikit-learn] first steps.ipynb | cc0-1.0 | import numpy; print('numpy:\t', numpy.__version__, sep='\t')
import scipy; print('scipy:\t', scipy.__version__, sep='\t')
import matplotlib; print('matplotlib:', matplotlib.__version__, sep='\t')
import sklearn; print('scikit-learn:', sklearn.__version__, sep='\t')
"""
Explanation: This is a quick tutoria... |
danresende/deep-learning | sentiment_network/Sentiment Classification - Project 3 Solution.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
brockk/clintrials | tutorials/matchpoint/Ambivalence.ipynb | gpl-3.0 | import numpy as np
from scipy.stats import norm
from clintrials.dosefinding.efftox import EffTox, LpNormCurve
real_doses = [7.5, 15, 30, 45]
trial_size = 30
cohort_size = 3
first_dose = 3
prior_tox_probs = (0.025, 0.05, 0.1, 0.25)
prior_eff_probs = (0.2, 0.3, 0.5, 0.6)
tox_cutoff = 0.40
eff_cutoff = 0.45
tox_certaint... |
astarostin/MachineLearningSpecializationCoursera | course1/week4/CentralLimitTheoremTask.ipynb | apache-2.0 | gilbrat_rv = sts.gilbrat()
sample = gilbrat_rv.rvs(1000)
"""
Explanation: Возьмем для исследования распределение Гилбрата. Сгенерируем выборку объема 1000.
End of explanation
"""
plt.hist(sample, bins = 15, normed=True)
plt.ylabel('$f(x)$, number of samples')
plt.xlabel('$x$')
x = np.linspace(0,15,1000)
pdf = gilbr... |
podondra/bt-spectraldl | notebooks/00-spectroscopy.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import astropy.analytic_functions
import astropy.io.fits
import matplotlib.pyplot as plt
wavelens = np.linspace(100, 30000, num=1000)
temperature = np.array([5000, 4000, 3000]).reshape(3, 1)
with np.errstate(all='ignore'):
flux_lam = astropy.analytic_functions.blackbody_lambd... |
a301-teaching/a301_code | notebooks/resample.ipynb | mit | import h5py
from a301lib.geolocate import find_corners
import numpy as np
import pyproj
import pyresample
from pyresample import kd_tree,geometry
from pyresample.plot import area_def2basemap
from matplotlib import pyplot as plt
from a301utils.modismeta_read import parseMeta
from a301utils.a301_readfile import download
... |
mromanello/SunoikisisDC_NER | Sunoikisis - Named Entity Extraction 2a-FM.ipynb | gpl-3.0 | from idai_journals import nlp as dainlp
import re
from treetagger import TreeTagger
from nltk.tag import StanfordNERTagger
from nltk.chunk.util import tree2conlltags
from nltk.chunk import RegexpParser
from nltk.tree import Tree
from nltk.tag import StanfordNERTaggelr
"""
Explanation: Table of Contents
<p><div class=... |
neto71/courses-1 | lesson1.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Using Convolutional Neural Networks
Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning.
Introduction to this week's task: 'Do... |
Neuroglycerin/neukrill-net-work | notebooks/model_run_and_result_analyses/Revisiting alexnet based experiment with 64 inputs (small).ipynb | mit | tr = np.array(model.monitor.channels['valid_y_y_1_nll'].time_record) / 3600.
fig = plt.figure(figsize=(12,8))
ax1 = fig.add_subplot(111)
ax1.plot(model.monitor.channels['valid_y_y_1_nll'].val_record)
ax1.plot(model.monitor.channels['train_y_y_1_nll'].val_record)
ax1.plot(model_no_mom.monitor.channels['valid_y_y_1_nll']... |
teresaborcuch/teresaborcuch.github.io | notebooks/second_blog_post.ipynb | mit | from articledata import *
data = ArticleData().call()
import pickle
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from datetime import datetime, timedelta
import numpy as np
data = pd.read_pickle('/Users/teresaborcuch/capstone_project/notebooks/pickled_data.pkl')
data.shape
data.head(1)... |
Diyago/Machine-Learning-scripts | statistics/Биномиальный критерий для доли stat.binomial_test.ipynb | apache-2.0 | import numpy as np
from scipy import stats
%pylab inline
"""
Explanation: Биномиальный критерий для доли
End of explanation
"""
n = 16
n_samples = 1000
samples = np.random.randint(2, size = (n_samples, n))
t_stat = map(sum, samples)
values = list(t_stat)
pylab.hist(values, bins = 16, color = 'b', range = (0, 16),... |
quantopian/research_public | notebooks/lectures/Means/notebook.ipynb | apache-2.0 | # Two useful statistical libraries
import scipy.stats as stats
import numpy as np
# We'll use these two data sets as examples
x1 = [1, 2, 2, 3, 4, 5, 5, 7]
x2 = x1 + [100]
print 'Mean of x1:', sum(x1), '/', len(x1), '=', np.mean(x1)
print 'Mean of x2:', sum(x2), '/', len(x2), '=', np.mean(x2)
"""
Explanation: Measur... |
ShinjiKatoA16/UCSY-sw-eng | python-1.ipynb | mit | print(1)
print('hello')
# please add something here ...
"""
Explanation: Fundamentals of Python
Object and Variable
Everything (inclulding function) is an object in Python. Each object has type and optionally its own methods.
Variable is not declared in Python. Variable does not have type but refers object.
Clause (B... |
peastman/deepchem | examples/tutorials/Introduction_To_Material_Science.ipynb | mit | !pip install --pre deepchem
"""
Explanation: Introduction To Material Science
Table of Contents:
Introduction
Setup
Featurizers
Crystal Featurizers
Compound Featurizers
Datasets
Predicting structural properties of a crystal
Further Reading
Introduction <a class="anchor" id="introduction"></a>
One of the most excit... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_18.ipynb | mit | # 1. Input model parameters and print
parameters = pd.Series()
parameters['rho'] = .75
parameters['sigma'] = 0.006
parameters['alpha'] = 0.35
parameters['delta'] = 0.025
parameters['beta'] = 0.99
print(parameters)
# 2. Compute the steady state of the model directly
A = 1
K = (parameters.alpha*A/(parameters.beta**-1+pa... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/06_structured/4_preproc.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
pip install --user apache-beam[gcp]==2.16.0
"""
Explanation: <h1> Preprocessing using Dataflow </h1>
This notebook illustrates:
<ol>
<li> Creating datasets for Machine Learning using Dataflow
</ol>
<p>
While Pandas is fine for experimenting, for oper... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.