repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
fpavogt/pyqz
docs/source/pyqz_demo_advanced.ipynb
gpl-3.0
%matplotlib inline import pyqz import pyqz.pyqz_plots as pyqzp """ Explanation: Running pyqz II First things first, let's start by importing pyqz and pyqz_plots. End of explanation """ fn = pyqz.pyqzt.get_MVphotogrid_fn(Pk=6.7, calibs='GCZO', kappa =10, struct='pp') print fn.split('/')[-1] """ Explanation: D) Using...
mne-tools/mne-tools.github.io
0.17/_downloads/a3032aa342891a49e0e20bef01b3ad38/plot_visualize_evoked.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt import mne # sphinx_gallery_thumbnail_number = 9 """ Explanation: Visualize Evoked data In this tutorial we focus on the plotting functions of :class:mne.Evoked. End of explanation """ data_path = mne.datasets.sample.data_path() fname = op.joi...
hich28/mytesttxx
tests/python/randltl.ipynb
gpl-3.0
import spot """ Explanation: Documentation for spot's randltl python binding End of explanation """ f = spot.randltl(['a', 'b', 'c']) for i in range(3): print(next(f)) """ Explanation: Basic usage Generate random formulas from specified atomic propositions: End of explanation """ f = spot.randltl(3) for i in ...
ray-project/ray
doc/source/tune/examples/tune-mlflow.ipynb
apache-2.0
import os import tempfile import time import mlflow from ray import tune from ray.tune.integration.mlflow import MLflowLoggerCallback, mlflow_mixin """ Explanation: Using MLflow with Tune (tune-mlflow-ref)= :::{warning} If you are using these MLflow integrations with {ref}ray-client, it is recommended that you setup...
GoogleCloudPlatform/nvidia-merlin-on-vertex-ai
01-dataset-preprocessing.ipynb
apache-2.0
import os import json from datetime import datetime from google.cloud import aiplatform as vertex_ai from kfp.v2 import compiler """ Explanation: Data Preprocessing at Scale with NVIDIA Merlin NVTabular and Vertex AI This notebook demonstrates how to preprocess data using NVIDIA Merlin NVTabular and Vertex AI. The not...
martinjrobins/hobo
examples/stats/multiplicative-gaussian-errors.ipynb
bsd-3-clause
import pints import pints.toy as toy import pints.plot import numpy as np import matplotlib.pyplot as plt import pints.noise # Use the toy logistic model model = toy.LogisticModel() # Set some parameters real_parameters = [0.1, 50] # Create fake data times = np.linspace(0, 100, 500) values = model.simulate(real_para...
eco32i/biodata
sessions/examples/01 - Python machine learning - dimensionality reduction.ipynb
mit
def parse_barcodes(bcfile, bc_id='BC'): res = {} with open(bcfile, 'r') as fi: for line in fi: fields = line.strip().split(',') if fields[0].startswith(bc_id): res[fields[0]] = fields[1] return res def parse_exp_config(expfile, bc_dict): res = [] fie...
mintcloud/deep-learning
Project 2/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' class DLProgress(tqdm): last_block = 0 def hoo...
zhenxu66/data_analysis_with_python_and_pandas
3 - NumPy Basics/3-5 NumPy Array Basics - Querying, Slicing, Combining, and Splitting Arrays.ipynb
apache-2.0
import sys print(sys.version) import numpy as np print(np.__version__) """ Explanation: NumPy Array Basics - Querying, Slicing, Combining, and Splitting Arrays End of explanation """ np.random.seed(10) """ Explanation: In this video we’ll be covering querying, slicing, combining, and splitting arrays. Now this info...
WillenZh/deep-learning-project
tutorials/dcgan-svhn/DCGAN_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
henchc/Data-on-the-Mind-2017-scraping-apis
01-APIs/01-API_workbook.ipynb
mit
import requests # to make the GET request import json # to parse the JSON response to a Python dictionary import time # to pause after each API call import csv # to write our data to a CSV import pandas # to see our CSV """ Explanation: Accessing Databases via Web APIs In this lesson we'll learn what an API (Ap...
enakai00/jupyter_ml4se_commentary
05-pandas DataFrame-01.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import pandas as pd from pandas import Series, DataFrame """ Explanation: pandasのデータフレーム End of explanation """ from numpy.random import randint dices = randint(1,7,(5,2)) dices """ Explanation: 2次元の array を DataFrame に変換する例です。 End of explanation """ diceroll = D...
djgagne/hagelslag
demos/unidata_users_workshop_2015.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt from datetime import datetime, timedelta from mpl_toolkits.basemap import Basemap from IPython.display import display, Image from ipywidgets import widgets, interact from scipy.ndimage import gaussian_filter, find_objects from cop...
mne-tools/mne-tools.github.io
0.18/_downloads/1048fcdfaf4847afa747b1cc9df74e2d/plot_movement_compensation.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from os import path as op import mne from mne.preprocessing import maxwell_filter print(__doc__) data_path = op.join(mne.datasets.misc.data_path(verbose=True), 'movement') head_pos = mne.chpi.read_head_pos(op.join(data_path, 'simulated_qu...
dcavar/python-tutorial-for-ipython
notebooks/Python NLTK - Texts and Frequencies.ipynb
apache-2.0
ifile = open("data/HOPG.txt", mode='r', encoding='utf-8') text = ifile.read() ifile.close() print(text[:300], "...") """ Explanation: Python NLTK: Texts and Frequencies (C) 2017-2019 by Damir Cavar <&#100;&#99;&#97;&#118;&#97;&#114;&#64;&#105;&#117;&#46;&#101;&#100;&#117;> Version: 0.5, October 2019 Download: This and...
cseed/hail
hail/python/hail/docs/tutorials/01-genome-wide-association-study.ipynb
mit
import hail as hl hl.init() """ Explanation: GWAS Tutorial This notebook is designed to provide a broad overview of Hail's functionality, with emphasis on the functionality to manipulate and query a genetic dataset. We walk through a genome-wide SNP association test, and demonstrate the need to control for confounding...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_sensor_noise_level.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os.path as op import mne data_path = mne.datasets.sample.data_path() raw_erm = mne.io.read_raw_fif(op.join(data_path, 'MEG', 'sample', 'ernoise_raw.fif'), preload=True) """ Explanation: Show nois...
transcranial/keras-js
notebooks/layers/convolutional/ZeroPadding1D.ipynb
mit
data_in_shape = (3, 5) L = ZeroPadding1D(padding=1) layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(240) data_in = 2 * np.random.random(data_in_shape) - 1 result = model.predict(np.array([dat...
tensorflow/hub
examples/colab/cross_lingual_similarity_with_tf_hub_multilingual_universal_encoder.ipynb
apache-2.0
# Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_eeg_erp.ipynb
bsd-3-clause
import mne from mne.datasets import sample """ Explanation: EEG processing and Event Related Potentials (ERPs) For a generic introduction to the computation of ERP and ERF see tut_epoching_and_averaging. Here we cover the specifics of EEG, namely: - setting the reference - using standard montages :func:`mne.channels.M...
probml/pyprobml
deprecated/causal_impact_tfp.ipynb
mit
!pip install tfcausalimpact %matplotlib inline import sys import os # sys.path.append(os.path.abspath('../')) import numpy as np import pandas as pd import tensorflow as tf import tensorflow_probability as tfp import matplotlib.pyplot as plt from causalimpact import CausalImpact tfd = tfp.distributions plt.rcPa...
endlesspint8/endlesspint8.github.io
code/reseen/ta_reviews.ipynb
mit
import numpy as np import pandas as pd import math import matplotlib.pyplot as plt plt.style.use('ggplot') %matplotlib inline df_ta_bar_reviews = pd.read_excel("ta_bar_reviews.xlsx") df_ta_bar_reviews.date = pd.to_datetime(df_ta_bar_reviews.date) print(df_ta_bar_reviews.dtypes) df_ta_bar_reviews.head() def first_...
unpingco/python_for_prob_stats_ml
chapters/statistics/notebooks/Gauss_Markov.ipynb
mit
from __future__ import division %pylab inline """ Explanation: Python for Probability, Statistics, and Machine Learning End of explanation """ Q = np.eye(3)*0.1 # error covariance matrix # this is what we are trying estimate beta = matrix(ones((2,1))) W = matrix([[1,2], [2,3], [1,1]]) """ E...
mintcloud/deep-learning
autoencoder/Simple_Autoencoder.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
ES-DOC/esdoc-jupyterhub
notebooks/inm/cmip6/models/sandbox-1/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inm', 'sandbox-1', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: INM Source ID: SANDBOX-1 Topic: Ocnbgchem Sub-Topics: Tracers. Properties: 6...
Kreiswolke/gensim
docs/notebooks/ldaseqmodel.ipynb
lgpl-2.1
# setting up our imports from gensim.models import ldaseqmodel from gensim.corpora import Dictionary, bleicorpus import numpy from gensim.matutils import hellinger """ Explanation: Dynamic Topic Models Tutorial What is this tutorial about? This tutorial will exaplin what Dynamic Topic Models are, and how to use them ...
dipanjank/ml
simple_implementations/Maximum_Likelihood_Estimation.ipynb
gpl-3.0
%pylab inline pylab.style.use('ggplot') import networkx as nx G = nx.DiGraph() G.add_edges_from([('A', 'B'), ('A', 'C'), ('A', 'D')]) pos = {'A': (2, 2), 'B': (1, 1), 'C': (2, 1), 'D':(4, 1)} nx.draw(G, pos, node_size=2000, node_color='lightblue') labels = {'A': '$\\theta$', 'B': '$X[1]$', 'C': '$X[2]$', 'D': '$X[n...
donlnz/nonconformist
README.ipynb
mit
from sklearn.datasets import load_iris import numpy as np from sklearn.svm import SVC from nonconformist.cp import IcpClassifier from nonconformist.nc import NcFactory iris = load_iris() idx = np.random.permutation(iris.target.size) # Divide the data into proper training set, calibration set and test set idx_trai...
liganega/Gongsu-DataSci
previous/y2017/W12-pandas-intro2/GongSu26_Pandas_Introduction_2.ipynb
gpl-3.0
from GongSu24_Pandas_Introduction_1 import * """ Explanation: Pandas 소개 2 GonsSu24 내용에 이어서 Pandas 라이브러리를 소개한다. 먼저 GongSu24를 임포트 한다. End of explanation """ s6 = Series(range(3), index=['a', 'b', 'c']) s6 """ Explanation: 색인(Index) 클래스 Pandas에 정의된 색인(Index) 클래스는 Series와 DataFrame 자료형의 행과 열을 구분하는 이름들의 목록을 저장하는 데에 사용된...
google/iree
samples/colab/tflite_text_classification.ipynb
apache-2.0
%%capture !python -m pip install iree-compiler iree-runtime iree-tools-tflite -f https://github.com/google/iree/releases/latest !pip3 install --extra-index-url https://google-coral.github.io/py-repo/ tflite_runtime import numpy as np import urllib.request import pathlib import tempfile import re import tflite_runtime....
albahnsen/ML_SecurityInformatics
notebooks/06-data_preparation_evaluation.ipynb
mit
import pandas as pd import zipfile with zipfile.ZipFile('../datasets/titanic.csv.zip', 'r') as z: f = z.open('titanic.csv') titanic = pd.read_csv(f, sep=',', index_col=0) titanic.head() # check for missing values titanic.isnull().sum() """ Explanation: 06 - Data Preparation and Advanced Model Evaluation by Al...
ga7g08/ga7g08.github.io
_notebooks/2015-02-23-Clustering-Google-location-data.ipynb
mit
# Create a dataframe from the json file in the filepath raw = pd.io.json.read_json('LocationHistory.json') df = raw['locations'].apply(pd.Series) # Create a list from the latitude column, multiplied by -E7 df['latitude'] = df['latitudeE7'] * 1e-7 # Create a list from the longitude column, multiplied by -E7 df['lon...
phoebe-project/phoebe2-docs
2.2/tutorials/contact_binary_hierarchy.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Contact Binary Hierarchy Setup Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ %matplotlib inl...
PyPSA/PyPSA
examples/notebooks/lopf_with_pyomo_False.ipynb
mit
import pypsa import pandas as pd import os n = pypsa.examples.ac_dc_meshed(from_master=True) """ Explanation: Optimization without pyomo In this example we demonstrate the behaviour of the Linear Optimal Power Flow (LOPF) calculation without using pyomo. This requires to set pyomo to False in the lopf function. Then,...
ubcgif/gpgTutorials
notebooks/mag/Mag_Dipole.ipynb
mit
# define a dipole dipoleloc = (0.,0.,-50.) dipoleL = 100. dipoledec, dipoleinc = 0., 90. dipolemoment = 1e13 """ Explanation: Define a magnetic dipole A dipole is defined in the section below using * dipoleloc: x, y, z location of the dipole center * dipoledec: declination of the dipole's direction in degree; north = ...
softEcon/course
lectures/economic_models/generalized_roy/notebook/lecture.ipynb
mit
%%capture # Notebook metods from IPython.core.display import HTML, Image # Unix Pattern Extensions import glob # Operating System Interfaces import os # Lexical Analysis import shlex # Copy operations import copy # Encoders and Decoders import codecs # Statistical Modeling and Econometrics import statsmodels.ap...
AI-Innovation/cs231n_ass1
two_layer_net.ipynb
mit
# A bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.neural_net import TwoLayerNet %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # for auto-reloadi...
sdpython/ensae_teaching_cs
_doc/notebooks/sklearn_ensae_course/02_basic_of_machine_learning_with_scikit-learn.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot as plt """ Explanation: 2A.ML101.2: Basic principles of machine learning with scikit-learn Classification and regression. Source: Course on machine learning with scikit-learn by Gaël Varoquaux Introducing the scikit-learn estimator object End of expla...
CompPhysics/MachineLearning
doc/Programs/IsingModel/onedim.ipynb
cc0-1.0
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import seaborn as sns import scipy.linalg as scl from sklearn.model_selection import train_test_split import sklearn.linear_model as skl import tqdm %matplotlib inline sns.set(color_codes=True) cmap_args=dict(vm...
astarostin/MachineLearningSpecializationCoursera
course4/week2 - Непараметрические критерии - quiz.ipynb
apache-2.0
import numpy as np import pandas as pd import itertools from scipy import stats from statsmodels.stats.descriptivestats import sign_test from statsmodels.stats.weightstats import zconfint %pylab inline """ Explanation: 4. Давайте вернёмся к данным выживаемости пациентов с лейкоцитарной лимфомой из видео про критерий ...
DrMud/SentimentHackPad
Sentiment Hackpad.ipynb
gpl-3.0
!pip install textblob from __future__ import unicode_literals, print_function import textblob import pandas as pd import numpy as np """ Explanation: <h1> Sentiment Hackpad </h1> Authors: Daniela Huppenkothen, Phil Marshall, Madhura Killedar We did some natural language processing by performing sentiment analysis on...
BillyLjm/CS100.1x.__CS190.1x
lab0_student.ipynb
mit
# Check that Spark is working largeRange = sc.parallelize(xrange(100000)) reduceTest = largeRange.reduce(lambda a, b: a + b) filterReduceTest = largeRange.filter(lambda x: x % 7 == 0).sum() print reduceTest print filterReduceTest # If the Spark jobs don't work properly these will raise an AssertionError assert reduce...
xunzhang/dynet
examples/jupyter-tutorials/tutorial-1-xor.ipynb
apache-2.0
# we assume that we have the dynet module in your path. # OUTDATED: we also assume that LD_LIBRARY_PATH includes a pointer to where libcnn_shared.so is. import dynet as dy # create a parameter collection and add the parameters. m = dy.ParameterCollection() pW = m.add_parameters((8,2)) pV = m.add_parameters((1,8)) pb =...
UWashington-Astro300/Astro300-A17
Python_OO.ipynb
mit
import numpy as np from astropy import units as u class SpaceRock(object): def __init__(self, name=None, ab_mag=None, albedo=None): self.name = name self.ab_mag = ab_mag self.albedo = albedo # Create some fake data: my_name = "Geralt of Rivia" my_ab_mag = 5.13 my_albedo = 0.1...
info-370/classification
logistic-regression/demo.ipynb
mit
# Set up import numpy as np from __future__ import division # division import pandas as pd import seaborn as sns # for visualiation from scipy.stats import ttest_ind # t-tests import statsmodels.formula.api as smf # linear modeling import statsmodels.api as sm import matplotlib.pyplot as plt # plotting import matplotli...
jmschrei/pomegranate
tutorials/B_Model_Tutorial_1_Distributions.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn; seaborn.set_style('whitegrid') import numpy from pomegranate import * numpy.random.seed(0) numpy.set_printoptions(suppress=True) %load_ext watermark %watermark -m -n -p numpy,scipy,pomegranate """ Explanation: Probability Distributions author: Jacob...
LeonhardFS/flightbbq
03_DataExploration.ipynb
mit
import pandas as pd import matplotlib import numpy as np matplotlib.style.use('fivethirtyeight') %matplotlib inline %pylab inline pylab.rcParams['figure.figsize'] = (10, 6) """ Explanation: Data Exploration End of explanation """ complete2014Data = pd.DataFrame.from_csv('cache/complete2014Data.csv') """ Explanation...
machinelearningnanodegree/stanford-cs231
solutions/levin/assignment1/features.ipynb
mit
import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # for auto-reloading extenrnal modu...
cjcopi/healpy
doc/healpy_tutorial.ipynb
gpl-2.0
import matplotlib.pyplot as plt %matplotlib inline import numpy as np import healpy as hp """ Explanation: healpy tutorial See the Jupyter Notebook version of this tutorial at https://github.com/healpy/healpy/blob/master/doc/healpy_tutorial.ipynb See a executed version of the notebook with embedded plots at https://...
AEW2015/PYNQ_PR_Overlay
Pynq-Z1/notebooks/examples/pmod_tc1.ipynb
bsd-3-clause
from pynq import Overlay Overlay("base.bit").download() from pynq.iop import Pmod_TC1 from pynq.iop import PMODB # TC1 sensor is on PMODB my_tc1 = Pmod_TC1(PMODB) r = my_tc1.read() print('Raw Register Value: %08x hex' % r) print('Ref Junction Temp: %.4f' % my_tc1.reg_to_ref(r)) print('Thermocouple Temp: %.2f' % my_...
AllenDowney/ThinkStats2
solutions/chap06soln.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
gcgruen/homework
data-databases-homework/Homework_6_Gruen_Graded.ipynb
mit
import requests data = requests.get('http://localhost:5000/lakes').json() print(len(data), "lakes") for item in data[:10]: print(item['name'], "- elevation:", item['elevation'], "m / area:", item['area'], "km^2 / type:", item['type']) """ Explanation: graded = 8/10 Homework 6: Web Applications For this homework, y...
sorig/shogun
doc/ipython-notebooks/evaluation/xval_modelselection.ipynb
bsd-3-clause
%pylab inline %matplotlib inline # include all Shogun classes import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') from shogun import * # generate some ultra easy training data gray() n=20 title('Toy data for binary classification') X=hstack((randn(2,n), randn(2,n)+1)) Y=hstack((-ones(n), ones(n))) _...
eds-uga/csci1360e-su17
assignments/A6/A6_Q1.ipynb
mit
u1 = ["green", "green", "blue", "green"] a1 = set({("green", 3), ("blue", 1)}) assert a1 == set(urn_to_dict(u1).items()) u2 = ["red", "blue", "blue", "green", "yellow", "black", "black", "green", "blue", "yellow", "red", "green", "blue", "black", "yellow", "yellow", "yellow", "green", "blue", "red", "red", "blue", "re...
DavidObando/carnd
Term1/Labs/CarND-LeNet-Lab/LeNet-Lab-Solution.ipynb
apache-2.0
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", reshape=False) X_train, y_train = mnist.train.images, mnist.train.labels X_validation, y_validation = mnist.validation.images, mnist.validation.labels X_test, y_test = mnist.test.images, mn...
wanderer2/pymc3
docs/source/notebooks/GLM-hierarchical-ADVI.ipynb
apache-2.0
%matplotlib inline import sys, os sys.path.insert(0, os.path.expanduser('~/work/git/github/taku-y/pymc3')) import theano theano.config.floatX = 'float64' import matplotlib.pyplot as plt import numpy as np import pymc3 as pm import pandas as pd data = pd.read_csv('../data/radon.csv') county_names = data.county.unique...
mined-gatech/pymks_overview
notebooks/python_intro.ipynb
mit
log10(10) """ Explanation: Quick Intro to Python Math and Modules In the space below and use Python as a calculator. Now let's try some more advanced funtions. End of explanation """ import math math.log10(10) """ Explanation: The standard Python distribution only comes with the bare-bone capabilities. Other funct...
rjleveque/binder_experiments
misc/ipyleaflet_polygon_selector.ipynb
bsd-2-clause
from IPython.display import display import ipywidgets from __future__ import print_function import ipyleaflet from ipyleaflet import ( Map, Marker, TileLayer, ImageOverlay, Polyline, Polygon, Rectangle, Circle, CircleMarker, GeoJSON, DrawControl ) """ Explanation: Tool to draw polygons on ma...
BeatHubmann/17F-U-DLND
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...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
tpin3694/tpin3694.github.io
python/create_list_from_dictionary_keys_and_values.ipynb
mit
dict = {'county': ['Cochice', 'Pima', 'Santa Cruz', 'Maricopa', 'Yuma'], 'year': [2012, 2012, 2013, 2014, 2014], 'fireReports': [4, 24, 31, 2, 3]} """ Explanation: Title: Creating Lists From Dictionary Keys And Values Slug: create_list_from_dictionary_keys_and_values Summary: Creating Lists From Dict...
cmshobe/dem_analysis_with_gdal
dem_processing_with_gdal_python.ipynb
mit
from osgeo import gdal import numpy as np """ Explanation: Short introduction to working with DEMs in Python GDAL Greg Tucker, CU Boulder, Feb 2016 Install GDAL library You'll need to install the GDAL library. If you have Anaconda installed, you can do this from the command line by: conda install gdal Download some DE...
pligor/predicting-future-product-prices
dfa/notebook/dfa_simulations.ipynb
agpl-3.0
import numpy as np import matplotlib import matplotlib.pyplot as plt import scipy.signal as ss import scipy.stats as st plt.style.use('ggplot') %matplotlib inline """ Explanation: DFA robustness simulations Dominik Krzemiński End of explanation """ def calc_rms(x, scale): """ Root Mean Square in windows wit...
rubensfernando/mba-analytics-big-data
Python/2016-08-08/aula7-parte4-wikipedia.ipynb
mit
import requests req = requests.get("https://pt.wikipedia.org/wiki/Unidades_federativas_do_Brasil") from bs4 import BeautifulSoup bs = BeautifulSoup(req.text, "html.parser") print(bs.prettify()) print(bs.h1.string) bs.h1 """ Explanation: Recuperar informações da Wikipedia End of explanation """ bs.a """ Explan...
RoebideBruijn/datascience-intensive-course
exercises/statistics project 3/sliderule_dsi_inferential_statistics_exercise_3.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt import bokeh.plotting as bkp import seaborn as sns from mpl_toolkits.axes_grid1 import make_axes_locatable %matplotlib inline sns.set_style('white') # read in readmissions data provided hospital_read_df = pd.read_csv('data/cms_hospital_readmissio...
vatsalgit/Deep-Learning-
assignment2/Problem_3.ipynb
gpl-3.0
# Import what we need import os import sys import numpy as np import scipy.io import scipy.misc import tensorflow as tf # Import TensorFlow after Scipy or Scipy will break import matplotlib.pyplot as plt from matplotlib.pyplot import imshow from PIL import Image %matplotlib inline """ Explanation: [BONUS] Problem 3: ...
naoyak/Agile_Data_Code_2
ch09/Debugging Prediction Problems.ipynb
mit
APP_NAME = "Debugging Prediction Problems" # If there is no SparkSession, create the environment try: sc and spark except NameError as e: import findspark findspark.init() import pyspark import pyspark.sql sc = pyspark.SparkContext() spark = pyspark.sql.SparkSession(sc).builder.appName(APP_NAME).getOrCr...
CamDavidsonPilon/lifelines
docs/jupyter_notebooks/Modelling time-lagged conversion rates.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' from matplotlib import pyplot as plt import autograd.numpy as np from autograd.scipy.special import expit, logit import pandas as pd plt.style.use('bmh') N = 200 U = np.random.rand(N) T = -(logit(-np.log(U) / 0.5) - np.random.exponential(2, N) - 6.00)...
rachellevanger/tda-persistence-explorer
doc/Tutorial.ipynb
mit
from PersistenceExplorer import * """ Explanation: Persistence Explorer Tutorial This Jupyter notebook will show you how to get up and running with the tda-d3-explorer tool. If you haven't installed the tool yet, please follow the instructions listed on the readme of the tda-d3-explorer repository. End of explanation ...
vicente-gonzalez-ruiz/YAPT
01-hello_world/01-intro.ipynb
cc0-1.0
# %load quicksort.c // http://www.comp.dit.ie/rlawlor/Alg_DS/sorting/quickSort.c #include <stdio.h> void quickSort( int[], int, int); int partition( int[], int, int); void main() { int a[] = { 7, 12, 1, -2, 0, 15, 4, 11, 9}; int i; printf("\n\nUnsorted array is: "); for(i = 0; i < 9; ++i) ...
texib/deeplearning_homework
tensor-flow-exercises/1_notmnist.ipynb
mit
print 'xxxx' # These are all the modules we'll be using later. Make sure you can import them # before proceeding further. import matplotlib.pyplot as plt import numpy as np import os import tarfile import urllib from IPython.display import display, Image from scipy import ndimage from sklearn.linear_model import Logis...
ML4DS/ML4all
C4.Classification_SVM/svm_professor.ipynb
mit
from __future__ import print_function # To visualize plots in the notebook %matplotlib inline # Imported libraries #import csv #import random #import matplotlib import matplotlib.pyplot as plt from mpl_toolkits import mplot3d #import pylab import numpy as np #from sklearn.preprocessing import PolynomialFeatures from...
elenduuche/deep-learning
image-classification/.ipynb_checkpoints/dlnd_image_classification-checkpoint.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' class DLProgress(tqdm): last_block = 0 def hoo...
dfm/dfm.io
static/downloads/notebooks/autocorr.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = "retina" from __future__ import print_function from matplotlib import rcParams rcParams["savefig.dpi"] = 100 rcParams["figure.dpi"] = 100 rcParams["font.size"] = 20 """ Explanation: Title: Autocorrelation time estimation Date: 2017-10-16 Category: Data Analysi...
geektoni/shogun
doc/ipython-notebooks/classification/SupportVectorMachines.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') import matplotlib.patches as patches import shogun as sg import numpy as np %matplotlib inline #Generate some random data X = 2 * np.random.randn(10,2) traindata=np.r_[X + 3, X + 7].T feats_train=sg.create_feature...
mmckerns/tutmom
mystic.ipynb
bsd-3-clause
%matplotlib notebook """ Explanation: Optimiztion with mystic End of explanation """ """ Example: - Minimize Rosenbrock's Function with Nelder-Mead. - Plot of parameter convergence to function minimum. Demonstrates: - standard models - minimal solver interface - parameter trajectories using reta...
JoseGuzman/myIPythonNotebooks
Stochastic_systems/Normal_distribution.ipynb
gpl-2.0
# create a normally distributed random variable with mu and sigma mu = 28.74 sigma = 8.33 # standard deviation! rv_X = norm(loc = mu, scale = sigma) # plot the theoretical and empirical distributions x = np.linspace(start = rv_X.ppf(0.001), stop = rv_X.ppf(0.999), num = 100) plt.plot(x, rv_X.pdf(x), color = 'r', lw=2,...
MBARIMike/biofloat
notebooks/explore_cached_biofloat_data.ipynb
mit
from biofloat import ArgoData ad = ArgoData() """ Explanation: Explore locally cached Argo oxygen float data - second in a series of Notebooks Use the biofloat module to get data and Pandas to operate on it for testing ability to easily perform calibrations (See build_biofloat_cache.ipynb for for the work that leads t...
myfunprograms/deep_learning
project2/files/dlnd_image_classification_instruction.ipynb
gpl-3.0
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' class DLProgress(tqdm): last_block = 0 def hoo...
lmmentel/xrd-to-heatmap
notebooks/csv_to_heatmap.ipynb
mit
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable def create_matrix(filename, colnum, rank, sep=':', savecsv=False): df = pd.read_csv(filename, sep=sep, header=None, comment='#') matrix = df.iloc[:, [colnum]].values.reshape...
JanetMatsen/Machine_Learning_CSE_546
HW3/notebooks/Q-5_Run_K-Means.ipynb
mit
km_16 = KMeans(k=16, train_X=X_train, train_y=y_train, pca_obj=pca_training, max_iter = 500, test_X=X_test, test_y=y_test, verbose=False) km_16.run() """ Explanation: Q 5.1: k = 16, MNIST data transformed by first 50 PCA components. End of explanation """ km_16_recon...
CalPolyPat/phys202-2015-work
days/day10/Interpolation.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns """ Explanation: Interpolation Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy. End of explanation """ x = np.linspace(0,4*np.pi,10) x """ Explanation: Overview W...
probml/pyprobml
deprecated/advi_beta_binom_jax.ipynb
mit
try: import jax except ModuleNotFoundError: %pip install -qqq jax jaxlib import jax import jax.numpy as jnp from jax import lax try: from tensorflow_probability.substrates import jax as tfp except ModuleNotFoundError: %pip install -qqq tensorflow_probability from tensorflow_probability.substra...
pmgbergen/porepy
tutorials/compressible_flow_with_automatic_differentiation.ipynb
gpl-3.0
import numpy as np import scipy.sparse as sps import matplotlib.pyplot as plt # Porepy modules import porepy as pp """ Explanation: Introduction This notebook gives suggests how to solve the problem of non-linear compressible flow using the automatic differentiation library included in PorePy. The Ad functionality i...
GoogleCloudPlatform/ml-design-patterns
04_hacking_training_loop/transfer_learning.ipynb
apache-2.0
import numpy as np import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_hub as hub import matplotlib.pyplot as plt from tensorflow import keras from tensorflow.keras import Sequential """ Explanation: Transfer Learning Design Pattern In Transfer Learning, we take part of a previously trained m...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_read_inverse.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) from mne.datasets import sample from mne.minimum_norm import read_inverse_operator print(__doc__) data_path = sample.data_path() fname = data_path fname += '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif' inv = read_...
vzg100/Post-Translational-Modification-Prediction
old/Phosphorylation Sequence Tests -XGB -dbptm+ELM -EnzymeBenchmarks-VectorAvr..ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] benchmarks = ["Data/Benchmarks/phos_CDK1.csv", "Data/Benchmarks/phos_CK2.csv", "Data/B...
google/starthinker
colabs/dcm_api_to_bigquery.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: 1. Install Dependencies First install the libraries needed to execute recipes, this only needs to be done once, then click play. End of explanation """ CLOUD_PROJECT = 'PASTE PROJECT ID HERE' print("Cloud Project Set To: %s" % CLOUD_PROJECT) ...
tensorflow/model-optimization
tensorflow_model_optimization/g3doc/guide/quantization/training_example.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...
statsmodels/statsmodels.github.io
v0.12.2/examples/notebooks/generated/theta-model.ipynb
bsd-3-clause
import numpy as np import pandas as pd import pandas_datareader as pdr import matplotlib.pyplot as plt import seaborn as sns plt.rc("figure",figsize=(16,8)) plt.rc("font",size=15) plt.rc("lines",linewidth=3) sns.set_style("darkgrid") """ Explanation: The Theta Model The Theta model of Assimakopoulos & Nikolopoulos (20...
dbrattli/RxPY
notebooks/Getting Started.ipynb
apache-2.0
%%bash pip install rx """ Explanation: Getting Started with RxPY ReactiveX, or Rx for short, is an API for programming with observable event streams. RxPY is a port of ReactiveX to Python. Learning Rx with Python is particularly interesting since Python removes much of the clutter that comes with statically typed lang...
gmonce/datascience
src/Just some notes on PCA in Python.ipynb
gpl-3.0
import numpy as np %matplotlib inline from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d import proj3d np.set_printoptions(suppress=True,precision=3) from matplotlib.patches import FancyArrowPatch """ Explanation: Just some notes on PCA in Python Guillermo Moncecchi ...
ComputationalModeling/spring-2017-danielak
past-semesters/fall_2016/homework/HW3/Homework_3.ipynb
agpl-3.0
# put your code here """ Explanation: Homework #3 This notebook is due on Friday, October 28th, 2016 at 11:59 p.m.. Please make sure to get started early, and come by the instructors' office hours if you have any questions. Office hours and locations can be found in the course syllabus. IMPORTANT: While it's fine...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/automaton.is_isomorphic.ipynb
gpl-3.0
import vcsn def aut(e): return vcsn.context('lal_char, b').expression(e, 'binary').standard() a1 = aut('a*+b*'); a1 a2 = aut('b*+a*'); a2 a1.is_isomorphic(a2), a1 == a2 """ Explanation: automaton.is_isomorphic(aut) Whether this automaton isomorphic to aut, i.e., whether they are "the same graph." Preconditions:...
minh-doan/deepometry
STEP_4b_Test_and_Visualization_prebuilt_CNN.ipynb
bsd-3-clause
# Location of digested data input_directory = '/digested/' # Desired location to save temporary PNG outputs: png_directory = '/digested_png/' # Location of saved trained model model_directory = '/model_directory/' # Desired location for outputs output_directory = '/output_directory_transferred/' # Define native sha...
mohanprasath/Course-Work
numpy/numpy_exercises_from_kyubyong/Array_manipulation_routines_Solutions.ipynb
gpl-3.0
import numpy as np np.__version__ """ Explanation: Array manipulation routines End of explanation """ x = np.ones([10, 10, 3]) out = np.reshape(x, [-1, 150]) print out assert np.allclose(out, np.ones([10, 10, 3]).reshape([-1, 150])) """ Explanation: Q1. Let x be a ndarray [10, 10, 3] with all elements set to one. ...
do-mpc/do-mpc
documentation/source/getting_started.ipynb
lgpl-3.0
import numpy as np # Add do_mpc to path. This is not necessary if it was installed via pip. import sys sys.path.append('../../') # Import do_mpc package: import do_mpc """ Explanation: Getting started: MPC In this Jupyter Notebook we illustrate the core functionalities of do-mpc. Open an interactive online Jupyter N...
chrisfilo/fmri-analysis-vm
analysis/firstlevel/First level modeling.ipynb
mit
import nipype.algorithms.modelgen as model # model generation import nipype.interfaces.fsl as fsl # fsl from nipype.interfaces.base import Bunch import os,json,glob import numpy import nibabel import nilearn.plotting from make_event_files_from_json import MakeEventFilesFromJSON %matplotlib inline import mat...
banyh/ShareIPythonNotebook
NLP_With_Python/Ch2.ipynb
gpl-3.0
import nltk nltk.corpus.gutenberg.fileids() """ Explanation: Chapter 2: 取得Corpora及Lexical資源 2.1 文字型的Corpus Gutenberg Corpus 古騰堡計畫是由志工參與,將文學資料電子化的計畫。古騰堡是活字印刷的發明人,以他為名表示希望知識的自由流通。在Gutenberg Corpus中有部分的文學作品,可以用nltk.corpus.gutenberg.fileids()查詢。 End of explanation """ emma = nltk.corpus.gutenberg.words('austen-emma.txt'...
nholtz/structural-analysis
theory/frame2d/01-Derivation-Local-Stiffness.ipynb
cc0-1.0
from sympy import * init_printing(use_latex='mathjax') from sympy.matrices import Matrix """ Explanation: Plane Frame Member Local Stiffness Matrix This page develops the various member stiffness relationships needed to analyze a planar frame by the matrix stiffness method. Numbering and Sign Convention, Local Coordin...