repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
kwant-project/kwant-tutorial-2016 | 3.2.Quantum-Hall-effect-and-disorder.ipynb | bsd-2-clause | import kwant
from kwant.digest import uniform # a (deterministic) pseudorandom number generator
%run matplotlib_setup.ipy
import numpy as np
from cmath import exp
from types import SimpleNamespace
"""
Explanation: Quantum Hall effect and disorder
Magnetic field
What does a magnetic field do to electrons?
Electron... |
tensorflow/docs | site/en/guide/tensor_slicing.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... |
wanderer2/pymc3 | docs/source/notebooks/BEST.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pymc3 as pm
import pandas as pd
import seaborn as sns
sns.set(color_codes=True)
np.random.seed(20090425)
drug = (101,100,102,104,102,97,105,105,98,101,100,123,105,103,100,95,102,106,
109,102,82,102,100,102,102,101,102,102,103,103,97,97,103,101,97,104,
96,10... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_stats_cluster_time_frequency.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.time_frequency import single_trial_power
from mne.stats import permutation_cluster_test
from mne.datasets import sample
print(_... |
molgor/spystats | notebooks/Sandboxes/TensorFlow/.ipynb_checkpoints/GPFlow_examples-checkpoint.ipynb | bsd-2-clause | ## Import modules
import numpy as np
import scipy.spatial.distance as sp
from matplotlib import pyplot as plt
plt.style.use('ggplot')
## Parameter definitions
N = 1000
phi = 0.05
sigma2 = 1.0
beta_0 = 10.0
beta_1 = 1.5
beta_2 = -1.0
# AL NAGAT
nugget = 0.03
"""
Explanation: GPFlow first approximation
End of explanati... |
aidiary/notebooks | tensorflow/170614-oreilly-gan-tutorial.ipynb | mit | %matplotlib inline
import tensorflow as tf
import numpy as np
import datetime
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data/')
# load data
sample_image = mnist.train.next_batch(1)[0]
print(sample_image.shape)
sample_image = s... |
scko823/web-scraping-selenium-example | costco-rental.ipynb | mit |
# browser = webdriver.Firefox() #I only tested in firefox
# browser.get('http://costcotravel.com/Rental-Cars')
# browser.implicitly_wait(5)#wait for webpage download
# browser.find_element_by_id('pickupLocationTextWidget').send_keys("PHX");
# browser.implicitly_wait(5) #wait for the airport suggestion box to show
# br... |
gully/MiamiData | MiamiData01-intro.ipynb | mit | %matplotlib inline
import pandas as pd
import seaborn as sns
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt # side-stepping mpl backend
import warnings
warnings.filterwarnings("ignore") #YOLO
import seaborn as sns
sns.set_context('notebook', font_scale=1.5)
"""
Explanation: CodeForMiami
... |
dolejarz/engsci_capstone_transport | python/DDM/.ipynb_checkpoints/Temperature Modelling-checkpoint.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import datetime as dt
import scipy.stats as stats
from scipy.stats import norm
import numpy as np
import math
import seaborn as sns
from InvarianceTestEllipsoid import InvarianceTestEllipsoid
from autocorrelation import autocorrelation
import stats... |
Aniruddha-Tapas/Applied-Machine-Learning | Miscellaneous/Connect-4 Classification.ipynb | mit | import os
from sklearn.tree import DecisionTreeClassifier, export_graphviz
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn import cross_validation, metrics
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import BernoulliNB
from sklea... |
rjenc29/numerical | tensorflow/notMNIST.ipynb | mit | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.linear_model import LogisticRegression
from six.moves.urllib.request import urlretrieve
from six.moves import cPi... |
keras-team/keras-io | examples/nlp/ipynb/masked_language_modeling.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.layers import TextVectorization
from dataclasses import dataclass
import pandas as pd
import numpy as np
import glob
import re
from pprint import pprint
"""
Explanation: End-to-end Masked Language Modeling wi... |
jcreinhold/jcreinhold.github.io | ipynb/fft.ipynb | apache-2.0 | # import necessary packages and modules
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
# create helper function to print out expected and calculated frequency of signal
def print_freq(expected, freq, mag):
print("Expected Frequency: ", expected)
calculated_freq = freq[np.argmax(mag... |
tensorflow/docs-l10n | site/ja/guide/keras/customizing_what_happens_in_fit.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... |
mne-tools/mne-tools.github.io | 0.18/_downloads/18ee52b07a5bc1258587ad0c3ea7326f/plot_sensors_time_frequency.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import tfr_morlet, psd_multitaper
from mne.datasets import somato
"""
Explanation: Frequency and time-frequency sensors analysis
The objective is to show you how to explore the spectral content
of your data (frequency and time-frequ... |
gvasold/gdp17 | basics/ausnahmen.ipynb | apache-2.0 | names = ['Otto', 'Hugo', 'Maria']
names[3]
"""
Explanation: Ausnahmen (Exceptions)
Was sind Ausnahmen?
Wir haben schon mehrfach festgestellt, dass beim Ausführen von Programmen Fehler aufgetreten sind, die zum Abbruch des Programms geführt haben. Das passiert beispielsweise, wenn wir auf ein nicht existierendes Elemen... |
mmathioudakis/moderndb | 2016/lecture_7_spark.ipynb | mit | import pyspark
import numpy as np # we'll be using numpy for some numeric operations
sc = pyspark.SparkContext(master="local", appName="tour")
"""
Explanation: Lecture 7: Spark Programming
In what follows, you can find pyspark code for the examples we saw in class.
Many of the examples follow examples found in Learnin... |
texaspse/blog | media/f16-scientific-python/week4/.ipynb_checkpoints/week4-checkpoint.ipynb | mit | k = np.array([1,3,5,5,6,6,7,10,23123123,31232]) # create a new array
k
k[1]
k[0]
k[4]
k[10] # even though the list has 9 items, the index actually goes from 0 to 9
k[9]
"""
Explanation: Review
Before we start let's do some quick review from last time.
Let's create a new numpy arrray. Fill it with any values yo... |
DHBern/Tools-and-Techniques | lessons/06 Graphing Zotero.ipynb | gpl-3.0 | from IPython.display import HTML
HTML('<iframe src=http://zotero.org/ width=700 height=350></iframe>')
"""
Explanation: Citation Management with Zotero
End of explanation
"""
from pyzotero import zotero
"""
Explanation: or: Never format your own bibliography again!
First, the useful things we will do today:
Make a... |
mne-tools/mne-tools.github.io | 0.18/_downloads/dfbca5f3282b74a009ea0fd98486439e/make_report.ipynb | bsd-3-clause | # Authors: Teon Brooks <teon.brooks@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
from mne.report import Report
from mne.datasets import sample
from mne import read_evokeds
from matplotlib import pyplot as plt
data_path = sample.data_path()
meg_path = data_path + '/MEG/sampl... |
sraejones/Phys202-project | project/ProgressReport_1.ipynb | mit | import numpy as np
import math
import random
import string
from scipy import optimize
%matplotlib inline
import matplotlib.pyplot as plt
from IPython.html.widgets import interact
from sklearn.datasets import load_digits
digits = load_digits()
print(digits.data.shape)
"""
Explanation: Progress report
Neural Networks
... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/launching_into_ml/labs/repeatable_splitting.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: <h1> Repeatable splitting </h1>
In this notebook, we will explore the impact of different ways of creating machine learning datasets.
<p>
Repeatability is important in machine learni... |
tensorflow/examples | courses/udacity_intro_to_tensorflow_for_deep_learning/l08c03_moving_average.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... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_read_noise_covariance_matrix.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from os import path as op
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif')
fname_evo = op.join(data_path,... |
dinrker/Algorithms_DataStructures | 04_BFS.ipynb | mit | class Solution:
# @param {int} n an integer
# @param {int[][]} edges a list of undirected edges
# @return {boolean} true if it's a valid tree, or false
def validTree(self, n, edges):
# Write your code here
dic = {i: [] for i in range(n)}
for i, j in edges:
dic[i].appe... |
richardotis/pycalphad-sandbox | FittingTest.ipynb | mit | %matplotlib inline
TDB_STR = """
$ Al-Zn
ELEMENT /- ELECTRON_GAS 0.0000E+00 0.0000E+00 0.0000E+00!
ELEMENT VA VACUUM 0.0000E+00 0.0000E+00 0.0000E+00!
ELEMENT AL FCC_A1 2.6982E+01 4.5773E+03 2.8322E+01!
ELEMENT ZN HCP_ZN 6.5390E+01... |
pysg/pyther | Parámetros de ecuaciones de estado (SRK, PR, RKPR).ipynb | mit | import numpy as np
import pandas as pd
import pyther as pt
"""
Explanation: 2. Parámetros de ecuaciones de estado cúbicas (SRK, PR, RKPR)
En esta sección se presenta una implementación en Python para calcular los parámetros de ecuaciones de estado cúbicas (SRK, PR, RKPR). Las 2 primeras ecuaciónes de estado SRK y PR, ... |
tensorflow/docs-l10n | site/ko/federated/tutorials/federated_learning_for_text_generation.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... |
DJCordhose/ai | notebooks/workshops/tss/cnn-intro.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import matplotlib.pylab as plt
import numpy as np
from distutils.version import StrictVersion
import sklearn
print(sklearn.__version__)
assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1')
import tensorflow as tf
t... |
tkurfurst/deep-learning | autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[3]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
JAmarel/LiquidCrystals | ElectroOptics/.ipynb_checkpoints/CurveFitAttempt-checkpoint.ipynb | mit | import numpy as np
from scipy.integrate import quad, dblquad
%matplotlib inline
import matplotlib.pyplot as plt
import scipy.optimize as opt
"""
Explanation: TO DO:
Need to be able to scatter plot measured values of Psi on top of the current Psi plot.
Alpha and rho LaTeX not working in plots.
Legend needs to be move i... |
vanessajurtz/lasagne4bio | subcellular_localization/notebook tutorial/CNN-LSTM.ipynb | gpl-3.0 | # Import all the necessary modules
import os
import sys
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,optimizer=None,device=cpu,floatX=float32"
sys.path.insert(0,'..')
import numpy as np
import theano
import theano.tensor as T
import lasagne
from confusionmatrix import ConfusionMatrix
from utils import iterate_minibatche... |
osbd/osbd-2016 | slides/crist/Ocean Temperature Data.ipynb | mit | import zarr
import dask.array as da
a = zarr.open_array("sst.day.mean.v2.zarr/", mode='r')
data = da.from_array(a, chunks=a.chunks)
data
data.nbytes / 1e9
"""
Explanation: Weather Data
Daily ocean temperature data since 1981. http://www.esrl.noaa.gov/psd/data/gridded/data.noaa.oisst.v2.html. This is roughly 52 GB -... |
crystalzhaizhai/cs207_yi_zhai | homeworks/HW3/HW3_final.ipynb | mit | %%bash
cd /tmp
rm -rf playground
git clone https://github.com/crystalzhaizhai/playground.git
%%bash
cd /tmp/playground
git pull origin mybranch1
ls
%%bash
cd /tmp/playground
git status
%%bash
cd /tmp/playground
git reset --hard origin/master
ls
%%bash
cd /tmp/playground
git status
"""
Explanation: Homework 3
Due ... |
pauliacomi/pyGAPS | docs/examples/isosteric_enthalpy.ipynb | mit | # import isotherms
%run import.ipynb
# import the characterisation module
import pygaps.characterisation as pgc
"""
Explanation: Isosteric enthalpy calculation
Isosteric enthalpy of adsorption gives an indication of the strength of the
adsorbate-material interaction and can be calculated through the
Clausius-Clapeyro... |
510908220/python-toolbox | books/optimization/performance-analysis.ipynb | mit | %%writefile slow_app.py
import sys
import time
def mock_download():
for i in range(5):
time.sleep(1)
def mock_database():
for i in range(20):
time.sleep(0.1)
def mock_calcate():
for i in range(100000000):
pass
def main():
mock_download()
mock_database()
mock_calc... |
gVallverdu/cookbook | anscombe.ipynb | gpl-2.0 | %pylab --no-import-all inline
from scipy.stats import linregress, pearsonr
"""
Explanation: Quartet d'Anscombe
Page wikipedia
Construits en 1973 par le statisticien Francis Anscombe dans le but de démontrer l'importance de tracer des graphiques avant d'analyser un ensemble de données.
End of explanation
"""
all_sets... |
thom056/ada-parliament-ML | 04-VotingProfile/Clustering/3-Clustering.ipynb | gpl-2.0 | import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import sklearn
import sklearn.ensemble
from sklearn.metrics import silhouette_score
from sklearn.cluster import KMeans
import csv
"""
Explanation: In this notebook, we try to apply an unsupervised learning algorithm to votation profile of... |
li-xirong/hierse | notebooks/pytorch-for-zero-shot-learning.ipynb | mit | import sys
sys.path.append('..')
from synset2vec import Synset2Vec
from im2vec import Image2Vec
from tagger import ZeroshotTagger
i2v = Image2Vec()
s2v = Synset2Vec()
tagger = ZeroshotTagger()
"""
Explanation: Zero-shot image tagging using hierse and pytorch
This note shows how to perform zero-shot image tagging usin... |
dmittov/misc | Thompson Sampling.ipynb | apache-2.0 | crossfitters_ratio = .48
aggressive = {"crossfitters": .68, "runners": .04}
neutral = {"crossfitters": .28, "runners": .4}
def test_banner(banner, shows):
runners_dist = stats.bernoulli(banner["runners"])
crossfitters_dist = stats.bernoulli(banner["crossfitters"])
crossfitters_cnt = stats.bernoulli(cross... |
evanmiltenburg/python-for-text-analysis | Chapters/Chapter 19 - More about Natural Language Processing Tools (spaCy).ipynb | apache-2.0 | pip install -U spacy
%%bash
python -m spacy download en_core_web_sm
"""
Explanation: Chapter 19 - More about Natural Language Processing Tools (spaCy)
Text data is unstructured. But if you want to extract information from text, then you often need to process that data into a more structured representation. The common... |
solvebio/solvebio-python | examples/Python_Template.ipynb | mit | !pip install solvebio
!pip install plotly
"""
Explanation: Python Template
This notebook is a template for SolveBio Python examples.
Install Packages
End of explanation
"""
import solvebio
import numpy as np
import plotly.plotly as py
import plotly.tools as tls
from plotly.graph_objs import Data, Layout, XAxis, YAx... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/kubeflow_pipelines/cicd/solutions/kfp_cicd_vertex.ipynb | apache-2.0 | PROJECT_ID = !(gcloud config get-value project)
PROJECT_ID = PROJECT_ID[0]
REGION = "us-central1"
ARTIFACT_STORE = f"gs://{PROJECT_ID}-kfp-artifact-store"
"""
Explanation: CI/CD for a Kubeflow pipeline on Vertex AI
Learning Objectives:
1. Learn how to create a custom Cloud Build builder to pilote Vertex AI Pipelines
1... |
qualdocs/qualdocs | example/qualdocs-example.ipynb | mit | !pip install qualdocs
import pandas as pd
pd.set_option('display.max_colwidth', -1)
pd.set_option('display.max_rows', 500)
import qualdocs
"""
Explanation: Using qualdocs to process Google Docs comments
This assumes you have client_secret.json in your working directory per the instructions in README.md
Imports
End o... |
nehal96/Deep-Learning-ND-Exercises | Batch-Normalization/Batch_Normalization_Exercises.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False)
"""
Explanation: Batch Normalization – Practice
Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con... |
aapeebles/tibertraining | October 13th 2017 - Intro to Python/Lesson 1/Chapter 1 - Reading from a CSV.ipynb | mit | broken_df = pd.read_csv('../data/bikes.csv')
# Look at the first 3 rows
broken_df[:3]
"""
Explanation: 1.1 Reading data from a csv file
You can read data from a CSV file using the read_csv function. By default, it assumes that the fields are comma-separated.
We're going to be looking some cyclist data from Montréal. ... |
spm2164/foundations-homework | 12/homework 12 - 311 time series homework.ipynb | artistic-2.0 | df=pd.read_csv("311-2014.csv", nrows=200000)
dateutil.parser.parse(df['Created Date'][0])
def parse_date(str_date):
return dateutil.parser.parse(str_date)
df['created_datetime']=df['Created Date'].apply(parse_date)
df.index=df['created_datetime']
"""
Explanation: First, I made a mistake naming the data set! It... |
n-witt/MachineLearningWithText_SS2017 | tutorials/0 Python basics 3.ipynb | gpl-3.0 | def a_func(x, y, z=1.5):
if z > 1:
return z * (x + y)
else:
return z / (x + y)
"""
Explanation: Functions
The basic unit of code organization in Python is Functions. Don't write classes until you really have to (see this for more details). As you've already seen, functions are defines by the de... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_read_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator
print(__doc__)
data_path = sample.data_path()
fname = data_path
fname += '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif'
inv = read_... |
whitead/numerical_stats | unit_12/hw_2016/homework.ipynb | gpl-3.0 | x = [0.5,1.3, 2.1, 1.0, 2.1, 1.7, 1.2, 3.9, 3.9, 1.5, 3.5, 3.9, 5.7, 4.7, 5.8, 4.6, 5.1, 5.9, 5.5, 6.4, 6.7, 7.8, 7.4, 6.7, 8.4, 6.9, 10.2, 9.7, 10.0, 9.9]
y = [-1.6,0.5, 3.0, 3.1, 1.5, -1.8, -3.6, 7.0, 8.6, 2.2, 9.3, 3.6, 14.1, 9.5, 14.0, 7.4, 6.4, 17.2, 11.8, 12.2, 18.9, 21.9, 20.6, 15.7, 23.7, 13.6, 26.8, 22.0, 27.5... |
IndicoDataSolutions/SuperCell | custom_sentiment/custom_sentiment.ipynb | mit | seed = 3 # for reproducibility across experiments, just pick something
train_num = 100 # number of training examples to use
test_num = 100 # number of examples to use for testing
base_model_name = "sentiment_train%s_test%s" % (train_num, test_num)
lab2bin = {'pos': 1, 'neg': 0} # label -> binary class
po... |
zlpure/CS231n | assignment1/two_layer_net.ipynb | mit | # A bit of setup
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.neural_net import TwoLayerNet
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
# for auto-reloadi... |
pagutierrez/tutorial-sklearn | notebooks-spanish/23-aprendizaje_out_of_core.ipynb | cc0-1.0 | from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=1)
vectorizer.fit([
"The cat sat on the mat.",
])
vectorizer.vocabulary_
"""
Explanation: Aprendizaje out-of-core
Problemas de escalabilidad
Las clases sklearn.feature_extraction.text.CountVectorizer y sklearn.feature... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session10/Day1/UnderstandingData.ipynb | mit | x, y, y_unc = pollute_namespace()
"""
Explanation: Understanding Data
(or, lies I've been told about statistics)
Version 0.1
By AA Miller (Northwestern/Adler Planetarium)
5 Sep 2019
According to the DSFP curriculum, this entire week is going to be devoted to statistics (an entire field unto itself).
In practice, how... |
AaronCWong/phys202-2015-work | assignments/assignment04/MatplotlibEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 2
Imports
End of explanation
"""
!head -n 30 open_exoplanet_catalogue.txt
"""
Explanation: Exoplanet properties
Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo... |
cchwala/pyMPM | notebooks/Water vapor attenuation at MW link frequencies.ipynb | bsd-3-clause | fig, ax = plt.subplots(figsize=(14,6))
f = np.arange(1,100) # Vector of frequencies in GHz
T = 15 # Air temperature in degree Celcius
P = 1013 # Air pressiure in mbar
RH_vec = [0, 50, 100] # List of relative humidity values used for plotting
for RH in RH_vec:
A = MPM(f, P, T, RH, 0... |
microscopium/microscopium-scripts | bbbc021_analysis.ipynb | bsd-3-clause | # first load in the screen metadata
bbbc021_metadata = pd.read_csv("./BBBC021_v1_image.csv")
# now load in the mechanism of action metadata, these map
# compouds to a class of compounds
bbbc021_moa = pd.read_csv("./BBBC021_v1_moa.csv")
# wrangle the metadata into a form that maps screen-plate-well format IDs
# to the... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topics: Tra... |
jorisvandenbossche/DS-python-data-analysis | notebooks/case4_air_quality_analysis.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: <p><font size="6"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbo... |
jkibele/OpticalRS | docs/notebooks/demos/KNNDepthDemo.ipynb | bsd-3-clause | %pylab inline
style.use('ggplot')
from OpticalRS import *
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: KNN Depth Estimation Demo
This notebook will illustrate how to use the OpticalRS Python library to estimate depths as described in Kibele and Shears (not published yet).
End of explanation
"""
... |
tensorflow/docs-l10n | site/ja/hub/tutorials/tf2_text_classification.ipynb | apache-2.0 | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
acmiyaguchi/data-pipeline | reports/android-addons/android-addons.ipynb | mpl-2.0 | 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(... |
QudevETH/PycQED_py3 | examples/new_feature_demos/HamiltonianFittingAnalysis_demo.ipynb | mit | import numpy as np
from pycqed.utilities.hamiltonian_fitting_analysis import HamiltonianFittingAnalysis as HF
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = [12, 8]
"""
Explanation: Introduction
I added some comments throughout this notebook to guide you so I hope it's easily understandable. Let me ... |
blakeflei/IntroScientificPythonWithJupyter | 10 - Pandas Crash Course.ipynb | bsd-3-clause | # Python imports
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
"""
Explanation: Pandas Crash Course
<img style="float: right; border:3px solid black" src="images/10_Panda_DailyMail_7_Nov_2013.jpg" border="5" width=30%>
Pandas is a Python package that aims to make worki... |
google/objax | docs/source/notebooks/Custom_Networks.ipynb | apache-2.0 | %pip --quiet install objax
import os
import numpy as np
import tensorflow_datasets as tfds
import objax
from objax.util import EasyDict
from objax.zoo.dnnet import DNNet
"""
Explanation: Creating Custom Networks for Multi-Class Classification
This tutorial demonstrates how to define, train, and use different models... |
vitojph/kschool-nlp | notebooks-py2/vsm.ipynb | gpl-3.0 | # corpus ficticio con tres documentos de la misma longitud
# y sin repeticiones de términos dentro del mismo documento
# cada doc es una lista de palabras
d1 = 'los angeles times'.split()
d2 = 'new york times'.split()
d3 = 'new york post'.split()
# nuestro corpus D es una lista de documentos
D = [d1, d2, d3]
print(D... |
jotterbach/Data-Exploration-and-Numerical-Experimentation | Data-Analytics/Adult census data.ipynb | cc0-1.0 | import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
matplotlib.style.use('ggplot')
matplotlib.rc_params_from_file("../styles/matplotlibrc" ).update()
"""
Explanation: Adult census data from 1996
In this notebook we will have a look at the census income data f... |
kit-cel/wt | wt/vorlesung/ch7_9/markoff_example.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, 6) )
"""
Explanation: Content and Objective
Simulation of ... |
diging/tethne-notebooks | .ipynb_checkpoints/6. Words and topic modeling-checkpoint.ipynb | gpl-3.0 | from tethne.readers import dfr
"""
Explanation: Introduction to Tethne: Words and Topic Modeling
In this workbook we'll start working with word-based FeatureSets, and use the model.corpus.mallet module to fit a Latent Dirichlet Allocation (LDA) topic model.
Before you start
Download the practice dataset from here, a... |
YannickJadoul/Parselmouth | docs/examples/pitch_manipulation.ipynb | gpl-3.0 | import parselmouth
sound = parselmouth.Sound("audio/4_b.wav")
"""
Explanation: Pitch manipulation and Praat commands
Another common use of Praat functionality is to manipulate certain features of an existing audio fragment. For example, in the context of a perception experiment one might want to change the pitch cont... |
hankcs/HanLP | plugins/hanlp_demo/hanlp_demo/zh/sdp_restful.ipynb | apache-2.0 | !pip install hanlp_restful -U
"""
Explanation: <h2 align="center">点击下列图标在线运行HanLP</h2>
<div align="center">
<a href="https://colab.research.google.com/github/hankcs/HanLP/blob/doc-zh/plugins/hanlp_demo/hanlp_demo/zh/sdp_restful.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.s... |
tensorflow/tfx-addons | tfx_addons/feature_selection/example/Palmer_Penguins_example_colab.ipynb | apache-2.0 | !pip install -U tfx
# getting the code directly from the repo
x = !pwd
if 'feature_selection' not in str(x):
!git clone -b main https://github.com/tensorflow/tfx-addons.git
%cd tfx-addons/tfx_addons/feature_selection
"""
Explanation: <a href="https://colab.research.google.com/github/deutranium/tfx-addons/blob/m... |
w4zir/ml17s | assignments/assignment02-digit-recognizer-using-logistic-regression-and-neural-network.ipynb | mit | import cv2
img = cv2.imread('test.png',0)
resized_image = cv2.resize(img, (28, 28), interpolation = cv2.INTER_AREA)
"""
Explanation: CSAL4243: Introduction to Machine Learning
Muhammad Mudassir Khan (mudasssir.khan@ucp.edu.pk)
Assignment 2:
Digits Recognition using Logistic Regression & Neural Networks
In this assign... |
ngmarchant/prox_elasticnet | demo/benchmark.ipynb | bsd-3-clause | import time
import numpy as np
import copy
from sklearn.linear_model import ElasticNetCV as ElasticNetCV_sk
from prox_elasticnet import ElasticNetCV as ElasticNetCV_px
np.random.seed(319159)
from sklearn import __version__ as sklearn_version
print("Using sklearn version {}.".format(sklearn_version))
"""
Explanation: ... |
garth-wells/notebooks-3M1 | 04-SingularValueDecomposition.ipynb | bsd-2-clause | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
"""
Explanation: Singular value decomposition (SVD)
The singular value decompostion of a real-valued $m \times n$ matrix $\boldsymbol{A}$ is:
$$
\boldsymbol{A} = \boldsymbol{U} \boldsymbol{\Sigma} \boldsymbol... |
hparik11/Deep-Learning-Nanodegree-Foundation-Repository | embeddings/Skip-Grams-Solution.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... |
WMD-group/MacroDensity | tutorials/Porous/Porous.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import sys
sys.path.append('../../')
import imp
import macrodensity as md
import math
import numpy as np
import matplotlib.pyplot as plt
import os
"""
Explanation: Ionisation potential of a porous material
In this example we use MacroDensity with VASP to align the ... |
aflaxman/siaman16-va-minitutorial | 2-tutorial-notebook-solutions/1-siamam16-intro.ipynb | gpl-3.0 | # this is a python comment
# this cell contains python code
# executing the cell yields the results of the python command
2+2
"""
Explanation: Welcome to the Jupyter Notebook
I might slip and call it the "IPython Notebook" sometimes, because it was originally just for interactive Python sessions. But it does much mo... |
antoniomezzacapo/qiskit-tutorial | community/aqua/artificial_intelligence/svm_classical_multiclass.ipynb | apache-2.0 | from datasets import *
from qiskit_aqua.utils import split_dataset_to_data_and_labels
from qiskit_aqua.input import get_input_instance
from qiskit_aqua import run_algorithm
import numpy as np
"""
Explanation: SVM with a classical RBF kernel: multiclass classifier extension
A multiclass extension works in conjunction w... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_14_Complete.ipynb | mit | # Define parameters
s = 0.1
delta = 0.025
alpha = 0.35
# Compute the steady state values of the endogenous variables
Kss = (s/delta)**(1/(1-alpha))
Yss = Kss**alpha
Css = (1-s)*Yss
Iss = Yss - Css
print('Steady states:\n')
print('capital: ',round(Kss,5))
print('output: ',round(Yss,5))
print('consumption:',roun... |
lithiumdenis/MLSchool | 0. Практика по NumPy.ipynb | mit | a = ['abc', 'hdok', 'banc', 'xkm', 'pckdax']
#b = a[::-1]
b= []
for i in a:
if (len(i) > 3):
b.append(i)
b = b[::-1]
b
"""
Explanation: Задача 1: Переверните список и оставьте только слова длиннее трех букв.
End of explanation
"""
a = [[1,2,3], [4,5], [6]]
numpy.hstack((a[0],a[1],a[2]))
"""
E... |
zizouvb/deeplearning | 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... |
Wei1234c/Elastic_Network_of_Things_with_MicroPython | notebooks/上傳檔案到 NodeMCU (Upload files to NodeMCU).ipynb | gpl-3.0 | import os
"""
Explanation: 上傳檔案到 NodeMCU (Upload files to NodeMCU)
需先安裝 ampy ( Adafruit MicroPython Tool )
pip install adafruit-ampy
https://github.com/adafruit/ampy
End of explanation
"""
com_port = 'COM12'
# com_port = 'COM13'
com_port = 'COM15'
# com_port = 'COM16'
"""
Explanation: 設定COM port (set current COM po... |
thewtex/SimpleITK-Notebooks | 10_matplotlib's_imshow.ipynb | apache-2.0 | import matplotlib.pyplot as plt
%matplotlib inline
import SimpleITK as sitk
# Download data to work on
from downloaddata import fetch_data as fdata
"""
Explanation: Using matplotlib to display inline images
In this notebook we will explore using matplotlib to display images in our notebooks, and work towards developin... |
broundy/udacity | nanodegrees/deep_learning_foundations/unit_2/project_2/dlnd_image_classification.ipynb | unlicense | """
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... |
peterwilliams97/spaCy_practice | spacy-examples/Introduction to Natural Language Processing with SpaCy - Working Files/Chapter 3/Train_SpaCy_Tagger-WF.ipynb | mit | import sys
sys.path.append('/home/jupyter/site-packages/')
import requests
from spacy.syntax.arc_eager import PseudoProjectivity
def read_conllx(text):
bad_lines = 0
#t = text.strip()
#print(type(t), type('\n\n'))
# u = t.split(b'\n\n')
n_sent = 0
n_line = 0
print('text=%d' % ... |
daniel-koehn/Theory-of-seismic-waves-II | 04_FD_stability_dispersion/4_general_fd_taylor_operators.ipynb | gpl-3.0 | # Execute this cell to load the notebook's style sheet, then ignore it
from IPython.core.display import HTML
css_file = '../style/custom.css'
HTML(open(css_file, "r").read())
"""
Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 parts of this notebook are... |
keras-team/keras-io | examples/vision/ipynb/pointnet.ipynb | apache-2.0 |
import os
import glob
import trimesh
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from matplotlib import pyplot as plt
tf.random.set_seed(1234)
"""
Explanation: Point cloud classification with PointNet
Author: David Griffiths<br>
Date created: 2020/05/2... |
AllenDowney/ThinkStats2 | examples/poincare.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='white')
from thinkstats2 import Pmf, Cdf
import thinkstats2
import thinkplot
decorate = thinkplot.config
"""
Explanation: Poincaré's bread
Allen Downey
MIT License
End of explanation
"""
... |
mne-tools/mne-tools.github.io | 0.21/_downloads/85b80d223414f32365a9175978a38cb4/plot_limo_data.ipynb | bsd-3-clause | # Authors: Jose C. Garcia Alanis <alanis.jcg@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from mne.datasets.limo import load_data
from mne.stats import linear_regression
from mne.viz import plot_events, plot_compare_evokeds
from mne import combine_evoked
print(__doc__)
... |
rcmalli/keras-squeezenet | examples/example_keras_squeezenet.ipynb | mit | # Get weights that are not trained (i.e., randomly initialized)
model = SqueezeNet(weights=None)
W = K.eval(model.weights[0])
print(W.shape)
plt.figure(figsize=(18,12))
for idx in range(W.shape[-1]):
plt.subplot(8,8,idx+1)
plt.imshow(W[:,:,:,idx]); plt.colorbar()
preds = model.predict(x)
print('Predicted:', d... |
tesfayeBris/sc-python | 01-analysing-data.ipynb | mit | import numpy
numpy.loadtxt(fname='data/weather-01.csv', delimiter = ',')
"""
Explanation: Analysing tabular data
we are going to use a LIBRARY called numpy
End of explanation
"""
Weight_kg = 55
print (Weight_kg)
print('Weight in pounds:', Weight_kg * 2.2)
Weight_kg = 57.5
print ('New weight: ', Weight_kg * 2.2... |
opengeostat/pygslib | pygslib/Ipython_templates/.ipynb_checkpoints/declus_raw-checkpoint.ipynb | mit | #general imports
import matplotlib.pyplot as plt
import pygslib
import numpy as np
#make the plots inline
%matplotlib inline
"""
Explanation: PyGSLIB
Declustering
This is how declustering works
End of explanation
"""
#get the data in gslib format into a pandas Dataframe
mydata= pygslib.gslib.read_gslib_file(... |
idc9/law-net | vertex_metrics_experiment/scrap_code.ipynb | mit |
def make_get_similarity(similarity_matrix, CLid_to_index):
"""
helper funciton for get_similarities
"""
def f(CLid_pair):
try:
ida = CLid_to_index[CLid_pair[0]]
idb = CLid_to_index[CLid_pair[1]]
return similarity_matrix[ida, idb]
except KeyEr... |
arsenovic/clifford | docs/tutorials/space-time-algebra.ipynb | bsd-3-clause | from clifford import Cl, pretty
pretty(precision=1)
# Dirac Algebra `D`
D, D_blades = Cl(1,3, firstIdx=0, names='d')
# Pauli Algebra `P`
P, P_blades = Cl(3, names='p')
# put elements of each in namespace
locals().update(D_blades)
locals().update(P_blades)
"""
Explanation: This notebook is part of the clifford do... |
ES-DOC/esdoc-jupyterhub | notebooks/uhh/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'uhh', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: UHH
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
gregorjerse/rt2 | 2015_2016/lab6/Exercises.ipynb | gpl-3.0 | from dionysus import Simplex
complex = [Simplex([0]), Simplex([1]), Simplex([2]), Simplex([0, 1]),
Simplex([0, 2]), Simplex([2, 1]), Simplex([0, 1, 2])]
complex
"""
Explanation: Lab exercises
Simplicial complex in Dionysus is just a list of its simplices. See how we define a full triangle spanned on verti... |
stevetjoa/stanford-mir | neural_networks.ipynb | mit | from keras.models import Sequential
from keras.layers.core import Dense
import keras.optimizers
"""
Explanation: ← Back to Index
Neural Networks
Neural networks are a category of machine learning models which have seen a resurgence since 2006. Deep learning is the recent area of machine learning which combines ma... |
dsacademybr/PythonFundamentos | Cap09/Mini-Projeto2/Mini-Projeto2 - Analise3.ipynb | gpl-3.0 | # Imports
import os
import subprocess
import stat
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from datetime import datetime
sns.set(style = "white")
%matplotlib inline
# Dataset
clean_data_path = "dataset/autos.csv"
df = pd.read_csv(clean_data_path,encoding = "latin-1")... |
zhiyanfoo/crunch-shake | crunch-shake/tutorial.ipynb | mit | from utils import file_to_list
romeo_juliet_raw = file_to_list("plays/romeo_and_juliet_entire_play.html")
# Showing the beggining
for line in romeo_juliet_raw[:10]:
print(line, end="")
"""
Explanation: Crunch-Shake
Table of Contents
<strong>
1. Introduction
2. Preliminaries
3. Parsing
4. Processing
5. Analysis
<... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.