repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
schoolie/bokeh | examples/howto/charts/deep_dive.ipynb | bsd-3-clause | import pandas as pd
from bokeh.charts import Scatter, show, output_notebook
output_notebook()
"""
Explanation: Bokeh Charts Deep Dive
Charts Purpose
Charts provides a few things, but the core purpose is to help you understand your data by separating it into unique visual groups before you know what those groups are.
W... |
irockafe/revo_healthcare | notebooks/MTBLS315/exploratory/MTBLS315_uhplc_pos_classifer_craigs_data.ipynb | mit | import time
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from sklearn import preprocessing
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import StratifiedShuffleSplit
from sklearn.cross_validation import cross_val_score
#from sklearn.... |
napsternxg/ipython-notebooks | IRCTC Data Hack.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
# Load the data into a dataframe
df = pd.read_csv("data/isl_wise_train_detail_03082015_v1.csv")
sns.set_context("poster")
# Show some rows
df.head()
df.columns
# Convert time columns to datetime objects
d... |
humberto-ortiz/bioinf2017 | align.ipynb | gpl-3.0 | import numpy as np
"""
Explanation: Pairwise Alignment Example
Humberto Ortiz-Zuazaga
Introduction
This jupyter notebook presents a pairwise alignment of two nucleotide sequences with an edit distance metric. If you don't have jupyter, just save the code blocks to a python file and run the program. Sometimes, the foll... |
SylvainCorlay/bqplot | examples/Tutorials/Fast Interval Selector.ipynb | apache-2.0 | import numpy as np
from ipywidgets import Layout, HTML, VBox
import bqplot.pyplot as plt
"""
Explanation: Linking Plots Using Fast Interval Selector
Details on how to use the fast interval selector can be found in this notebook. In this tutorial notebook, we will look at linking plots using the fast interval selector... |
bpgc-cte/python2017 | Week 7/Testing/Testing in Python.ipynb | mit | import unittest
def cube(x):
return x ** 3
def square(x):
return x**2
def add(x, y):
return x + y
class CalcTest(unittest.TestCase):
def test_square(self):
self.assertTrue(square(3) == 9)
self.assertFalse(square(1) == 2)
with self.assertRaises(TypeError):
cube("Li... |
joels94/Udacity-MLND-Capstone-Handwritting-Digit-Recognition | handwritten_digit_recognizer.ipynb | mit | from __future__ import print_function
from numpy import random
from keras.datasets import mnist # helps in loading the MNIST dataset
from keras.models import Sequential
from keras.layers import Input, Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import np_uti... |
JesseScott/PolyglotVancouver-Analysis | polyglot_03_senior.ipynb | gpl-3.0 | # Imports
import sys
import pandas as pd
import csv
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (20.0, 10.0)
# %load util.py
#!/usr/bin/python
# Util file to import in all of the notebooks to allow for easy code re-use
# Calculate Percent of Attendees that did not speak
def... |
chemo-wakate/tutorial-6th | beginner/mario/LinearAndMultipleRegressions.ipynb | mit | # 数値計算やデータフレーム操作に関するライブラリをインポートする
import numpy as np
import pandas as pd
# URL によるリソースへのアクセスを提供するライブラリをインポートする。
# import urllib # Python 2 の場合
import urllib.request # Python 3 の場合
# 図やグラフを図示するためのライブラリをインポートする。
import matplotlib.pyplot as plt
%matplotlib inline
# 線形回帰を行なうライブラリ
from sklearn import linear_model
"""
Ex... |
hich28/mytesttxx | tests/python/formulas.ipynb | gpl-3.0 | import spot
"""
Explanation: Handling LTL and PSL formulas
End of explanation
"""
f = spot.formula('p1 U p2 R (p3 & !p4)')
f
g = spot.formula('{a;b*;c[+]}<>->GFb'); g
"""
Explanation: For interactive use, formulas can be entered as text strings and passed to the spot.formula constructor.
End of explanation
"""
h... |
nick-youngblut/SIPSim | ipynb/example/.ipynb_checkpoints/2_simulation-simple-checkpoint.ipynb | mit | workDir = '/home/nick/t/SIPSim/'
nprocs = 3
"""
Explanation: Description
Time to make a simple SIP data simulation with the dataset that you alreadly created
Setting variables
"workDir" is the path to the working directory for this analysis (where the files will be download to)
NOTE: MAKE SURE to modify this path t... |
ytmimi/Thesis2017 | ma_option_vol/Main.ipynb | mit | #necessary imports
import os
import sys
import add_bloomberg_excel_functions as abxl
import generate_company_workbooks as gcw
import generate_sorted_options_workbooks as gsow
import update_excel_workbooks as uxlw
import iv_calculation as ivc
import create_atm_vol_series as cavs
from CONSTANTS import ACQUIRER_DIR, TARGE... |
rmcgibbo/mdtraj | examples/principal-components.ipynb | lgpl-2.1 | from __future__ import print_function
%matplotlib inline
import mdtraj as md
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
"""
Explanation: scikit-learn is a machine learning library for python, with a very easy to use API and great documentation.
End of explanation
"""
traj = md.load('ala2.h... |
mirjalil/DataScience | bigdata-platforms/.ipynb_checkpoints/pyspark-mllib-package-checkpoint.ipynb | gpl-2.0 | from pyspark import SparkContext
sc = SparkContext('local','example')
from pyspark.mllib.linalg import Vectors
x = Vectors.dense([1,2,3,4])
x[0]
x = [Vectors.dense([1,2,3,4,5]), Vectors.dense([6,7,8,9,10])]
xrdd = sc.parallelize(x, 2)
xrdd.glom().collect()
"""
Explanation: Machine Learning in Spark
Data Types
M... |
cuttlefishh/emp | code/05-alpha-diversity/alpha_diversity_90bp_100bp_150bp.ipynb | bsd-3-clause | import pandas as pd
import math
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from empcolors import get_empo_cat_color
%matplotlib inline
"""
Explanation: author: lukethompson@gmail.com<br>
date: 7 Oct 2017<br>
language: Python 3.5<br>
license: BSD3<br>
alpha_diversity_90bp_100bp_150bp.ipynb... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/ukesm1-0-mmh/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-mmh', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: MOHC
Source ID: UKESM1-0-MMH
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics... |
abulbasar/machine-learning | Scikit - 20 Kaggle House Data Preprocessing.ipynb | apache-2.0 | df.isnull().sum().sum() / (df.shape[0] * df.shape[1])
"""
Explanation: Loaded both datasets and combined them into a single dataset for data preprocessing. When we are ready for modeling prepearion, we will split them into 2 datasets.
Amount of NA values
End of explanation
"""
def find_null_columns():
null_colu... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_lcmv_beamformer_volume.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.beamformer import lcmv
from nilearn.plotting import plot_stat_map
from nilearn.image import index_img
print(__doc_... |
joommf/tutorial | workshops/Durham/.ipynb_checkpoints/tutorial2_hamiltonian-checkpoint.ipynb | bsd-3-clause | p1 = (0, 0, 0)
p2 = (10e-9, 1e-9, 1e-9)
cell = (1e-9, 1e-9, 1e-9)
mesh = oc.Mesh(p1=p1, p2=p2, cell=cell)
system = oc.System(name="zeeman") # create the (micromagnetic) system object
H = (0, 0, 1e6) # external magnetic field (A/m)
Ms = 8e6 # saturation magnetisation (A/m)
system.hamiltonian = oc.Zeeman(H=H) # def... |
allisony/pyspeckit | examples/AmmoniaLevelPopulation.ipynb | mit | from astropy import units as u
from astropy import constants
freq = 23*u.GHz
def tau_wrong(tkin, tex):
return (1-np.exp(-constants.h * freq/(constants.k_B*tkin)))/(1+np.exp(-constants.h * freq/(constants.k_B*tex)))
def tau_right(tex):
return (1-np.exp(-constants.h * freq/(constants.k_B*tex)))/(1+np.exp(-constan... |
DestrinStorm/deep-learning | batch-norm/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... |
msadegh97/machine-learning-course | 06-clustering.ipynb | gpl-3.0 | from sklearn.datasets import make_blobs
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
plt.figure(figsize=(12, 12))
n_samples = 1500
random_state = 1760
X, y = make_blobs(n_samples=n_samples, random_state=random_state)
kmeans = KMeans(n_clusters=3)
kmeans.fit_predict(X)
y_pre... |
ML4DS/ML4all | TM1.IntrodNLP/NLP_py2_wikitools/databricks/TM1_NLP_db.ipynb | mit | # %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# import pylab
# Required imports
from wikitools import wiki
from wikitools import category
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from time import time
from... |
SheffieldML/notebook | compbio/SingleCellDataWithGPy.ipynb | bsd-3-clause | import pods, GPy, itertools
%matplotlib inline
from matplotlib import pyplot as plt
"""
Explanation: Blastocyst Development in Mice: Single Cell TaqMan Arrays
presented at the EBI BioPreDyn Course 'The Systems Biology Modelling Cycle'
Max Zwiessele, Oliver Stegle, Neil Lawrence 12th May 2014 University of Sheffield an... |
ES-DOC/esdoc-jupyterhub | notebooks/cas/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cas', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: CAS
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties: 3... |
VVard0g/ThreatHunter-Playbook | docs/notebooks/windows/08_lateral_movement/WIN-201009183000.ipynb | mit | from openhunt.mordorutils import *
spark = get_spark()
"""
Explanation: Remote DCOM IErtUtil DLL Hijack
Metadata
| Metadata | Value |
|:------------------|:---|
| collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] |
| creation date | 2020/10/09 |
| modification date | 2020/10/09 |
| playbook related ... |
rainyear/pytips | Tips/2016-03-10-Scope-and-Closure.ipynb | mit | scopes = {
"local": {"locals": None,
"non-local": {"locals": None,
"global": {"locals": None,
"built-in": ["built-ins"]}}},
}
"""
Explanation: 闭包(Closure)
在计算机科学中,闭包(英语:Closure),又称词法闭包(Lexical Closure)或函数闭包(function closures),是引用了自由变量的函数。这... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/time_series_prediction/labs/optional_1_data_exploration.ipynb | apache-2.0 | PROJECT = 'your-gcp-project' # Change to your project.
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from google.cloud import bigquery
from IPython.core.magic import register_cell_magic
from IPython import get_ipython
bq = bigquery.Client(project=PROJECT)
# Allow... |
tensorflow/docs-l10n | site/ja/probability/examples/HLM_TFP_R_Stan.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
PySCeS/PyscesToolbox | example_notebooks/Thermokin.ipynb | bsd-3-clause | mod = pysces.model('lin4_fb')
tk = psctb.ThermoKin(mod)
"""
Explanation: Thermokin
Thermokin is used to assess the kinetic and thermodynamic aspects of enzyme catalysed reactions in metabolic pathways [7,8]. It provides the functionality to automatically separate the rate equations of reversible reactions into a mass-... |
llvll/beaconml | ip[y]/beaconml.ipynb | bsd-2-clause | # Let's inspect this CSV file
import pandas as pd
some_data =pd.read_csv("../data/beacon_data.csv", header=0, index_col=None)
some_data.head(15)
"""
Explanation: BeaconML
Machine learning in action for iBeacon-based advertising
This is a simple demo to show the machine learning in action for iBeacon-based advertising.... |
yedivanseven/bestPy | examples/01_GettingStarted.ipynb | gpl-3.0 | import sys
sys.path.append('../..')
"""
Explanation: CHAPTER 1
Getting Started
Welcome to bestPy! In this opening chapter, we will do a minimal setup to arrive at a recommendation quickly, just to wet your appetite.
Preliminaries
We only need this because the examples folder is a subdirectory of the bestPy package.
En... |
leriomaggio/deep-learning-keras-tensorflow | 1. ANN/1.1 Introduction - Deep Learning and ANN.ipynb | mit | # Import the required packages
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy
# Display plots in notebook
%matplotlib inline
# Define plot's default figure size
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
#read the datasets
train = pd.read_csv("../data/i... |
0Rick0/Fontys-DS-GCD | MongoDB.ipynb | mit | from pymongo import MongoClient, IndexModel, ASCENDING, DESCENDING
from bson.son import SON
cl = MongoClient()
scratch_db = cl.scratch
first = scratch_db.zips.find().limit(10)
for item in first:
print(item)
"""
Explanation: MongoDB in Python
End of explanation
"""
scratch_db.zips.drop_indexes()
count = scr... |
tensorflow/docs-l10n | site/ko/hub/tutorials/action_recognition_with_tf_hub.ipynb | apache-2.0 | # Copyright 2018 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... |
google/physics-math-tutorials | colabs/tn_bootcamp.ipynb | apache-2.0 | import numpy as np
from numpy import linalg as LA
import itertools
"""
Explanation: Copyright 2021 Google LLC
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-... |
miguelfrde/stanford-cs231n | assignment1/features.ipynb | mit | import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
from __future__ import print_function
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gr... |
hamed/WCN3 | 2-intro-to-brian-synapses.ipynb | gpl-3.0 | from brian2 import *
%matplotlib inline
"""
Explanation: Introduction to Brian part 2: Synapses
If you haven't yet read part 1: Neurons, go read that now.
As before we start by importing the Brian package and setting up matplotlib for IPython:
End of explanation
"""
start_scope()
eqs = '''
'''
# 2 neurons, threshol... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/hadgem3-gc31-lm/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-lm', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: MOHC
Source ID: HADGEM3-GC31-LM
Topic: Atmos
Sub-Topics: Dynamical Core, Radia... |
francesco-mannella/neunet-basics | course/hopfield-MNIST-simulation.ipynb | mit | %matplotlib inline
from pylab import *
"""
Explanation: Storing and recalling MNIST digits with Hopfield nets
End of explanation
"""
#### Download the dataset
# Get the script from internet
! wget https://raw.githubusercontent.com/sorki/python-mnist/master/get_data.sh > /dev/null 2>&1
# Run it to dovnload all fi... |
CalPolyPat/Python-Workshop | Python Workshop/Variables and Operators.ipynb | mit | a=45
print(a)
b=25
print(b)
"""
Explanation: Variables
Variables are object that store data somewhere. Let's see an example.
End of explanation
"""
x="Hello Everybody!"
print(x)
Amiright=True
print(Amiright)
"""
Explanation: Okay, neat. Can I only make variables that hold numbers?
End of explanation
"""
fl = 0.... |
CopernicusMarineInsitu/INSTACTraining | PythonNotebooks/PlatformPlots/Read_drifter_data_2.ipynb | mit | year = 2015
month = 7
%matplotlib inline
import glob
import os
import netCDF4
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from matplotlib import colors
"""
Explanation: This notebook uses what was shown in the previous one.<br/>
The goal is represent all the temperatur... |
garth-wells/notebooks-3M1 | 01-Fundamentals.ipynb | bsd-2-clause | import numpy as np
np.random.seed(2)
x = np.random.rand(10) + 1j*np.random.rand(10)
print(x)
"""
Explanation: Vectors, matrices and norms
The notebook demonstrate the computation and use of some important concepts in linear algebra. NumPy is used for the numerical computations.
Vector norms
The $l_{p}$-norm,of a vect... |
tensorflow/docs-l10n | site/ko/tutorials/images/transfer_learning_with_hub.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... |
DS-100/sp17-materials | sp17/labs/lab04/lab04_solution.ipynb | gpl-3.0 | # Run this cell to set up the notebook.
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('lab04.ok')
"""
Explanation: Lab 4: Baby Names
End of explanation
"""
... |
philmui/datascience | lecture07.big.data/lecture07.1.clean.data.ipynb | mit | weather = pd.read_csv("data/berlin_weather.csv")
weather.head(4)
"""
Explanation: 1. Cleaning Data
End of explanation
"""
weather = weather.applymap(lambda x: np.nan if x == -9999 else x)
weather.head(4)
"""
Explanation: Looks like the value "-9999" is used to indicate a missing value. Let's fix this to the norm... |
ProjectQ-Framework/ProjectQ | examples/compiler_tutorial.ipynb | apache-2.0 | import projectq
from projectq.backends import CommandPrinter
from projectq.meta import Control
from projectq.ops import All, CNOT, Measure, QFT, QubitOperator, Rx, TimeEvolution, X
# create the compiler and specify the backend:
eng = projectq.MainEngine(backend=CommandPrinter(accept_input=False))
def my_quantum_progr... |
tensorflow/neural-structured-learning | research/third_party/denoised_smoothing/notebooks/Certification_Test.ipynb | apache-2.0 | !pip install -q easydict
!git clone https://github.com/sayakpaul/neural-structured-learning
!cd neural-structured-learning/research/denoised_smoothing && tar xf models.tar.gz
import sys
sys.path.append("neural-structured-learning/research/denoised_smoothing")
from scripts import certify, analyze
import matplotlib.py... |
Radiomics/pyradiomics | labs/pyradiomics-reproduce/notebooks/USF_repeats.ipynb | bsd-3-clause | from radiomics import firstorder, shape, glcm
import os, sys
import numpy as np
import SimpleITK as sitk
import pandas as pd
def normalizedImage(image):
im_arr = sitk.GetArrayFromImage(image).astype(float)
print("Intensity range: ", np.min(im_arr), np.max(im_arr))
im_arr += np.min(im_arr)
im_arr *=... |
jorisvandenbossche/DS-python-data-analysis | _solved/pandas_04_time_series_data.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
"""
Explanation: <p><font size="6"><b>04 - Pandas: Working with time series data</b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenb... |
mne-tools/mne-tools.github.io | 0.18/_downloads/19760b3068251666d2866a483589cbfa/plot_artifacts_correction_ica.ipynb | bsd-3-clause | import numpy as np
import mne
from mne.datasets import sample
from mne.preprocessing import ICA
from mne.preprocessing import create_eog_epochs, create_ecg_epochs
# getting some data ready
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
raw = mne.io.read_raw_fif(... |
jmhsi/justin_tinker | data_science/courses/deeplearning2/rossman.ipynb | apache-2.0 | %matplotlib inline
import math, keras, datetime, pandas as pd, numpy as np, keras.backend as K
import matplotlib.pyplot as plt, xgboost, operator, random, pickle
from utils2 import *
np.set_printoptions(threshold=50, edgeitems=20)
limit_mem()
from isoweek import Week
from pandas_summary import DataFrameSummary
%c... |
kwant-project/kwant-tutorial-2016 | 3.1.Aharonov-Bohm-cheat.ipynb | bsd-2-clause | from math import pi
%run matplotlib_setup.ipy
from matplotlib import pyplot
import numpy as np
import kwant
lat=kwant.lattice.square()
L,W=30,16
def myshape(R): return (
(R[0]**2 + R[1]**2) > (L-W/2)**2 and
(R[0]**2 + R[1]**2) < (L+W/2)**2)
#L,W=30,16
#def myshape_ellipse(R): return... |
niallrobinson/jade-hack | Notebook Intro.ipynb | gpl-3.0 | print('run Python.')
print('Each cell is separate from the others...')
print('and can be re-executed on the fly')
"""
Explanation: Jupyter Notebooks
A Notebook is made up of a series of executable cells. You can control them from the menues, or see the extensive keyboard short cuts by pressing esc then h.
Making note... |
mauriciogtec/PropedeuticoDataScience2017 | Alumnos/Leonardo_Marin/Tarea2.ipynb | mit | #######################################################################
### Parte 2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from PIL import Image
# Importar imagen
imagen = Image.open('C:/Users/Data Mining/Documents/ITAM/Propedeutico/Alumnos/PropedeuticoDataScience2017/Alumnos/Leonardo... |
justacec/bokeh | examples/howto/charts/donut.ipynb | bsd-3-clause | d = Donut([2, 4, 5, 2, 8])
show(d)
"""
Explanation: Generic Examples
Values with implied index
End of explanation
"""
d = Donut(pd.Series([2, 4, 5, 2, 8], index=['a', 'b', 'c', 'd', 'e']))
show(d)
"""
Explanation: Values with Explicit Index
End of explanation
"""
autompg.head()
"""
Explanation: Autompg Data
Take... |
googleinterns/wss | third_party/slim/slim_walkthrough.ipynb | apache-2.0 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
import math
import numpy as np
import tensorflow.compat.v1 as tf
import time
from datasets import dataset_utils
# Main slim library
import ... |
nixphix/ml-projects | sentiment_analysis/twitter_sentiment_analysis-jallikattu/code/twitter_sentiment_analysis-jallikattu_FINAL.ipynb | mit | # import tweepy for twitter datastream and textblob for processing tweets
import tweepy
import textblob
# wordcloud package is used to produce the cool masked tag cloud above
from wordcloud import WordCloud
# pickle to serialize/deserialize python objects
import pickle
# regex package to extract hasttags from tweets... |
epfl-lts2/pygsp | examples/playground.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from pygsp import graphs, filters
plt.rcParams['figure.figsize'] = (17, 5)
"""
Explanation: Playing with the PyGSP
https://github.com/epfl-lts2/pygsp
End of explanation
"""
G = graphs.Logo()
G.estimate_lmax()
g = filters.Heat(G, tau=100)
"""
Ex... |
quantopian/research_public | notebooks/lectures/Integration_Cointegration_and_Stationarity/questions/notebook.ipynb | apache-2.0 | # Useful Functions
def check_for_stationarity(X, cutoff=0.01):
# H_0 in adfuller is unit root exists (non-stationary)
# We must observe significant p-value to convince ourselves that the series is stationary
pvalue = adfuller(X)[1]
if pvalue < cutoff:
print 'p-value = ' + str(pvalue) + ' The ser... |
NuGrid/NuPyCEE | regression_tests/temp/SYGMA_PopIIIstars.ipynb | bsd-3-clause | %pylab nbagg
import sygma as s
reload(s)
s.__file__
#from imp import *
#s=load_source('sygma','/home/nugrid/nugrid/SYGMA/SYGMA_online/SYGMA_dev/sygma.py')
from scipy.integrate import quad
from scipy.interpolate import UnivariateSpline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Test of POPIII s... |
AllenDowney/ThinkBayes2 | examples/gluten_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, MakeBinomialPmf
import thinkplot
i... |
goddoe/CADL | session-0/session-0.ipynb | apache-2.0 | 4*2
"""
Explanation: Session 0: Preliminaries with Python/Notebook
<p class="lead">
Parag K. Mital<br />
<a href="https://www.kadenze.com/courses/creative-applications-of-deep-learning-with-tensorflow/info">Creative Applications of Deep Learning w/ Tensorflow</a><br />
<a href="https://www.kadenze.com/partners/kadenze... |
thisisbasil/SarcasmDetectionTwitter | Workflow1.ipynb | gpl-3.0 | import csv
with open("processed_tweets/sarcastic_tweets.csv", 'r') as f:
reader = csv.reader(f)
linenumber = 1
try:
for row in reader:
linenumber += 1
except Exception as e:
print (("Error line %d: %s %s" % (linenumber, str(type(e)), e)))
"""
Explanation: Pre-processing
End ... |
yuhao0531/dmc | notebooks/week-4/02-tensorflow ANN for classification.ipynb | apache-2.0 | %matplotlib inline
import math
import random
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_boston
'''Since this is a classification problem, we will need to
represent our targets as one-hot encoding vectors (see previous lab).
To do this we will use sciki... |
kfollette/ASTR200-Spring2017 | Lecture Notes/ModelFitting.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
#generate some random numbers with values between -0.5 and 0.5, which we'll call "noise"
noise = (np.random.rand(11)-0.5)
noise
#plot simple relationship y=2x with this noise added
x = np.arange(11)
plt.plot(x,2*x+noise, 'bo')
plt.plot(x,2*x,'r--')... |
georgetown-analytics/yelp-classification | write_ups/Mongo_Connect.ipynb | mit | from pymongo import MongoClient
from datetime import datetime
import json
"""
Explanation: __| __|_ )
_| ( / Amazon Linux AMI
___|\___|___|
End of explanation
"""
ip = '54.236.23.221'
"""
Explanation: You have to change this variable each time the EC2 server stops or restarts. Please email/text me to ... |
tensorflow/probability | tensorflow_probability/examples/jupyter_notebooks/Gaussian_Process_Latent_Variable_Model.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# 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, sof... |
mnschmit/LMU-Syntax-nat-rlicher-Sprachen | 10-notebook.ipynb | apache-2.0 | import nltk
nltk.download()
"""
Explanation: Übungsblatt 10
Präsenzaufgaben
Aufgabe 1 Herunterladen von Ressourcen
Laden Sie sich zunächst die Ressource corpora/treebank über den NLTK Download-Manager herunter.
End of explanation
"""
cfg = """
S -> NP VP
VP -> V NP PP
VP -> V NP
NP -> DET N
NP -> ... |
linsalrob/PyFBA | iPythonNotebooks/Gap-fill_a_model.ipynb | mit | import sys
import os
import PyFBA
"""
Explanation: Gap-fill a model in PyFBA
by Daniel Cuevas
Introduction
In this notebook, we will present the steps to generate a genome-scale metabolic model from RAST annotations, gap-fill the model on rich LB type media, and save the model to hard disk.
The required files and inf... |
Dima806/udacity-mlnd-capstone | capstone-step3-final.ipynb | apache-2.0 | import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import time
from scipy import stats
from scipy.optimize import minimize
stud_learning = pd.read_csv('student_learning_final.csv')
stud_learning.drop(['Unnamed: 0'], axis=1, inplace=True)
cluster_index = pd.read_csv("cluster_index... |
AaronCWong/phys202-2015-work | days/day06/Matplotlib.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Visualization with Matplotlib
Learning Objectives: Learn how to make basic plots using Matplotlib's pylab API and how to use the Matplotlib documentation.
This notebook focuses only on the Matplotlib API, rather that the broader que... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/sandbox-2/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'sandbox-2', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: CMCC
Source ID: SANDBOX-2
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbul... |
UWSEDS/LectureNotes | save/07-Visualization-in-Python/Visualization in Python-AuxiliaryCodes.ipynb | bsd-2-clause | def mm(s_conc, vmax, km):
"""
:param np.array s_conc: substrate concentrations
:param float vmax: maximum reaction rate
:param float km: half substrate concentration
:return np.array: reaction rates
"""
result = vmax*s_conc/(s_conc+km)
return result
s_conc = np.array([m+0.1 for m in ran... |
ivukotic/ML_platform_tests | tutorial/CartPoleDemo/cart_pole.ipynb | gpl-3.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... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/building_production_ml_systems/labs/4b_streaming_data_inference_vertex.ipynb | apache-2.0 | !pip install --upgrade apache-beam[gcp]
"""
Explanation: Working with Streaming Data
Learning Objectives
1. Learn how to process real-time data for ML models using Cloud Dataflow
2. Learn how to serve online predictions using real-time data
Introduction
It can be useful to leverage real time data in a machine learni... |
Bio204-class/bio204-notebooks | 2016-04-04-ANOVA-as-sumofsquares-decomposition.ipynb | cc0-1.0 | def sum_squares_total(groups):
"""Calculate total sum of squares ignoring groups.
groups should be a sequence of np.arrays representing the samples asssigned
to their respective groups.
"""
allobs = np.ravel(groups) # np.ravel collapses arrays or lists into a single list
grandmean = np.me... |
jskksj/cv2stuff | cv2stuff/.ipynb_checkpoints/ConfigParser-checkpoint.ipynb | isc | config = configparser.ConfigParser()
config.sections()
config.read('example.ini')
config.sections()
'bitbucket.org' in config
'bytebong.com' in config
config['bitbucket.org']['User']
config['DEFAULT']['Compression']
topsecret = config['topsecret.server.com']
topsecret['ForwardX11']
topsecret['Port']
for key i... |
ES-DOC/esdoc-jupyterhub | notebooks/pcmdi/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: PCMDI
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emission... |
Mashimo/datascience | 01-Regression/CV.ipynb | apache-2.0 | import pandas as pd
autoData = pd.read_csv('../datasets/Auto.csv', na_values='?')
autoData.shape
"""
Explanation: ===Cross-validation===
Here we consider a class of methods that estimate the test error (the average error that results from using a statistical learning method to predict the response on a new observat... |
Mohamed-Elbially/PythonTutorials | ProbabilityDistriputions.ipynb | gpl-3.0 | n_values = [20, 20, 40] # list of number of trials of binomial experiment
b_values = [0.2, 0.6, 0.6] # list of P(success) of bernoulli experiment
linestyles = ['-', '--', ':'] # list of different line styles
x = np.arange(0, 40) # generate list of numbers from 0:39 with step of 1
fig, ... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_info.ipynb | bsd-3-clause | from __future__ import print_function
import mne
import os.path as op
"""
Explanation: The :class:Info <mne.Info> data structure
End of explanation
"""
# Read the info object from an example recording
info = mne.io.read_info(
op.join(mne.datasets.sample.data_path(), 'MEG', 'sample',
'sample_au... |
PMEAL/OpenPNM | examples/simulations/multiphysics/advection_diffusion.ipynb | mit | import numpy as np
import openpnm as op
%config InlineBackend.figure_formats = ['svg']
np.random.seed(10)
%matplotlib inline
ws = op.Workspace()
ws.settings["loglevel"] = 40
np.set_printoptions(precision=5)
shape = [1, 20, 30]
net = op.network.Cubic(shape=shape, spacing=1e-4)
"""
Explanation: Advection-Diffusion
In th... |
jrrembert/cybernetic-organism | dato/regression/.ipynb_checkpoints/Predicting house prices-checkpoint.ipynb | gpl-2.0 | import graphlab
"""
Explanation: Fire up graphlab create
End of explanation
"""
sales = graphlab.SFrame('home_data.gl/')
sales
"""
Explanation: Load some house sales data
Dataset is from house sales in King County, the region where the city of Seattle, WA is located.
End of explanation
"""
graphlab.canvas.set_ta... |
tensorflow/lucid | notebooks/local_development.ipynb | apache-2.0 | import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
"""
Explanation: Lucid local development notebook
This notebook allows you to use your development version of the lucid codebase.
It is meant to only be used during development of lu... |
VVard0g/ThreatHunter-Playbook | docs/notebooks/windows/09_collection/WIN-200609225055.ipynb | mit | from openhunt.mordorutils import *
spark = get_spark()
"""
Explanation: Access to Microphone Device
Metadata
| Metadata | Value |
|:------------------|:---|
| collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] |
| creation date | 2020/06/09 |
| modification date | 2020/09/20 |
| playbook related | []... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-aerchem/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-aerchem', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-AERCHEM
Topic: Ocean... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/NLP/elmo EMBEDDINGS/Elmo_contextual_embeddings.ipynb | apache-2.0 | import os
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow_hub as hub
from sklearn import preprocessing
!python -m spacy download en_core_web_md #you will need to install this on first load
import spacy
from spacy.lang.en import English
from spacy import displacy
nlp = spacy.load('en_co... |
ES-DOC/esdoc-jupyterhub | notebooks/csiro-bom/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'csiro-bom', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: CSIRO-BOM
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, ... |
GrachevArtem/dl_course | week_05/conv.ipynb | mit | image = imread("Путь до вашей картинки", mode='RGB')
plt.imshow(image)
"""
Explanation: Загрузим изображение
End of explanation
"""
def conv2d(input_image, kernel):
h, w, d = input_image.shape
k_h, k_w = kernel.shape
# Впишите свой код на месте заглушки
result = input_image
retu... |
ellisonbg/talk-2014 | Notebook Tour.ipynb | mit | from IPython.display import display, Image, HTML
from talktools import website, nbviewer
"""
Explanation: Notebook Tour
End of explanation
"""
import math
math.
"""
Explanation: The Jupyter Notebook is a web-based application that enables users to create documents that combine live code wth narrative next, equatio... |
google-aai/tf-serving-k8s-tutorial | jupyter/keras_training_to_serving_solution.ipynb | apache-2.0 | # Import Keras libraries
import keras.applications.resnet50 as resnet50
from keras.preprocessing import image
from keras import backend as K
import numpy as np
import os
# Import TensorFlow saved model libraries
import tensorflow as tf
from tensorflow.python.saved_model import builder as saved_model_builder
from tenso... |
roebius/deeplearning_keras2 | nbs2/kmeans_test.ipynb | apache-2.0 | import kmeans; reload(kmeans)
from kmeans import Kmeans
"""
Explanation: Clustering
Clustering techniques are unsupervised learning algorithms that try to group unlabelled data into "clusters", using the (typically spatial) structure of the data itself.
End of explanation
"""
n_clusters=6
n_samples =250
"""
Explana... |
mne-tools/mne-tools.github.io | 0.19/_downloads/99d2306f38e4ae32ce5d28d8fa3bcba5/plot_lcmv_beamformer.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import numpy as np
import mne
from mne.datasets import sample
from mne.beamformer import make_lcmv, apply_lcmv
print(__doc__)
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sa... |
tommytwoeyes/continuity | Homework_Assignments/HW_11.7_Series_Testing_Strategy_[EC].ipynb | gpl-3.0 | import sympy as sp
from matplotlib import pyplot as plt
%matplotlib inline
# Customize figure size
plt.rcParams['figure.figsize'] = 25, 15
#plt.rcParams['lines.linewidth'] = 1
#plt.rcParams['lines.color'] = 'g'
plt.rcParams['font.family'] = 'monospace'
plt.rcParams['font.size'] = '16.0'
plt.rcParams['text.hinting'] =... |
DBWangGroupUNSW/COMP6714 | L2 - Preprocessing by NLTK.ipynb | mit | from pprint import pprint
import nltk
from nltk.book import *
doc = text6
print(doc)
"""
Explanation: Preprocessing by NLTK
In this notebook, we will use NLTK to preprocess text documents. NLTK is a widely used library for Natural Language Processing. In addition to many built-in capabilities, it has interfaces to ma... |
mne-tools/mne-tools.github.io | stable/_downloads/81e58e463fcd949fd4ab7ab7ab8ef317/left_cerebellum_volume_source.ipynb | bsd-3-clause | # Author: Alan Leggitt <alan.leggitt@ucsf.edu>
#
# License: BSD-3-Clause
import os.path as op
import mne
from mne import setup_source_space, setup_volume_source_space
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
subjects_dir = op.join(data_path, 'subjects')
subject = 'sample'
aseg_f... |
metpy/MetPy | v0.10/_downloads/53923345d98c487825399f76f4de00e7/Station_Plot_with_Layout.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import pandas as pd
from metpy.calc import wind_components
from metpy.cbook import get_test_data
from metpy.plots import (add_metpy_logo, simple_layout, StationPlot,
StationPlotLayout, wx_code_map)
fr... |
liangjg/openmc | examples/jupyter/triso.ipynb | mit | %matplotlib inline
from math import pi
import numpy as np
import matplotlib.pyplot as plt
import openmc
import openmc.model
"""
Explanation: OpenMC includes a few convenience functions for generationing TRISO particle locations and placing them in a lattice. To be clear, this capability is not a stochastic geometry ca... |
flaviocordova/udacity_deep_learn_project | gan_mnist/Intro_to_GANs_Exercises.ipynb | mit | %matplotlib inline
import pickle as pkl
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data')
"""
Explanation: Generative Adversarial Network
In this notebook, we'll be building a generativ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.