repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/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', 'noaa-gfdl', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Propertie... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/sandbox-1/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: MOHC
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbul... |
HumanCompatibleAI/imitation | examples/3_train_gail.ipynb | mit | from stable_baselines3 import PPO
from stable_baselines3.ppo import MlpPolicy
import gym
import seals
env = gym.make("seals/CartPole-v0")
expert = PPO(
policy=MlpPolicy,
env=env,
seed=0,
batch_size=64,
ent_coef=0.0,
learning_rate=0.0003,
n_epochs=10,
n_steps=64,
)
expert.learn(1000) # ... |
tipsybear/actors-simulation | notebooks/distributions.ipynb | mit | %matplotlib inline
from gvas.viz import *
from gvas.dynamo import Uniform, Normal
from gvas.dynamo import Stream
"""
Explanation: Distribution Analysis
This notebook visualizes the distribution dynamos that subclass gvas.dynamo.Distribution. This is partly to have a debug of the distribution, but also to provide an e... |
axm108/CPWResonator | notebooks/cpw_resonator_plots.ipynb | mit | mCPW = CPWResonator(length = [7153E-6],
conductorWidth = [30E-3],
gapWidth = [19E-3],
conductorThickness = [1E-3],
resonatorType = 'quarter',
conductorMaterial = 'Copper'... |
dirmeier/dataframe | examples/examples_for_data_frame.ipynb | gpl-3.0 | from dataframe import DataFrame
from dataframe import GroupedDataFrame
"""
Explanation: DataFrame tutorial
This is a short tutorial with examples for the dataframe library.
Creating a DataFrame object
If we want to use dataframe, we first import the two central classes:
End of explanation
"""
from sklearn import dat... |
Adamage/python-training | Lesson_02_classes_object_oriented.ipynb | apache-2.0 | class Example:
a = 1
print type(Example)
"""
Explanation: Python Training - Lession 2 - classes in Object Oriented Programming
In Python, pretty much every variable is an object, and therefore an instance of some class. But what is a class? A first, basic understanding of a class should be:
A data structure w... |
gkvoelkl/ipython-turtle-widget | ipython-turtle-widget.ipynb | mit | from ipyturtle import Turtle
t = Turtle()
t
"""
Explanation: ipython-turtle-widget
Creating Turtle Graphics in IPython/Jupyter
Draw on the page or use an extra window. under construction
If you like it, use it. If you have some suggestions, tell me (gkvoelkl@nelson-games.de).
Install
To install use pip:
To install Ju... |
Olsthoorn/TransientGroundwaterFlow | Syllabus_in_notebooks/Sec6_3_13_Alexandria_Egypte_desert_infiltration.ipynb | gpl-3.0 | import numpy as np
from scipy.special import exp1 # Theis well function
import matplotlib.pyplot as plt
"""
Explanation: Section 6.3.13 The effect of irrigating the desert (south of Alexandria)
IHE, Delft, transient groundwater
@T.N.Olsthoorn, 2019-01-04
Context
Effect of a rising lake on adjacent groundwater heads
So... |
UCBerkeleySETI/breakthrough | GBT/pulsar_searches/Pulsar_Search/Pulsar_DedisperseV3.ipynb | gpl-3.0 | !pip install blimpy
# Pulsar data
!wget http://blpd13.ssl.berkeley.edu/borisov/AGBT19B_999_124/spliced_blc40414243444546o7o0515253545556o7o061626364656667_guppi_58837_86186_PSR_B0355+54_0013.gpuspec.8.0001.fil
# For more info on pulsar searches check out this deck
# http://ipta.phys.wvu.edu/files/student-week-2017/IPTA... |
gdhungana/desispec | doc/nb/QA_Prod.ipynb | bsd-3-clause | %matplotlib notebook
# imports
from desispec.qa import qa_prod as dqap
"""
Explanation: QA_Prod (v1.1)
End of explanation
"""
specprod_dir = '/Users/xavier/DESI/DESI_SCRATCH/redux/madrone/'
reload(dqap)
qa_prod = dqap.QA_Prod(specprod_dir)
"""
Explanation: Init
setenv DESI_SPECTRO_DATA /Users/xavier/DESI/DESI_SCR... |
mne-tools/mne-tools.github.io | stable/_downloads/b6ccbb801939862ed915d2c7295ac245/sensor_permutation_test.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import mne
from mne import io
from mne.stats import permutation_t_test
from mne.datasets import sample
print(__doc__)
"""
Explanation: Permutation T-test on sensor data
One tests if the signal significantly devi... |
gururajl/deep-learning | intro-to-tflearn/TFLearn_Digit_Recognition.ipynb | mit | # Import Numpy, TensorFlow, TFLearn, and MNIST data
import numpy as np
import tensorflow as tf
import tflearn
import tflearn.datasets.mnist as mnist
"""
Explanation: Handwritten Number Recognition with TFLearn and MNIST
In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9.
This... |
google-research/google-research | gfsa/notebooks/guide_for_new_tasks.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
adrianstaniec/deep-learning | 14_language-translation/dlnd_language_translation.ipynb | mit | 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 to take a peek into the realm of neural ne... |
kitu2007/dl_class | 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... |
Sebbenbear/notebooks | InterviewCake Questions.ipynb | apache-2.0 | from functools import reduce
def get_products_of_all_ints_except_at_index(arr):
results = []
if len(arr) < 2:
raise Exception("Arrays too short, can't do it")
for index, value in enumerate(arr):
new_array = arr[0:index] + arr[index+1:]
product = reduce((lambda x, y: x * y)... |
lguarneros/fimda | dinamica-2puentes.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import pylab as pl
import matplotlib.patches as mpatches
import matplotlib.ticker as ticker
import os
import shutil
from IPython.display import Image
from matplotlib.ticker import FormatStrFormatter
"""
Explanation: FIMDA
Script que realiza el análisis de dinámica para una trayect... |
no-fire/line-follower | line-follower/src/v1/convnet_regression_layer_play.ipynb | mit | #Create references to important directories we will use over and over
import os, sys
DATA_HOME_DIR = '/home/nathan/olin/spring2017/line-follower/line-follower/data'
#import modules
import numpy as np
from glob import glob
from PIL import Image
from tqdm import tqdm
from scipy.ndimage import zoom
from keras.models imp... |
regata/dbda2e_py | chapters/7.ipynb | mit | import numpy as np
from scipy.stats import beta as betad
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from dbda2e_utils import plotPost
# Specify the data, to be used in the likelihood function.
myData = np.concatenate((np.repeat(0,6), np.repeat(1,14)))
# myData = [] # Exercicse 7.3
# m... |
aleph314/K2 | Regex/python_regex_problems.ipynb | gpl-3.0 | urls = ['http://www.domain.com',
'https://somedomain.com',
'http://my-domain-123.net',
'https://google.com',
'http://www.foo.com',
'https://bar-baz3.com',
'ftp://domain2.com']
import re
# A complete match checking for the presence of some alphanumeric after the // follo... |
brujonildo/randomNonlinearDynamics | approximatingRatesOfChangeFromData.ipynb | cc0-1.0 | import scipy as sc
import matplotlib.pylab as gr
%matplotlib inline
"""
Explanation: Calculating rates of change from data
Marco Arieli Herrera-Valdez
Laboratory of computational physiology and quantitative imaging
Facultad de Ciencias, Universidad Nacional Autónoma de México
Consider an experimental paradigm in which... |
Graphitenet/Fun-CSS-Java-Clock | റെൻസോർഫ്ളോ_.ipynb | gpl-2.0 | print ("Gods name is Jehova")
"""
Explanation: <a href="https://colab.research.google.com/github/Graphitenet/Fun-CSS-Java-Clock/blob/master/%E0%B4%B1%E0%B5%86%E0%B5%BB%E0%B4%B8%E0%B5%8B%E0%B5%BC%E0%B4%AB%E0%B5%8D%E0%B4%B3%E0%B5%8B_.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.... |
google-research/google-research | diffusion_distillation/diffusion_distillation.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# 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 ap... |
liganega/Gongsu-DataSci | notebooks/GongSu10_Tuples.ipynb | gpl-3.0 | t = (3, 50, "yellow")
print(t)
type(t)
l = [3, 50, "yellow"]
l
type(l)
"""
Explanation: 튜플 활용
주요 내용
파이썬에 내장되어 있는 컬렉션 자료형 중에서 튜플에 대해 알아 본다.
튜플(tuples): 리스트와 비슷. 하지만 수정 불가능(immutable).
* 사용 형태: 소괄호 사용
even_numbers_tuple = (2, 4, 6, 8, 10)
todays_datatypes_tuple = ('list', 'tuple', 'dictionary')
특징: 임의의 자료형 값들을 섞어서 ... |
AllenDowney/ThinkBayes2 | examples/world_cup02_soln.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 classes from thinkbayes2
from thinkbayes2 import Pmf, Suite
import thinkbayes2
import thinkplot... |
DataPilot/notebook-miner | summary_of_work/Description.ipynb | apache-2.0 | # Load the filenames
hw_filenames = np.load('homework_file_names.npy')
# Load the notebooks into a data structure
hw_notebooks = [[NotebookMiner(filename) for filename in temp[:80]] for temp in hw_filenames]
# For each homework, load all notebooks into the corpus. The second argument serves as a tag
# for each noteboo... |
navaro1/deep-learning | first-neural-network/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... |
PyDataMadrid2016/Conference-Info | workshops_materials/20160408_1100_Pandas_for_beginners/tutorial/EN - Tutorial 02 - IO.ipynb | mit | # First, imports
import os
import datetime as dt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
np.random.seed(19760812)
%matplotlib inline
ipath = os.path.join('Datos', 'mast.txt')
wind = pd.read_csv(ipath)
wind.head(3)
wind = pd.read_csv(ipath, sep = "\s... |
planet-os/notebooks | nasa-opennex/Example of Kolkata warming from Webinar.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
import urllib2
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
plt.rcParams['figure.figsize'] = (10.0, 8.0)
"""
Explanation: Compare Climate Scenarios
1. Preliminaries
End of explanation
"""
def load_data(unique_id):
data... |
datactive/bigbang | examples/git-analysis/Git Collection.ipynb | mit | url = "http://mail.python.org/pipermail/scipy-dev/"
arx = Archive(url,archive_dir="../archives")
repo = repo_loader.get_repo("bigbang")
full_info = repo.commit_data;
act = arx.data.groupby("Date").size();
act = act.resample("D", how=np.sum)
act = act[act.index.year <= 2014]
act_week = act.resample("W", how=np.sum)
pr... |
NervanaSystems/neon_course | answers/05 Model Architectures-ANSWER_KEY.ipynb | apache-2.0 | from neon.callbacks.callbacks import Callbacks
from neon.initializers import Gaussian
from neon.layers import GeneralizedCost, Affine, BranchNode, Multicost, SingleOutputTree
from neon.models import Model
from neon.optimizers import GradientDescentMomentum
from neon.transforms import Rectlin, Logistic, Softmax
from neo... |
tensorflow/docs-l10n | site/ja/io/tutorials/colorspace.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.19/_downloads/4a39dd4a31cad8a0e098b02526b9c3d3/plot_covariance_whitening_dspm.ipynb | bsd-3-clause | # Author: Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import spm_face
from mne.minimum_norm import apply_inverse, make_inverse_operator
from mne.cov import compute_covariance
print(__doc__)... |
tiagoantao/biopython-notebook | notebooks/09 - Accessing NCBIs Entrez databases.ipynb | mit | from Bio import Entrez
Entrez.email = "A.N.Other@example.com"
"""
Explanation: Source of the materials: Biopython cookbook (adapted)
<font color='red'>Status: Draft</font>
Accessing NCBI’s Entrez databases
Entrez Guidelines
EInfo: Obtaining information about the Entrez databases
ESearch: Searching the Entrez databases... |
flaviocordova/udacity_deep_learn_project | 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... |
astro4dev/OAD-Data-Science-Toolkit | Teaching Materials/Machine Learning/Supervised Learning/Examples/PPC/Predicting_Pulsar_Candidates.ipynb | gpl-3.0 | # For numerical stuff
import pandas as pd
# Plotting
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
plt.rcParams['figure.figsize'] = (7.0, 7.0)
# Some preprocessing utilities
from sklearn.cross_validation import train_test_split # Data splitting
from sklearn.utils import sh... |
max-ionov/rucoref | notebooks/first-mention.ipynb | lgpl-3.0 | %cd '/Users/max/Projects/Coreference/'
%cd 'rucoref'
from anaphoralib.corpora import rueval
from anaphoralib.tagsets import multeast
from anaphoralib.experiments.base import BaseClassifier
from anaphoralib import utils
from anaphoralib.experiments import utils as exp_utils
%cd '..'
from sklearn.ensemble import Random... |
enbanuel/phys202-2015-work | assignments/assignment04/MatplotlibExercises.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Visualization 1: Matplotlib Basics Exercises
End of explanation
"""
x = np.random.rand(100)
y = np.random.rand(100)
plt.scatter(x, y, color='orange', s=70, alpha=0.8)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('X v. Y Scatter')
""... |
Kaggle/learntools | notebooks/sql/raw/tut4.ipynb | apache-2.0 | #$HIDE_INPUT$
from google.cloud import bigquery
# Create a "Client" object
client = bigquery.Client()
# Construct a reference to the "nhtsa_traffic_fatalities" dataset
dataset_ref = client.dataset("nhtsa_traffic_fatalities", project="bigquery-public-data")
# API request - fetch the dataset
dataset = client.get_datas... |
GoogleCloudPlatform/python-docs-samples | notebooks/tutorials/cloud-ml-engine/Training and prediction with scikit-learn.ipynb | apache-2.0 | !gcloud services enable ml.googleapis.com
!gcloud services enable compute.googleapis.com
"""
Explanation: Training and prediction with scikit-learn
This notebook demonstrates how to use AI Platform to train a simple classification model using scikit-learn, and then deploy the model to get predictions.
You train the mo... |
lionell/university-labs | num_methods/first/lab1.ipynb | mit | EPS = sp.Rational("1e-3")
x = sp.Symbol("x")
"""
Explanation: Лабораторна робота №1
<img src="http://civil.engr.siu.edu/cheval/engr351/Images/ENGR351.jpg" width="500px" height="300px" >
Умова задачі
Задано функцію $f(x)$, потрібно знайти корінь цієї функції, тобто хоча б одне значення параметру $x=x_0$, при якому $f(x... |
kit-cel/wt | wt/vorlesung/ch7_9/random_walk.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
Realizations o... |
tensorflow/docs | site/en/tutorials/text/image_captioning.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... |
ajayrfhp/dvd | examples/.ipynb_checkpoints/MNIST-checkpoint.ipynb | mit | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=False)
img = mnist.train.images[123]
img = np.reshape(img,(28,28))
plt.imshow(img, cmap = 'gray')
plt.show()
img = np.reshape... |
mortada/notebooks | blog/unbiased_variance_estimator.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
from IPython.core.pylabtools import figsize
figsize(15, 5)
import pandas as pd
import numpy as np
np.random.seed(42)
N = 100000 # size of population
population = pd.Series(np.random.randint(1, 11, N))
"""
Explanation: Variance Estimation
In statistics we know tha... |
yandexdataschool/Practical_RL | week09_policy_II/td3_and_sac/hw-continuous-control_pytorch.ipynb | unlicense | !git clone https://github.com/benelot/pybullet-gym lib/pybullet-gym
!pip install -e lib/pybullet-gym
import gym
import numpy as np
import pybulletgym
"""
Explanation: Continuous Control
In this notebook you will solve continuous control environment using either Twin Delayed DDPG (TD3) or Soft Actor-Critic (SAC). Both... |
pdamodaran/yellowbrick | examples/jkeung/testing.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import train_test_split
"""
Explanation: ROC Curve Example
Inspired by: http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html
This is an exa... |
google-research/google-research | aav/model_and_dataset_analysis/data_prep.ipynb | apache-2.0 | import os
import numpy
import pandas
from six.moves import zip
from sklearn import mixture
import gzip
!pip install python-Levenshtein
import Levenshtein
"""
Explanation: 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... |
adolfoguimaraes/machinelearning | Projects/01_Projeto_HillaryTrump_Twitter.ipynb | mit | import pandas as pd
import nltk
df = pd.read_csv("https://www.data2learning.com/machinelearning/datasets/tweets.csv")
dataset = df[['text','handle']]
dict_ = dataset.T.to_dict("list")
"""
Explanation: Projeto Hillary x Trump
Nesse projeto vamos utilizar tweets relacionados a última eleição presidencial dos Estados Un... |
rsignell-usgs/python-training | web-services/01-skill_score.ipynb | cc0-1.0 | import os
try:
import cPickle as pickle
except ImportError:
import pickle
run_name = '2015-08-17'
fname = os.path.join(run_name, 'config.pkl')
with open(fname, 'rb') as f:
config = pickle.load(f)
import numpy as np
from pandas import DataFrame, read_csv
from utilities import to_html, save_html, apply_ski... |
Juanlu001/MOOC-Estadistica-Investigadores | P2P 1 - Datos de cigarrillos.ipynb | mit | import urllib.request
urllib.request.urlretrieve("http://www.amstat.org/publications/jse/datasets/cigarettes.dat.txt", "cigarettes.dat")
!wc -l cigarettes.dat
cat cigarettes.dat
"""
Explanation: Parte 0: Preparar los datos
Descargamos los datos de http://www.amstat.org/publications/jse/v2n1/datasets.mcintyre.html.
E... |
kobejean/tensorflow | tensorflow/contrib/eager/python/examples/generative_examples/dcgan.ipynb | apache-2.0 | # to generate gifs
!pip install imageio
"""
Explanation: Copyright 2018 The TensorFlow Authors.
Licensed under the Apache License, Version 2.0 (the "License").
DCGAN: An example with tf.keras and eager
<table class="tfo-notebook-buttons" align="left"><td>
<a target="_blank" href="https://colab.research.google.com/git... |
kit-cel/wt | nt2_ce2/vorlesung/basic_concepts_Python.ipynb | gpl-2.0 | # defining lists
sport_list = [ 'cycling', 'football', 'fitness' ]
first_prime_numbers = [ 2, 3, 5, 7, 11, 13, 17, 19 ]
# getting contents
sport = sport_list[ 2 ]
third_prime = first_prime_numbers[ 2 ]
# printing
print( 'All sports:', sport_list )
print( 'Sport to be done:', sport )
print( '\nFirst primes:', first_p... |
mdiaz236/DeepLearningFoundations | tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.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... |
pombredanne/gensim | docs/notebooks/topic_coherence-movies.ipynb | lgpl-2.1 | import re
import os
from scipy.stats import pearsonr
from datetime import datetime
from gensim.models import CoherenceModel
from gensim.corpora.dictionary import Dictionary
%load_ext line_profiler # This was used for finding out which line was taking maximum time for indirect confirmation measure
"""
Explanation: B... |
QuantScientist/Deep-Learning-Boot-Camp | day03/additional materials/5.2 Multi-Modal Networks.ipynb | mit | # let's load MNIST data as we did in the exercise on MNIST with FC Nets
# %load ../solutions/sol_52.py
"""
Explanation: Quick Intro to Keras Functional API
Preamble: All models (layers) are callables
```python
from keras.layers import Input, Dense
from keras.models import Model
this returns a tensor
inputs = Input(sh... |
ES-DOC/esdoc-jupyterhub | notebooks/messy-consortium/cmip6/models/emac-2-53-vol/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'messy-consortium', 'emac-2-53-vol', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: MESSY-CONSORTIUM
Source ID: EMAC-2-53-VOL
Topic: Aerosol
Sub-Top... |
mne-tools/mne-tools.github.io | 0.18/_downloads/62c7de5c3dadb3e4bb93d667d4af9010/plot_opm_rest_data.ipynb | bsd-3-clause | # sphinx_gallery_thumbnail_number = 14
# Authors: Denis Engemann <denis.engemann@gmail.com>
# Luke Bloy <luke.bloy@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from mne.filter import next_fast_len
from mayavi import mlab
import mne
print(__d... |
keras-team/keras-io | examples/nlp/ipynb/text_classification_with_switch_transformer.ipynb | apache-2.0 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
Explanation: Text classification with Switch Transformer
Author: Khalid Salama<br>
Date created: 2020/05/10<br>
Last modified: 2021/02/15<br>
Description: Implement a Switch Transformer for text classification.
Introduction
Th... |
fwenzel/github-org-scripts | User Search.ipynb | bsd-3-clause | print(github3.__version__)
print(github3.__file__)
"""
Explanation: User Search
For use to:
1. Try to find an account based on random knowledge
2. List all orgs they belong to (from a subset)
- You will need org owner permissions to perform these searches
Boiler plate
Skip/hide this. Common usage is below.
End of ex... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_background_statistics.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
from functools import partial
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # noqa, analysis:ignore
import mne
from mne.stats import (ttest_1samp_no_p, bonferroni_correctio... |
tpin3694/tpin3694.github.io | python/simple_unit_test.ipynb | mit | import unittest
import sys
"""
Explanation: Title: Simple Unit Test
Slug: simple_unit_test
Summary: A simple unit test in Python.
Date: 2016-01-23 12:00
Category: Python
Tags: Testing
Authors: Chris Albon
Interesting in learning more? Here are some good books on unit testing in Python: Python Testing: Beginner's Gu... |
PrairieLearn/PrairieLearn | exampleCourse/questions/demo/annotated/MarkovChainGroupActivity/MarkovChains-PageRank/serverFilesQuestion/Markov-Chains-3.ipynb | agpl-3.0 | A = np.array([[0, 2, 0, 5],
[1, 0, 5, 6],
[2, 4, 0, 3],
[1, 0, 10, 2]])
labels = ['Google', 'Twitter', 'Facebook', 'Reddit']
graph.draw_matrix(A, labels)
"""
Explanation: Google PageRank
Google's dominance as a search engine came from their PageRank algorithm, nam... |
miykael/nipype_tutorial | notebooks/basic_error_and_crashes.ipynb | bsd-3-clause | %%bash
rm $(pwd)/crash-*
"""
Explanation: Errors and Crashes
Probably the most important chapter in this section is about how to handle error and crashes. Because at the beginning you will run into a few.
For example:
You specified filenames or paths that don't exist.
You try to give an interface a string as input, w... |
methylDragon/news-anaCrawler | newspaper_plotting.ipynb | gpl-3.0 | firebase = pyrebase.initialize_app(config)
auth = firebase.auth()
uid = ""
password = ""
user = auth.sign_in_with_email_and_password(uid, password)
db = firebase.database() # reference to the database service
def firebaseRefresh():
global user
user = auth.refresh(user['refreshToken'])
"""
Explanation... |
adamamiller/NUREU17 | LSST/VariableStarClassification/scripts/ptf_query/byOid/url_by_oid.ipynb | mit | import numpy as np
from astropy.table import Table as tbl
import urllib.request
import urllib.parse
import subprocess
import matplotlib.pyplot as plt
from cesium import featurize
%matplotlib inline
import sqlite3
"""
Explanation: Written by Nick Easton for the Zooniverse LSST Project.
<br> July, 2017
Create a script ... |
NeuroDataDesign/pan-synapse | pipeline_1/background/Thresholding.ipynb | apache-2.0 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pickle
import sys
sys.path.insert(0,'../code/functions/')
import connectLib as cLib
import plosLib as pLib
import mouseVis as mv
import tiffIO as tIO
data0 = tIO.unzipChannels(tIO.loadTiff('../data/SEP-GluA1-KI_tp1.tif')... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/labs/featurization.ipynb | apache-2.0 | !pip install -q --upgrade tensorflow-datasets
"""
Explanation: Using side features: feature preprocessing
Learning Objectives
Turning categorical features into embeddings.
Normalizing continuous features.
Processing text features.
Build a User and Movie model.
Introduction
One of the great advantages of using a deep... |
tensorflow/fairness-indicators | g3doc/tutorials/Fairness_Indicators_Pandas_Case_Study.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... |
chezou/tabula-py | examples/tabula_example.ipynb | mit | !java -version
"""
Explanation: <a href="https://colab.research.google.com/github/chezou/tabula-py/blob/master/examples/tabula_example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
tabula-py example notebook
tabula-py is a tool for convert PDF tab... |
rvperry/phys202-2015-work | assignments/assignment07/AlgorithmsEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
"""
Explanation: Algorithms Exercise 1
Imports
End of explanation
"""
filter?
def tokenize(s, stop_words=None, punctuation='`~!@#$%^&*()_-+={[}]|\:;"<,>.?/}\t'):
"""Split a string into a list of words, removing punctuation and stop words... |
mlund/openmm-examples | yukawa/yukawa.ipynb | mit | %matplotlib inline
import numpy as np
from __future__ import print_function
from simtk.openmm import app
import simtk.openmm as mm
from simtk import unit
from sys import stdout, exit
import math
import mdtraj as mdtraj
from itertools import combinations
"""
Explanation: Custom Nonbonded Potential: Yukawa on rigid bodi... |
mne-tools/mne-tools.github.io | 0.23/_downloads/bdc8ac519d8f54d70a73a5e0de598566/50_background_freesurfer_mne.ipynb | bsd-3-clause | import os
import numpy as np
import nibabel
import matplotlib.pyplot as plt
import matplotlib.patheffects as path_effects
import mne
from mne.transforms import apply_trans
from mne.io.constants import FIFF
"""
Explanation: How MNE uses FreeSurfer's outputs
This tutorial explains how MRI coordinate frames are handled... |
sbussmann/buda-rank | notebooks/Summer Club and Hat League 2016.ipynb | mit | # Load the "autoreload" extension
%load_ext autoreload
# always reload modules marked with "%aimport"
%autoreload 1
import os
import sys
# add the 'src' directory as one where we can import modules
src_dir = os.path.join(os.getcwd(), os.pardir, 'src', 'data')
sys.path.append(src_dir)
%aimport scrape_buda
import pa... |
neurodata/ndreg | ndreg_demo_real_data.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib
import ndreg
from ndreg import preprocessor, util, plotter
import SimpleITK as sitk
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
def myshow(img, cmap='gray', colorbar=False):
plt.imshow(sitk.GetArrayViewFromImage(img), cmap=cmap)
if ... |
mnschmit/LMU-Syntax-nat-rlicher-Sprachen | 11-notebook.ipynb | apache-2.0 | test_sentences = [
"the men saw a car .",
"the woman gave the man a book .",
"she gave a book to the man .",
"yesterday , all my trouble seemed so far away ."
]
import nltk
from nltk.corpus import treebank
from nltk.grammar import ProbabilisticProduction, PCFG
# Production count: the number of times a... |
tmm/DS501 | 2/CaseStudy2.ipynb | mit | from IPython.lib.display import YouTubeVideo
YouTubeVideo('6O43gOxtaWo', start=14)
"""
Explanation: Case Study 2 : Analyzing data from MovieLens
Due Date: March 5, 2016 5:59PM
*------------
The MovieLens data sets
<img src="https://pbs.twimg.com/profile_images/378800000380161537/b6fa868dce43807d4e67462587d0b0d2_400x... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/06_structured/labs/2_sample.ipynb | apache-2.0 | # change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.environ['PROJECT'] = PROJECT
os.environ['REGION'] = REGION
%%bash
if ! gsutil ls | grep -q gs://${BUCKET}/; then
gsutil mb -l ${REGION} gs://$... |
DaveBackus/Data_Bootcamp | Code/IPython/bootcamp_pandas-clean.ipynb | mit | import sys # system module
import pandas as pd # data package
import matplotlib.pyplot as plt # graphics module
import datetime as dt # date and time module
import numpy as np # foundation for Pandas
%matplotlib inline ... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Glaciers, Ice.
P... |
achave11/bioapi-examples | python_notebooks/1kg_read_service.ipynb | apache-2.0 | import ga4gh_client.client as client
c = client.HttpClient("http://1kgenomes.ga4gh.org")
"""
Explanation: GA4GH 1000 Genomes Reads Protocol Example
This example illustrates how to access alignment data made available using a GA4GH interface.
Initialize the client
In this step we create a client object which will be us... |
darkomen/TFG | medidas/20072015/BQ/Untitled.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
pastas/pasta | concepts/hantush_response.ipynb | mit | import numpy as np
import pandas as pd
import pastas as ps
ps.show_versions()
"""
Explanation: Hantush response functions
This notebook compares the two Hantush response function implementations in Pastas.
Developed by D.A. Brakenhoff (Artesia, 2021)
Contents
Hantush versus HantushWellModel
Which Hantush should I us... |
GoogleCloudPlatform/training-data-analyst | blogs/nexrad2/visualize/radardata.ipynb | apache-2.0 | %bash
rm -rf data
mkdir data
cd data
RADAR=KIWA
YEAR=2013
MONTH=07
DAY=23
HOUR=23
gsutil cp gs://gcp-public-data-nexrad-l2/$YEAR/$MONTH/$DAY/$RADAR/*_$RADAR_${YEAR}${MONTH}${DAY}${HOUR}0000_${YEAR}${MONTH}${DAY}${HOUR}5959.tar temp.tar
tar xvf temp.tar
rm *.tar
ls
"""
Explanation: <h1> Reading NEXRAD Level II data fro... |
palrogg/foundations-homework | extra/join_lines.ipynb | mit | import re
filename = 'tabula-Actelion_transparency-report-2015'
file = open(filename+'.csv', 'r')
content = file.readlines()
content[:10]
"""
Explanation: Change the filename here
The csv file without extension. Its new name will be [filename]-corrected.csv
End of explanation
"""
twodigits = re.compile('\.?\d{2}"?$'... |
phoebe-project/phoebe2-docs | 2.3/tutorials/features.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
import phoebe
from phoebe import u # units
logger = phoebe.logger()
b = phoebe.default_binary()
"""
Explanation: Features
Features within PHOEBE are anything that can be "attached" to a component or a dataset to inform how to compute the forward-model. These currently include sp... |
liganega/Gongsu-DataSci | previous/y2017/GongSu06_Errors_and_Exception_Handling.ipynb | gpl-3.0 | input_number = input("A number please: ")
number = int(input_number)
print("제곱의 결과는", number**2, "입니다.")
input_number = input("A number please: ")
number = int(input_number)
print("제곱의 결과는", number**2, "입니다.")
"""
Explanation: 오류 및 예외 처리
수정 사항
좀 더 실용적인 수학함수 활용 가능
개요
코딩할 때 발생할 수 있는 다양한 오류 살펴 보기
오류 메시지 정보 확인 방법... |
XinyiGong/pymks | notebooks/intro.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Meet PyMKS
In this short introduction, we will demonstrate the functionality of PyMKS to compute 2-point statistics in order to objectively quantify microstructures, predict effective properties ... |
deepchem/deepchem | examples/tutorials/Conditional_Generative_Adversarial_Networks.ipynb | mit | !pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Conditional Generative Adversarial Network
A Generative Adversarial Network (GAN) is a type of generative model. It consists of two parts called the "generator" and the "discriminator". The generator takes random values as input and tr... |
astarostin/MachineLearningSpecializationCoursera | course2/week3/Preprocessing_LR.ipynb | apache-2.0 | import pandas as pd
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
matplotlib.style.use('ggplot')
%matplotlib inline
"""
Explanation: Предобработка данных и логистическая регрессия для задачи бинарной классификации
Programming assignment
В задании вам будет предложено ознакомиться с основным... |
harshays/papers | graph_matching/graph_matching_notes.ipynb | mit | from IPython.display import IFrame
IFrame("./projection_onto_bistochastic_matrices.pdf", width=800, height=500)
"""
Explanation: Notes
Permuation matrices and graphs
$P$ obtained by permuting rows of an identity matrix. $N!$ possile permutations possible of an identity matrix. $PA$ permutes the $i^{th}$ row of A to $... |
gschivley/ERCOT_power | Raw Data/ERCOT/Hourly wind generation/Exploring hourly wind data.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
fn2009 = 'rpt.00013424.0000000000000000.20141016.182537070.ERCOT_2009_Hourly_Wind_Output.xls'
fn2015 = 'rpt.00013424.0000000000000000.ERCOT_2015_Hourly_Wind_Output.xlsx'
df_2009 = pd.read_excel(fn2009, index... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodyna... |
wikistat/Exploration | TutosRudim/Cal1-Python-SVDtoACP.ipynb | gpl-3.0 | # Construire la matrice de notes
import pandas as pd
note=[[6,6,5,5.5],[8,8,8,8],[6,7,11,9.5],[14.5,14.5,15.5,15],
[14,14,12,12.5],[11,10,5.5,7],[5.5,7,14,11.5],[13,12.5,8.5,9.5],
[9,9.5,12.5,12]]
dat=pd.DataFrame(note,index=["jean","alai","anni","moni","didi","andr","pier","brig","evel"],
columns=["Math","Phy... |
Jackporter415/phys202-2015-work | assignments/assignment06/DisplayEx01.ipynb | mit | from IPython.display import Image
from IPython.display import HTML
from IPython.display import IFrame
assert True # leave this to grade the import statements
"""
Explanation: Display Exercise 1
Imports
Put any needed imports needed to display rich output the following cell:
End of explanation
"""
Image(url = 'http... |
fujii-team/Henbun | notebooks/Expert_GPR.ipynb | apache-2.0 | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import Henbun as hb
"""
Explanation: Regression Demo
This notebook briefly describes how to make an variational inference with Henbun.
Keisuke Fujii, 21st Nov. 2016
We show
+ Expert model with Gaussian process prior
that is... |
jsjol/GaussianProcessRegressionForDiffusionMRI | notebooks/batch_run_SPARC.ipynb | bsd-3-clause | %load_ext autoreload
%autoreload 2
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import seaborn as sns
import pickle
import json
import numpy as np
import matplotlib.pyplot as plt
import GPy
import dipy.reconst.dti as dti
from d... |
navierula/Subreddit-Analysis-on-Eating-Disorders | Prediction.ipynb | mit | import pandas as pd
anorexiaSubreddits = pd.read_csv("data/subreddits_anorexia.csv", encoding='ISO-8859-1')
obesitySubreddits = pd.read_csv("data/subreddits_obesity.csv", encoding='ISO-8859-1')
bothSubreddits = pd.read_csv("data/subreddits_both.csv", encoding='ISO-8859-1')
"""
Explanation: Load datasets into Pandas.
... |
vbsteja/code | Python/probabilistic/stat101.ipynb | apache-2.0 | import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
np.seed = 33
"""
Explanation: <a href="https://colab.research.google.com/github/vbsteja/code/blob/master/Python/probabilistic/stat101.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.