repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
mne-tools/mne-tools.github.io | dev/_downloads/31239620dd9631320a99b07ac4a81074/interpolate_bad_channels.ipynb | bsd-3-clause | # Authors: Denis A. Engemann <denis.engemann@gmail.com>
# Mainak Jas <mainak.jas@telecom-paristech.fr>
#
# License: BSD-3-Clause
import mne
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
fname = meg_path / 'sample_audvis-ave.fif'
evoked ... |
michaelbrundage/vowpal_wabbit | python/examples/Learning_to_Search.ipynb | bsd-3-clause | from __future__ import print_function
from vowpalwabbit import pyvw
"""
Explanation: A basic part of speech tagger
This tutorial walks you through writing learning to search code using the VW python interface. Once you've completed this, you can graduate to the C++ version, which will be faster for the computer but mo... |
tpin3694/tpin3694.github.io | sql/delete_a_table.ipynb | mit | # Ignore
%load_ext sql
%sql sqlite://
%config SqlMagic.feedback = False
"""
Explanation: Title: Delete A Table
Slug: delete_a_table
Summary: Delete an entire table in SQL.
Date: 2016-05-01 12:00
Category: SQL
Tags: Basics
Authors: Chris Albon
Note: This tutorial was written using Catherine Devlin's SQL in Jupyter N... |
dmolina/es_intro_python | 01-Instalación.ipynb | gpl-3.0 | #from IPython.display import HTML
#HTML('''<script>
#code_show=true;
#function code_toggle() {
# if (code_show){
# $('div.input').hide();
# } else {
# $('div.input').show();
# }#
# code_show = !code_show
#}
#$( ocument ).ready(code_toggle);
#</script>
#The raw code for this IPython notebook is by default hidden for e... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/04_features/a_features.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Ensure the right version of Tensorflow is installed.
!pip freeze | grep tensorflow==2.5
import math
import shutil
import numpy as np
import pandas as pd
import tensorflow as tf
print(tf.__version__)
tf.compat.v1.logging.set_verbosity(tf.compat.v1.l... |
mayankjohri/LetsExplorePython | Section 1 - Core Python/Chapter 02 - Data Types Part - 1/Lists.ipynb | gpl-3.0 | fruits = ['Apple', 'Mango', 'Grapes', 'Jackfruit',
'Apple', 'Banana', 'Grapes', [1, "Orange"]]
# processing the entire list
for fruit in fruits:
print(fruit, type(fruit))
#
print("*"*30)
fruits.insert(3, "Water Melon")
print(fruits)
# !! Gotcha's
fr = fruits
print(id(fr))
print(id(fruits))
ft1 = ... |
katelynneese/dmdd | dmdd_tutorial.ipynb | mit | I. Nuclear-recoil rates
-----
______
`dmdd` has three modules that let you calculate differential rate $\frac{dR}{dE_R}$ and total rate $R(E_R)$ of nuclear-recoil events:
I) `rate_UV`: rates for a variety of UV-complete theories (from Gresham & Zurek, 2014)
II) `rate_genNR`: rates for all non-relativistic scatt... |
robertoneil/coursera_images | Week2_Part2.ipynb | mit | %matplotlib inline
#import typical packages I'll be using
import cv2
import numpy as np
import matplotlib.pyplot as plt
from pylab import rcParams
rcParams['figure.figsize'] = 10, 10 #boiler plate to set the size of the figures
#Load a test image - Lena
im = cv2.imread("lena.tiff")
im_temp = cv2.cvtColor(im, cv2.COL... |
michael-isaev/cse6040_qna | PythonQnA_7_sets.ipynb | apache-2.0 | a = set ([1, 2, 3])
b = set ([2, 3, 4])
print ("Set a is", a)
print ("Set b is", b)
print ("Set intersection is", a & b)
print ("Set union is", a | b)
print ("Set symmetric difference is", a ^ b)
print ("Set difference 'a - b' is", a - b)
print ("Set difference 'b - a' is", b - a)
"""
Explanation: 7. Set Yourself Up... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-cm2-sr5/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-sr5', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-CM2-SR5
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics... |
rishuatgithub/MLPy | nlp/UPDATED_NLP_COURSE/02-Parts-of-Speech-Tagging/05-POS-Assessment.ipynb | apache-2.0 | # RUN THIS CELL to perform standard imports:
import spacy
nlp = spacy.load('en_core_web_sm')
from spacy import displacy
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Parts of Speech Assessment
For this assessment we'll be using the short story The Tale of Peter Rabb... |
essicolo/GCI733-A2015 | barriere-capillaire.ipynb | mit | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
from scipy.integrate import quad
from scipy.interpolate import interp1d
"""
Explanation: Profils de succion et drainage latéral dans les barrières capillaires
Pour exécuter une cellule, Ctrl +... |
tensorflow/docs-l10n | site/zh-cn/hub/tutorials/tf_hub_generative_image_module.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... |
elmaso/tno-ai | aind2-cnn/mnist-mlp/mnist_mlp.ipynb | gpl-3.0 | from keras.datasets import mnist
# use Keras to import pre-shuffled MNIST database
(X_train, y_train), (X_test, y_test) = mnist.load_data()
print("The MNIST database has a training set of %d examples." % len(X_train))
print("The MNIST database has a test set of %d examples." % len(X_test))
"""
Explanation: Artificia... |
halfak/are-the-bots-really-fighting | analysis/main/5-1-descriptive-stats.ipynb | mit | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import pickle
import datetime
%matplotlib inline
start = datetime.datetime.now()
"""
Explanation: Section 5.1: Descriptive statistics on the bot-bot revert dataset
This is the first data analysis script used to produce findin... |
GoogleCloudPlatform/oss-test-infra | ml/tf-prow-squad.ipynb | apache-2.0 | vm_image_project='deeplearning-platform-release'
vm_image_family='tf-ent-2-8-cu113-notebooks'
machine_type='n1-standard-8'
location='us-central1-a'
accelerator_type='CHOOSE' # eg, 'NVIDIA_TESLA_V100'
accelerator_cores=1
project='MY_PROJECT_ID'
instance_name='MY_INSTANCE_NAME'
print('Run the following command:')
print(... |
yttty/python3-scraper-tutorial | Python_Spider_Tutorial_07.ipynb | gpl-3.0 | import json
from urllib.request import urlopen
def getCountry(ipAddress):
response = urlopen("http://freegeoip.net/json/"+ipAddress).read().decode('utf-8')
responseJson = json.loads(response)
return responseJson.get("country_code")
"""
Explanation: 用Python 3开发网络爬虫
By Terrill Yang (Github: https://github.c... |
mne-tools/mne-tools.github.io | 0.24/_downloads/8b7a85d4b98927c93b7d9ca1da8d2ab2/compute_mne_inverse_volume.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
from nilearn.plotting import plot_stat_map
from nilearn.image import index_img
from mne.datasets import sample
from mne import read_evokeds
from mne.minimum_norm import apply_inverse, read_inverse_operator
print(__doc__)
data_path ... |
ilanman/gdi | week3/03_Week3_II_numpy_sol.ipynb | mit | x = np.array([1,2,3,4,5,6])
print "x =", x
print 'dytpe:', x.dtype
print 'shape:', x.shape
print 'ndim:', x.ndim
print 'size:', x.size
print 'type:', type(x)
x.shape = (2,3) # make it into a 2x3 matrix
print x
print 'dytpe:', x.dtype
print 'shape:', x.shape
print 'ndim:', x.ndim
print 'size:', x.size
print 'type:'... |
vicolab/neural-network-intro | 4-gan/2-gan-mnist.ipynb | mit | import numpy as np
from keras.datasets import mnist
import admin.tools as tools
# Load MNIST data
(X_train, y_train), (X_test, y_test) = mnist.load_data()
X_data = np.concatenate((X_train, X_test))
"""
Explanation: Generative Adversarial Networks 2
<div class="alert alert-warning">
This is a continuation of the pr... |
gregorjerse/rt2 | 2015_2016/lab13/Extending values on vertices-template.ipynb | gpl-3.0 | from itertools import combinations, chain
def simplex_closure(a):
"""Returns the generator that iterating over all subsimplices (of all dimensions) in the closure
of the simplex a. The simplex a is also included.
"""
return chain.from_iterable([combinations(a, l) for l in range(1, len(a) + 1)])
... |
ggData/tweetharvest | example.ipynb | mit | import pymongo
"""
Explanation: Part 1: tweetharvest Example Analysis
This is an example notebook demonstrating how to establish a connection to a database of tweets collected using tweetharvest. It presupposes that all the setup instructions have been completed (see README file for that repository) and that MongoDB s... |
JENkt4k/pynotes-general | Linux Tools & Tricks.ipynb | gpl-3.0 | %colors Linux
%history
%dirs
%magic
%pwd
%quickref
"""
Explanation: Python magic
https://ipython.org/ipython-doc/3/interactive/magics.html
End of explanation
"""
print "this is a test of the emergency broadcast system"
%%html
<style>
html {
font-size: 62.5% !important; }
body {
font-size: 1.5em !importan... |
mne-tools/mne-tools.github.io | 0.17/_downloads/d1b18c3376911723f0257fe5003a8477/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Romain Trachel <trachelr@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io, EvokedArray
from mne.datasets import sample
from mne.decoding import Vectorizer, get_coef... |
bp-kelley/rdkit | Docs/Notebooks/RGroupDecomposition-RingSubstitution.ipynb | bsd-3-clause | from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
IPythonConsole.ipython_useSVG=True
from rdkit.Chem import rdRGroupDecomposition
from IPython.display import HTML
from rdkit import rdBase
rdBase.DisableLog("rdApp.debug")
import pandas as pd
from rdkit.Chem import PandasTools
core = Chem.MolFromSmarts(... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a/td2a_correction_session_2E.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.i - Sérialisation - correction
Sérialisation d'objets, en particulier de dataframes. Mesures de vitesse.
End of explanation
"""
import random
values = [ [random.random() for i in range(0,20)] for _ in range(0,100000) ]
col = [ "col%d... |
xpharry/Udacity-DLFoudation | tutorials/intro-to-rnns/Anna KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
jinzishuai/learn2deeplearn | deeplearning.ai/C4.CNN/week3_ObjectDetection/hw/Car detection for Autonomous Driving/Autonomous driving application - Car detection - v1.ipynb | gpl-3.0 | import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
import scipy.io
import scipy.misc
import numpy as np
import pandas as pd
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.models import load_model, Mo... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_compute_mne_inverse_epochs_in_label.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.minimum_norm import apply_inverse_epochs, read_inverse_operator
from mne.minimum_norm import apply_inverse
print(__... |
nre-aachen/GeMpy | Prototype Notebook/Example_2_Simple-Deprecated.ipynb | mit | # Importing
import theano.tensor as T
import sys, os
sys.path.append("../GeMpy")
# Importing GeMpy modules
import GeMpy
# Reloading (only for development purposes)
import importlib
importlib.reload(GeMpy)
# Usuful packages
import numpy as np
import pandas as pn
import matplotlib.pyplot as plt
# This was to choose t... |
chengsoonong/crowdastro | notebooks/5_training_data.ipynb | mit | import os.path
import pprint
import sys
import astropy.io.fits
import matplotlib.colors
import matplotlib.pyplot
import numpy
import pymongo
import requests
import scipy.ndimage.filters
import sklearn.decomposition
import sklearn.ensemble
import sklearn.linear_model
import sklearn.neural_network
import sklearn.svm
sy... |
quantopian/research_public | notebooks/lectures/Arbitrage_Pricing_Theory/notebook.ipynb | apache-2.0 | import numpy as np
import pandas as pd
from statsmodels import regression
import matplotlib.pyplot as plt
"""
Explanation: Arbitrage Pricing Theory
By Evgenia "Jenny" Nitishinskaya, Delaney Granizo-Mackenzie, and Maxwell Margenot.
Part of the Quantopian Lecture Series:
www.quantopian.com/lectures
github.com/quantopia... |
GSimas/EEL7045 | Aula 9.2 - Indutores.ipynb | mit | print("Exemplo 6.8")
import numpy as np
from sympy import *
L = 0.1
t = symbols('t')
i = 10*t*exp(-5*t)
v = L*diff(i,t)
w = (L*i**2)/2
print("Tensão no indutor:",v,"V")
print("Energia:",w,"J")
"""
Explanation: Indutores
Jupyter Notebook desenvolvido por Gustavo S.S.
Um indutor consiste em uma bobina de fio condut... |
padipadou/CADL | session-1/lecture-1.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
"""
Explanation: Session 1: Introduction to Tensorflow
<p class='lead'>
Creative Applications of Deep Learning with Tensorflow<br />
Parag K. Mital<br />
Kadenze, Inc.<br />
</p>
<a name="learning-goals"></a>
Learning Goals
... |
TylerJensen1107/tylerjensen1107.github.io | .ipynb_checkpoints/Recursion-checkpoint.ipynb | mit | def pathTo(x, y, path):
#basecase
if x == 0 and y == 0:
print path
#recursive case
#this is an elif because we don't want to recurse forever once we are too far to the right, or too high up
elif x >= 0 and y >= 0:
pathTo(x - 1, y, path + "Right ") #choose right, explore
... |
kit-cel/lecture-examples | mloc/ch6_Unsupervised_Learning/Expectation_Maximization_for_GMMs.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import math
# initialize random seed to have reproducible results
np.random.seed(1)
"""
Explanation: Illustration of Expectation Maximization for Gaussian Mixture Models (GMMs)
This code is provided as supplementary material of the le... |
cesarcontre/Simulacion2017 | Modulo2/.ipynb_checkpoints/Clase16_ProbabilidadPrecio-Umbral-checkpoint.ipynb | mit | # Importamos librerías
# Creamos la función
# Descargamos datos de microsoft en el 2016
# Grafiquemos
"""
Explanation: Aplicando Python para análisis de precios: probabilidad precio-umbral
<img style="float: right; margin: 0px 0px 15px 15px;" src="https://c2.staticflickr.com/4/3673/9761565422_8da861e1c8_b.jpg" widt... |
google/brax | notebooks/basics.ipynb | apache-2.0 | #@title Colab setup and imports
from matplotlib.lines import Line2D
from matplotlib.patches import Circle
import matplotlib.pyplot as plt
import numpy as np
try:
import brax
except ImportError:
from IPython.display import clear_output
!pip install git+https://github.com/google/brax.git@main
clear_output()
... |
darkomen/TFG | ipython_notebooks/07_conclusiones/.ipynb_checkpoints/Conclusiones-checkpoint.ipynb | cc0-1.0 | %pylab inline
#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 los ficheros c... |
NREL/bifacial_radiance | docs/tutorials/15 - New Functionalities Examples.ipynb | bsd-3-clause | import bifacial_radiance
import os
from pathlib import Path
testfolder = str(Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'Tutorial_15')
if not os.path.exists(testfolder):
os.makedirs(testfolder)
print ("Your simulation will be stored in %s" % testfolder)
"""
Explanation: 15 - NEW FUNCTI... |
sbussmann/sleep-bit | notebooks/sbussmann_data-nba.ipynb | mit | import pandas as pd
import os
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import nba_py
sns.set_context('poster')
import plotly.offline as py
import plotly.graph_objs as go
py.init_notebook_mode(connected=True)
data_path = os.path.join(os.getcwd(), os.pardir, 'data', 'interim', 'sleep_da... |
astroumd/GradMap | notebooks/Lectures2016/Lecture_2/UMD_Intro_Lecture2.ipynb | gpl-3.0 | {1,2,3,"bingo"}
type({1,2,3,"bingo"})
type({})
type(set())
set("spamIam")
"""
Explanation: <CENTER>
<H1>
University of Maryland GRADMAP <BR>
Winter Workshop Python Boot Camp <BR>
</H1>
</CENTER>
More Data Structures, Control Statements, <BR> Functions, and Modules
Sets
End of explanation
"""
a = set("sp");... |
myuuuuun/various | 応用統計/HW1/HW1.ipynb | mit | #-*- encoding: utf-8 -*-
'''
Ouyoutoukei HW1
'''
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import statsmodels.api as sm
np.set_printoptions(precision=3)
pd.set_option('display.precision', 4)
"""
Explanation: 応用統計HW1
詳細: http://www.... |
palandatarxcom/sklearn_tutorial_cn | notebooks/03.2-Regression-Forests.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# 使用seaborn的默认设置
import seaborn as sns; sns.set()
"""
Explanation: 这个分析笔记由Jake Vanderplas编辑汇总。 源代码和license文件在GitHub。 中文翻译由派兰数据在派兰大数据分析平台上完成。 源代码在GitHub上。
深度探索监督学习:随机森林
之前我们已经了解过了强大的判别分类器,支持向量机。在这里我们要看一看另一种强大的算法。这个算法是一个非参数方法,... |
anshbansal/anshbansal.github.io | udacity_data_science_notes/intro_machine_learning/lesson_03/lesson_03.ipynb | mit | from sklearn import tree
X = [[0, 0], [1, 1]]
Y = [0, 1]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, Y)
clf.predict([[2., 2.]])
from prep_terrain_data import makeTerrainData
features_train, labels_train, features_test, labels_test = makeTerrainData()
clf = tree.DecisionTreeClassifier()
clf = clf.fit(featu... |
kingb12/languagemodelRNN | report_notebooks/encdec_noing10_200_512_04drb.ipynb | mit | report_file = '/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing10_200_512_04drb/encdec_noing10_200_512_04drb.json'
log_file = '/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing10_200_512_04drb/encdec_noing10_200_512_04drb_logs.json'
import json
import matplotlib.pyplo... |
sdpython/ensae_teaching_cs | _doc/notebooks/exams/interro_rapide_20_minutes_2015_09.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.e - Correction de l'interrogation écrite du 26 septembre 2015
tests, boucles, fonctions
End of explanation
"""
tab = [1, 3]
for i in range(0, len(tab)):
print(tab[i] + tab[i+1])
"""
Explanation: Enoncé 1
Q1
Le programme suivant ... |
jamesfolberth/NGC_STEM_camp_AWS | notebooks/data8_notebooks/lab04/lab04.ipynb | bsd-3-clause | # Run this cell to set up the notebook, but please don't change it.
# These lines import the Numpy and Datascience modules.
import numpy as np
from datascience import *
# These lines do some fancy plotting magic.
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
imp... |
claudiuskerth/PhDthesis | Data_analysis/SNP-indel-calling/ANGSD/BOOTSTRAP_CONTIGS/minInd9_overlapping/DADI/adj_error.ipynb | mit | from ipyparallel import Client
cl = Client()
cl.ids
%%px --local
# run whole cell on all engines a well as in the local IPython session
import numpy as np
import sys
sys.path.insert(0, '/home/claudius/Downloads/dadi')
import dadi
from glob import glob
import dill
import pandas as pd
# turn on floating point di... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/building_production_ml_systems/labs/4b_streaming_data_inference.ipynb | apache-2.0 | !pip install --user 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 learning ... |
terencezl/scientific-python-walkabout | Astro Workshop Day.ipynb | mit | # First, make sure this works:
import astropy
# If this doesn't work, raise your hand!
"""
Explanation: Python + Astronomy
This course will be an introduction to Astropy, a maturing library for astronomy routines and tools in Python.
Astropy started as a combination of various common Python libraries (Pyfits, PyWCS, a... |
rvperry/phys202-2015-work | assignments/assignment07/AlgorithmsEx02.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns
import numpy as np
"""
Explanation: Algorithms Exercise 2
Imports
End of explanation
"""
def find_peaks(a):
"""Find the indices of the local maxima in a sequence."""
P=[]
for i in range(0,len(a)):
if i==0 and a[1]<a[0]:... |
sjobeek/robostats_mcl | mcl_demonstration.ipynb | mit | logdata = mcl.load_log('data/log/robotdata2.log.gz')
logdata['x_rel'] = logdata['x'] - logdata.ix[0,'x']
logdata['y_rel'] = logdata['y'] - logdata.ix[0,'y']
plt.plot(logdata['x_rel'], logdata['y_rel'])
plt.title('Relative Odometry (x, y) in m')
"""
Explanation: Monte Carlo localization
This notebook presents a demonst... |
fionapigott/Data-Science-45min-Intros | language-processing-vocab/language_processing_vocab.ipynb | unlicense | # first, get some text:
import fileinput
try:
import ujson as json
except ImportError:
import json
documents = []
for line in fileinput.FileInput("example_tweets.json"):
documents.append(json.loads(line)["text"])
"""
Explanation: Introduction to Language Processing Concepts
Original tutorial by Brain Lehma... |
mne-tools/mne-tools.github.io | 0.17/_downloads/c0c3ed4677febbe0a9a8fc4b6deea26c/plot_object_epochs.ipynb | bsd-3-clause | import mne
import os.path as op
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: The :class:Epochs <mne.Epochs> data structure: epoched data
:class:Epochs <mne.Epochs> objects are a way of representing continuous
data as a collection of time-locked trials, stored in an array of shap... |
tensorflow/docs-l10n | site/en-snapshot/model_optimization/guide/pruning/pruning_with_keras.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... |
olivierverdier/homogint | Demo.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from homogint import *
"""
Explanation: This is a demo of homogint, a simple Python library for integration on homogeneous spaces. The theoretical background is explained in the paper Integrators on homogeneous spaces, by Oivier Verdier and Hans Mun... |
mcleonard/seekwell | seekwell.ipynb | mit | from seekwell import Database
"""
Explanation: SeekWell
SeekWell is a package for quickly and easily querying SQL databases in Python. It was made with data analysts in mind and plays well with Jupyter notebooks. This notebook is a little tutorial to get you started working with SQL databases in under 5 minutes.
SeekW... |
ScienceStacks/CellBioControl | Analysis/chemotaxis.ipynb | mit | from IPython.display import Image, display
display(Image(filename='img/receptor_states.png'))
"""
Explanation: Backgound
Analysis of the Chemotaxis model described by Spiro et al., PNAS, 1999.
The model describes the receptor state along 3 dimensions:
- bound to a ligand
- phosphorylated
- degree of methylation ... |
tensorflow/lattice | docs/tutorials/shape_constraints_for_ethics.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... |
lcharleux/numerical_analysis | doc/ODE/ODE.ipynb | gpl-2.0 | tmax = .2
t = np.linspace(0., tmax, 1000)
x0, y0 = 0., 0.
vx0, vy0 = 1., 1.
g = 10.
x = vx0 * t
y = -g * t**2/2. + vy0 * t
fig = plt.figure()
ax.set_aspect("equal")
plt.plot(x, y, label = "Exact solution")
plt.grid()
plt.xlabel("x")
plt.ylabel("y")
plt.legend()
plt.show()
"""
Explanation: Ordinary differential ... |
mathemage/h2o-3 | h2o-py/demos/H2O_tutorial_breast_cancer_classification.ipynb | apache-2.0 | import h2o
# Start an H2O Cluster on your local machine
h2o.init()
"""
Explanation: H2O Tutorial: Breast Cancer Classification
Author: Erin LeDell
Contact: erin@h2o.ai
This tutorial steps through a quick introduction to H2O's Python API. The goal of this tutorial is to introduce through a complete example H2O's capab... |
agile-geoscience/gio | docs/userguide_src/_Gridding_a_bunch_of_xy_points.ipynb | apache-2.0 | from bruges.transform import CoordTransform
corner_ix = [[0, 0], [0, 3], [3, 0]]
corner_xy = [[5000, 6000],
[5000-23.176, 6000+71.329],
[5000+142.658, 6000+46.353]]
transform = CoordTransform(corner_ix, corner_xy)
for i in range(4):
for j in range(4):
print(transform([i,... |
streettraffic/streettraffic | streettraffic/research/multiple_routes_analysis/Multiple_routes_analysis.ipynb | mit | ## import system module
import json
import rethinkdb as r
import time
import datetime as dt
import asyncio
from shapely.geometry import Point, Polygon
import random
import pandas as pd
import os
import matplotlib.pyplot as plt
## import custom module
from streettraffic.server import TrafficServer
from streettraffic.pr... |
gnestor/jupyter-renderers | notebooks/nteract/pandas-to-geojson.ipynb | bsd-3-clause | import pandas as pd, requests, json
"""
Explanation: Convert a pandas dataframe to geojson for web-mapping
Author: Geoff Boeing
Original: pandas-to-geojson
End of explanation
"""
# API endpoint for city of Berkeley's 311 calls
endpoint_url = 'https://data.cityofberkeley.info/resource/k489-uv4i.json?$limit=20'
# fet... |
Aniruddha-Tapas/Applied-Machine-Learning | Miscellaneous/Topic Modelling using LDA.ipynb | mit | from sklearn.datasets import fetch_20newsgroups
dataset = fetch_20newsgroups(shuffle=True, random_state=1, remove=('headers', 'footers', 'quotes'))
documents = dataset.data
"""
Explanation: Topic Modelling using LDA
<hr>
Latent Dirichlet Allocation (LDA) is a algorithms used to discover the topics that are present ... |
michrawson/nyu_ml_lectures | notebooks/02.3 Unsupervised Learning - Transformations and Dimensionality Reduction.ipynb | cc0-1.0 | from sklearn.datasets import load_iris
iris = load_iris()
X, y = iris.data, iris.target
print(X.shape)
"""
Explanation: Unsupervised Learning
Many instances of unsupervised learning, such as dimensionality reduction, manifold learning and feature extraction, find a new representation of the input data without any add... |
tombstone/models | official/colab/fine_tuning_bert.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... |
nproctor/phys202-2015-work | assignments/assignment07/AlgorithmsEx02.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns
import numpy as np
"""
Explanation: Algorithms Exercise 2
Imports
End of explanation
"""
def find_peaks(a):
"""Find the indices of the local maxima in a sequence."""
peaks = []
for i in range(len(a)):
if i == 0 and a[i]... |
cvxopt/chompack | doc/source/examples.ipynb | gpl-3.0 |
from cvxopt import matrix, spmatrix, sparse, normal, solvers, blas
import chompack as cp
import random
# Function for generating random sparse matrix
def sp_rand(m,n,a):
"""
Generates an m-by-n sparse 'd' matrix with round(a*m*n) nonzeros.
"""
if m == 0 or n == 0: return spmatrix([], [], [], (m,n))
... |
robertoalotufo/ia898 | master/tutorial_convprop_3.ipynb | mit | # importando a função a ser utilizada nesse tutorial
import numpy as np
import sys,os
ia898path = os.path.abspath('../../')
if ia898path not in sys.path:
sys.path.append(ia898path)
import ia898.src as ia
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Propriedades-da-Convolução" data-toc... |
lenovor/MNIST | svm.scikit/svc_rbf.scikit_benchmark.ipynb | mit | from __future__ import division
import os, time, math
import cPickle as pickle
#import multiprocessing
import matplotlib.pyplot as plt
import numpy as np
import csv
from print_imgs import print_imgs # my own function to print a grid of square images
from sklearn.preprocessing import StandardScaler
from sklearn.ut... |
nusdbsystem/incubator-singa | doc/en/docs/notebook/regression.ipynb | apache-2.0 | from __future__ import division
from __future__ import print_function
from builtins import range
from past.utils import old_div
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and ... |
asurunis/CrisisMappingToolkit | ipython/CrisisMappingToolkitOverview.ipynb | apache-2.0 | import sys
import os
import ee
# This script assumes your authentification credentials are stored as operatoring system
# environment variables.
__MY_SERVICE_ACCOUNT = os.environ.get('MY_SERVICE_ACCOUNT')
__MY_PRIVATE_KEY_FILE = os.environ.get('MY_PRIVATE_KEY_FILE')
# Initialize the Earth Engine object, using your au... |
DistrictDataLabs/yellowbrick | examples/rebeccabilbro/check_is_fitted.ipynb | apache-2.0 | X, y = load_occupancy(return_dataset=True).to_numpy()
X_train, X_test, y_train, y_test = tts(X, y, test_size=0.20)
unfitted_model = LogisticRegression(solver='lbfgs')
fitted_model = unfitted_model.fit(X_train, y_train)
oz = ClassPredictionError(fitted_model)
oz.fit(X_train, y_train)
oz.score(X_test, y_test)
oz.show()... |
QinetiQ-datascience/Docker-Data-Science | WooWeb-Presentation/Workspace/Widgets/Widget Events.ipynb | mit | from __future__ import print_function
"""
Explanation: Index - Back - Next
Widget Events
Special events
End of explanation
"""
import ipywidgets as widgets
print(widgets.Button.on_click.__doc__)
"""
Explanation: The Button is not used to represent a data type. Instead the button widget is used to handle mouse clic... |
mcc-petrinets/formulas | spot/tests/python/gen.ipynb | mit | import spot
import spot.gen as sg
spot.setup()
from IPython.display import display
"""
Explanation: Formulas & Automata generators
The spot.gen package contains the functions used to generate the patterns produced by genltl and genaut.
End of explanation
"""
sg.ltl_pattern(sg.LTL_AND_GF, 3)
sg.ltl_pattern(sg.LTL_CC... |
drericstrong/Blog | 20170502_MarkovChainsInEquipmentConditionMonitoring.ipynb | agpl-3.0 | import random
import matplotlib.pyplot as plt
%matplotlib inline
# Since the Markov assumption requires that the future
# state only depends on the current state, we will keep
# track of the current state during each iteration.
# "0" is low, "1" is normal, and "2" is high
def MCDegradeSim(t_prob, d_per_state, d_thres... |
tommyogden/maxwellbloch | docs/examples/mbs-lambda-weak-pulse-cloud-atoms-with-coupling.ipynb | mit | mb_solve_json = """
{
"atom": {
"fields": [
{
"coupled_levels": [[0, 1]],
"detuning": 0.0,
"detuning_positive": true,
"label": "probe",
"rabi_freq": 1.0e-3,
"rabi_freq_t_args":
{
"ampl": 1.0,
"centre": 0.0,
"fw... |
josealber84/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
print(text)
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simps... |
jakevdp/sklearn_tutorial | notebooks/05-Validation.ipynb | bsd-3-clause | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn')
"""
Explanation: <small><i>This notebook was put together by Jake Vanderplas. Source and license info is on GitHub.</i></small>
Validation and Model Selection
In this section... |
oditorium/blog | Modules/DataImport.ipynb | agpl-3.0 | #!wget https://www.dropbox.com/s//DataImport.py -O DataImport.py
import DataImport as di
#help('DataImport')
"""
Explanation: Data Import - Testing
Class definitions
module DataImport
We want to import data directly from the ECB data warehouse, so for example rather than going to the series we want to download the csv... |
AEW2015/PYNQ_PR_Overlay | Pynq-Z1/notebooks/examples/tracebuffer_spi.ipynb | bsd-3-clause | from pprint import pprint
from time import sleep
from pynq import PL
from pynq import Overlay
from pynq.drivers import Trace_Buffer
from pynq.iop import Pmod_OLED
from pynq.iop import PMODA
from pynq.iop import PMODB
from pynq.iop import ARDUINO
ol = Overlay("base.bit")
ol.download()
pprint(PL.ip_dict)
"""
Explanatio... |
pombredanne/gensim | docs/notebooks/Topics_and_Transformations.ipynb | lgpl-2.1 | import logging
import os.path
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
"""
Explanation: Topics and Transformation
Don't forget to set
End of explanation
"""
from gensim import corpora, models, similarities
if (os.path.exists("/tmp/deerwester.dict")):
dictionary... |
opencb/opencga | opencga-client/src/main/python/notebooks/user-training/pyopencga_clinical_queries.ipynb | apache-2.0 | ## Step 1. Import pyopencga dependecies
from pyopencga.opencga_config import ClientConfiguration # import configuration module
from pyopencga.opencga_client import OpencgaClient # import client module
from pprint import pprint
from IPython.display import JSON
import matplotlib.pyplot as plt
import seaborn as sns
import... |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/spark/spark_census/01_TrainModel.ipynb | apache-2.0 | import os
master = '--master local[1]'
#master = '--master spark://apachespark-master-2-1-0:7077'
conf = '--conf spark.cores.max=1 --conf spark.executor.memory=512m'
packages = '--packages com.amazonaws:aws-java-sdk:1.7.4,org.apache.hadoop:hadoop-aws:2.7.1'
jars = '--jars /root/lib/jpmml-sparkml-package-1.0-SNAPSHOT.j... |
MegaShow/college-programming | Homework/Principles of Artificial Neural Networks/Week 10 GAN 2/DL_WEEK10.ipynb | mit | import torch
torch.cuda.set_device(2)
import torch
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
%matplotlib inline
from utils import initialize_weights
class DCGenerator(nn.Module):
def __init__... |
tlby/mxnet | example/recommenders/demo2-dssm.ipynb | apache-2.0 | import warnings
import mxnet as mx
from mxnet import gluon, np, npx, autograd, sym
import numpy as onp
from sklearn.random_projection import johnson_lindenstrauss_min_dim
# Define some constants
max_user = int(1e5)
title_vocab_size = int(3e4)
query_vocab_size = int(3e4)
num_samples = int(1e4)
hidden_units = 128
epsi... |
ibm-cds-labs/pixiedust | notebook/GraphFrame with Pixiedust.ipynb | apache-2.0 | cloudantHost='dtaieb.cloudant.com'
cloudantUserName='weenesserliffircedinvers'
cloudantPassword='72a5c4f939a9e2578698029d2bb041d775d088b5'
airports = sqlContext.read.format("com.cloudant.spark").option("cloudant.host",cloudantHost)\
.option("cloudant.username",cloudantUserName).option("cloudant.password",cloudantP... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/sandbox-3/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: MIROC
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Topics: Transport, Emission... |
h2oai/h2o-3 | h2o-py/demos/pdp_multiclass.ipynb | apache-2.0 | # Import the Iris Dataset and Build a GLM
import h2o
h2o.init()
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
# import the iris dataset:
# this dataset is used to classify the type of iris plant
# the original dataset can be found at https://archive.ics.uci.edu/ml/datasets/Iris
# iris = h2o.import_file(... |
microsoft/dowhy | docs/source/example_notebooks/lalonde_pandas_api.ipynb | mit | import os, sys
sys.path.append(os.path.abspath("../../../"))
from rpy2.robjects import r as R
%load_ext rpy2.ipython
#%R install.packages("Matching")
%R library(Matching)
%R data(lalonde)
%R -o lalonde
lalonde.to_csv("lalonde.csv",index=False)
# the data already loaded in the previous cell. we include the import
# h... |
science-of-imagination/nengo-buffer | Project/trained_mental_translation_testing.ipynb | gpl-3.0 | import nengo
import numpy as np
import cPickle
import matplotlib.pyplot as plt
from matplotlib import pylab
import matplotlib.animation as animation
"""
Explanation: Testing the trained weight matrices (not in an ensemble)
End of explanation
"""
#Weight matrices generated by the neural network after training
#Maps ... |
Open-Power-System-Data/national_generation_capacity | comparison_plot.ipynb | mit | import os.path
import math
import functions.plots as fp # predefined functions in extra file
import bokeh.plotting as plo
from bokeh.io import show, output_notebook
from bokeh.layouts import row, column
from bokeh.models import Panel, Tabs
from bokeh.models.widgets import RangeSlider, MultiSelect, Select
output_notebo... |
befelix/SafeOpt | examples/1d_multiple_constraints_example.ipynb | mit | # Measurement noise
noise_var = 0.05 ** 2
noise_var2 = 1e-5
# Bounds on the inputs variable
bounds = [(-10., 10.)]
# Define Kernel
kernel = GPy.kern.RBF(input_dim=len(bounds), variance=2., lengthscale=1.0, ARD=True)
kernel2 = kernel.copy()
# set of parameters
parameter_set = safeopt.linearly_spaced_combinations(boun... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_automl_tabular_regression_online_bq.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex SDK: AutoML training tabular regression model for online prediction using BigQuery
<tabl... |
joelagnel/lisa | ipynb/tutorial/00_LisaInANutshell.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
# Execute this cell to enable verbose SSH commands
logging.getLogger('ssh').setLevel(logging.DEBUG)
# Other python modules required by this notebook
import json
import os
"""
Explanation: Linux Interactive System Analysis DEMO
Get LISA and start the Not... |
GoogleCloudPlatform/vertex-ai-samples | community-content/pytorch_image_classification_single_gpu_with_vertex_sdk_and_torchserve/vertex_prediction_with_custom_torchserve_container.ipynb | apache-2.0 | PROJECT_ID = "YOUR PROJECT ID"
BUCKET_NAME = "gs://YOUR BUCKET NAME"
REGION = "YOUR REGION"
SERVICE_ACCOUNT = "YOUR SERVICE ACCOUNT"
content_name = "pt-img-cls-gpu-cust-cont-torchserve"
"""
Explanation: Vertex Prediction with Custom TorchServe Container
<table align="left">
<td>
<a href="https://github.com/Goog... |
ChadFulton/statsmodels | examples/notebooks/statespace_seasonal.ipynb | bsd-3-clause | %matplotlib notebook
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
"""
Explanation: Seasonality in time series data
Consider the problem of modeling time series data with multiple seasonal components with different perioidicities. Let us take the time series $y_t... |
heatseeknyc/data-science | src/bryan analyses/Hack for Heat #5.ipynb | mit | connection = psycopg2.connect('dbname= threeoneone user=threeoneoneadmin password=threeoneoneadmin')
cursor = connection.cursor()
cursor.execute('''SELECT createddate, closeddate, borough FROM service;''')
data = cursor.fetchall()
data = pd.DataFrame(data)
data.columns = ['createddate','closeddate','borough']
data =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.