repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
NORCatUofC/rain
sewer-overflows/notebooks/River Reversals vs. Rainfall.ipynb
mit
# Get River reversals reversals = pd.read_csv('data/lake_michigan_reversals.csv') reversals['start_date'] = pd.to_datetime(reversals['start_date']) reversals.head() # Create rainfall dataframe. Create a series that has hourly precipitation rain_df = pd.read_csv('data/ohare_hourly_20160929.csv') rain_df['datetime'] = ...
csdms/coupling
docs/demos/ku.ipynb
mit
# Load standard Python modules import numpy as np import matplotlib.pyplot as plt # Load PyMT model(s) import pymt.models ku = pymt.models.Ku() """ Explanation: Kudryavtsev Model Link to this notebook: https://github.com/csdms/pymt/blob/master/docs/demos/ku.ipynb Install command: $ conda install notebook pymt_permam...
nick-youngblut/SIPSim
ipynb/sandbox/sandbox.ipynb
mit
from scipy import stats import numpy as np # making kde values = np.arange(10) kde = stats.gaussian_kde(values) np.median(kde.resample(100000)) def KDE_make_means(kde, size=10): func = lambda x : np.random.randint(0, x.n, size=x.d) kde.means = [kde.dataset[:, func(kde)] for i in xrange(size)] kde.means_n...
deepmind/abcei_mab
notebooks/paper_experiments.ipynb
apache-2.0
# Copyright 2022 DeepMind Technologies Limited # # 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 applicable law or agr...
tleonhardt/machine_learning
SL9_Bayseian_Learning.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Naive Bayes Classifiers Naive Bayes classifiers are a family of classifiers that are quite similar to the linear models discussed previously. However, they tend to be even faster in training. The price paid for this efficiency is th...
jason-neal/eniric
docs/Notebooks/spectral_gradient.ipynb
mit
import matplotlib matplotlib.rcParams["text.usetex"] = False matplotlib.rcParams["text.latex.unicode"] = True import matplotlib.pyplot as plt import numpy as np %matplotlib inline from eniric.utilities import load_aces_spectrum # from eniric.precision import slope, slope_grad def slope(wavelength, flux): """O...
tensorflow/examples
courses/udacity_intro_to_tensorflow_lite/tflite_c04_exercise_convert_model_to_tflite_solution.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_stats_cluster_spatio_temporal_repeated_measures_anova.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # Denis Engemannn <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np from numpy.random import randn import matplotlib.pyplot as plt import mne f...
GoogleCloudPlatform/vertex-ai-samples
community-content/tf_agents_bandits_movie_recommendation_with_kfp_and_vertex_sdk/mlops_pipeline_tf_agents_bandits_movie_recommendation/mlops_pipeline_tf_agents_bandits_movie_recommendation.ipynb
apache-2.0
import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = "--user" ! pip3 install {...
mne-tools/mne-tools.github.io
dev/_downloads/f61f2c2f6132bd3b1076dab7ac194713/20_events_from_raw.ipynb
bsd-3-clause
import os import numpy as np import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file) raw.crop(tmax=60).load_data() """ Explanati...
wmfschneider/CHE30324
Homework/HW2-soln.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt m = 32/1000/(6.022*10**23) #mass of O2 (kg/molecule) k = 1.38064852*10**-23 # Boltzmann Constant (m^2 kg s^-2 K^-1) v = np.linspace(0,1500,1000) #velocity (m/s) for T in [200,400,600]: P = (m*v/k/T)*np.exp(-m*v**2/(2*k*T)) #Maxwell-Boltzman speed distribution for a...
CompPhysics/MachineLearning
doc/Programs/ANN/Ann2.ipynb
cc0-1.0
# %load partSix.py # Neural Networks Demystified # Part 6: Training # # Supporting code for short YouTube series on artificial neural networks. # # Stephen Welch # @stephencwelch ## ----------------------- Part 1 ---------------------------- ## import numpy as np # X = (hours sleeping, hours studying), y = Score on ...
tensorflow/docs-l10n
site/ja/r1/tutorials/keras/save_and_restore_models.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...
gururajl/deep-learning
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...
google/jax-md
notebooks/flocking.ipynb
apache-2.0
#@title Imports & Utils # Imports !pip install -q git+https://www.github.com/google/jax-md import numpy as onp from jax.config import config ; config.update('jax_enable_x64', True) import jax.numpy as np from jax import random from jax import jit from jax import vmap from jax import lax vectorize = np.vectorize fr...
subutai/htmresearch
projects/sparse_rl/Plot_SparseRL_Results.ipynb
agpl-3.0
# !python sparse_dqn.py --sparse --timesteps 100000 --results_path results.sparse # !python sparse_dqn.py --dense --timesteps 100000 --results_path results.dense sparse = pd.read_csv('results.sparse/SeaquestDeterministic-v4.train.csv') dense = pd.read_csv('results.dense/SeaquestDeterministic-v4.train.csv') """ Explan...
borja876/Thinkful-DataScience-Borja
Household+Electricity+Consumption+1990-2014.ipynb
mit
#Europe df5 = df4.loc[df4.index.isin(['Austria', 'Belgium', 'Bulgaria','Croatia', 'Cyprus', 'Czechia','Denmark', 'Estonia','Finland','France','Germany','Greece','Hungary','Ireland','Italy','Latvia','Lithuania','Luxembourg','Malta','Netherlands','Poland','Portugal','Romania','Slovakia', 'Slovenia','Spain', 'Sweden', 'Un...
junhwanjang/DataSchool
Lecture/05. 기초 선형 대수 1 - 행렬의 정의와 연산/1) NumPy 소개.ipynb
mit
import numpy as np a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) print(type(a)) a """ Explanation: NumPy 소개 NumPy(보통 "넘파이"라고 발음한다)는 2005년에 Travis Oliphant가 발표한 수치해석용 Python 패키지이다. 다차원의 행렬 자료구조인 ndarray 를 지원하여 벡터와 행렬을 사용하는 선형대수 계산에 주로 사용된다. 내부적으로는 BLAS 라이브러리와 LAPACK 라이브러리에 기반하고 있어서 C로 구현된 CPython에서만 사용할 수 있으며 Jython, Ir...
AllenDowney/CompStats
sampling_soln.ipynb
mit
from __future__ import print_function, division import numpy import scipy.stats import matplotlib.pyplot as pyplot from ipywidgets import interact, interactive, fixed import ipywidgets as widgets # seed the random number generator so we all get the same results numpy.random.seed(18) # some nicer colors from http:/...
uber/pyro
tutorial/source/RSA-hyperbole.ipynb
apache-2.0
#first some imports import torch torch.set_default_dtype(torch.float64) # double precision for numerical stability import collections import argparse import matplotlib.pyplot as plt import pyro import pyro.distributions as dist import pyro.poutine as poutine from search_inference import HashingMarginal, memoize, Se...
flohorovicic/pynoddy
docs/notebooks/4-Create-model.ipynb
gpl-2.0
from matplotlib import rc_params from IPython.core.display import HTML css_file = 'pynoddy.css' HTML(open(css_file, "r").read()) import sys, os import matplotlib.pyplot as plt # adjust some settings for matplotlib from matplotlib import rcParams # print rcParams rcParams['font.size'] = 15 # determine path of reposito...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/sandbox-3/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-3', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: NCC Source ID: SANDBOX-3 Topic: Landice Sub-Topics: Glaciers, Ice. Properties: 3...
cathywu/flow
tutorials/tutorial10_controllers.ipynb
mit
import numpy as np from flow.controllers.base_controller import BaseController """ Explanation: Tutorial 10: Custom Controllers This tutorial walks through the process of defining controllers for the lateral and longitudinal movement of human-driven vehicles within a network. Such controllers may be necessary in orde...
catarinaqmcosta/Scenarios_Network
OQResultsPath-withDamage_RT_Correlation.ipynb
gpl-3.0
import utils import utilsPlot %matplotlib inline from time import gmtime, strftime """ Explanation: OpenQuake results for a specific path of the network This IPython notebook allows the user to analyse the results obtained from a scenario damage analysis on a specific path of the transportation network. The notebook...
mayankjohri/LetsExplorePython
Section 1 - Core Python/Chapter 01 - Introduction/01_03. Starting Point.ipynb
gpl-3.0
print("!!! स्वागतम् !!!") print("!!! Welcome !!!") print("!!! Willkommen !!!") print("Hello", ",", "What are you doing") """ Explanation: Starting Point In this section we will cover few items, without which out training can't continue. We will be covering only briefly those topics, as they will be covered in detail...
wcmckee/lcacoffee
lcacoffee.ipynb
mit
import json import os import pandas import getpass theuser = getpass.getuser() """ Explanation: <h1>lcacoffee</h1> script that displays coffees sold by hour at lca2015. Currently it opens a .json file and converts it into a python dict. It's missing monday data. sale by hour is: key - the hour (24hr). Value is tota...
bramkaarga/transcrit
01_example_metric_calculation.ipynb
bsd-3-clause
%matplotlib inline from matplotlib import pyplot as plt import networkx as nx import pandas as pd import geopandas as gp from __future__ import division import os import sys module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) #Modules developed for this p...
AllenDowney/ThinkBayes2
examples/voter.ipynb
mit
import thinkbayes2 """ Explanation: Think Bayes Example problem related to Think Bayes The MIT License Copyright 2016 Allen Downey End of explanation """ prior = thinkbayes2.Suite({'State 1': 0.4, 'State 2': 0.25, 'State 3': 0.35}) prior.Print() """ Explanation: The following problem was submitted to my blog, Proba...
AllenDowney/ThinkBayes2
soln/chap13redux.ipynb
mit
# If we're running on Colab, install empiricaldist # https://pypi.org/project/empiricaldist/ import sys IN_COLAB = 'google.colab' in sys.modules if IN_COLAB: !pip install empiricaldist # Get utils.py from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename...
dolittle007/dolittle007.github.io
notebooks/rugby_analytics.ipynb
gpl-3.0
!date import numpy as np import pandas as pd try: from StringIO import StringIO except ImportError: from io import StringIO %matplotlib inline import pymc3 as pm, theano.tensor as tt """ Explanation: A Hierarchical model for Rugby prediction @Author: Peadar Coyle @email: peadarcoyle@googlemail.com @date: 31/...
napsternxg/pytorch-practice
Pytorch Gradient reversal.ipynb
apache-2.0
import torch import tensorflow as tf from torch.autograd import Variable import numpy as np def f(X): return X*X def g(X): return X**3 X = np.random.randn(10) X """ Explanation: Gradient reversal pytorch Inspired from the following tweets: https://twitter.com/mat_kelcey/status/932149793765261313 https://t...
zerothi/sisl
docs/visualization/viz_module/showcase/FatbandsPlot.ipynb
mpl-2.0
import sisl import sisl.viz """ Explanation: FatbandsPlot End of explanation """ # First, we create the geometry BN = sisl.geom.graphene(atoms=["B", "N"]) # Create a hamiltonian with different on-site terms H = sisl.Hamiltonian(BN) H[0, 0] = 2 H[1, 1] = -2 H[0, 1] = -2.7 H[1, 0] = -2.7 H[0, 1, (-1, 0)] = -2.7 H[...
molgor/spystats
notebooks/.ipynb_checkpoints/Spatial Model Fitting using GLS-Copy1-checkpoint.ipynb
bsd-2-clause
# Load Biospytial modules and etc. %matplotlib inline import sys sys.path.append('/apps') sys.path.append('..') sys.path.append('../spystats') import django django.setup() import pandas as pd import matplotlib.pyplot as plt import numpy as np ## Use the ggplot style plt.style.use('ggplot') import tools """ Explanatio...
srcole/qwm
yelp/Analyze - food by cities.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd import glob import os import scipy as sp from scipy import stats from tools.plt import color2d #from the 'srcole/tools' repo from matplotlib import cm """ Explanation: https://docs.google.com/document/d/15GMxvJYAUO-b96c18QmfcF27...
zzsza/Datascience_School
12. 추정 및 검정/03. SciPy를 사용한 기초적인 검정.ipynb
mit
N = 10 theta_0 = 0.5 np.random.seed(0) x = sp.stats.bernoulli(theta_0).rvs(N) n = np.count_nonzero(x) n sp.stats.binom_test(n, N) """ Explanation: SciPy를 사용한 기초적인 검정 SciPy 파이썬 패키지는 다음과 같은 다양한 검정 명령을 제공한다. 이항 검정 (Binomial test) 카이 제곱 검정 (Chi-square test) 단일 표본 z-검정 (One-sample z-test) 단일 표본 t-검정 (One-sample t-test) 독...
dotsdl/msmbuilder
examples/uncertainty.ipynb
lgpl-2.1
%matplotlib inline import numpy as np import matplotlib.pyplot as pp from mdtraj.utils import timing from msmbuilder.cluster import NDGrid from msmbuilder.example_datasets import QuadWell from msmbuilder.msm import BayesianMarkovStateModel from msmbuilder.msm import ContinuousTimeMSM """ Explanation: This example demo...
rdhyee/nypl50
rtc50_checklist.ipynb
apache-2.0
from __future__ import print_function import gspread import json # rtc50_settings.py holds URL related to the Google spreadsheet from rtc50_settings import (g_name, g_url, g_key) OFFICIAL_NAME_KEY = "Name in rtc/books.json, Official Name" """ Explanation: Jennifer 8. Lee et al have been using a Google spreadsheet ...
leosartaj/scipy-2016-tutorial
tutorial_exercises/03-Integrals.ipynb
bsd-3-clause
# Indefinite integral integrate(x**2, x) """ Explanation: Integrals In the last section we learned symbolic differentiation with diff. Here we'll cover symbolic integration with integrate. Here is how we write the indefinite integral $$ \int x^2 dx = \frac{x^3}{3}$$ End of explanation """ # Definite integral integr...
ecell/ecell4-notebooks
en/examples/example05.ipynb
gpl-2.0
%matplotlib inline from ecell4.prelude import * """ Explanation: Glycolysis Model and Metabolic Control Analysis End of explanation """ citation(125616) citation(168932) """ Explanation: A Simple Model of the Glycolysis of Human Erythrocytes This is a model for the glycolysis of human erythrocytes which takes into...
kinshuk4/MoocX
misc/machinelearningbootcamp/day2/deep_learning.ipynb
mit
import os import numpy as np import matplotlib.pyplot as plt from scipy import misc % matplotlib inline plt.rcParams['figure.figsize'] = (10, 10) plt.rcParams['image.cmap'] = 'gray' """ Explanation: Module 2 Convolutions First let's have a look at what convolutions do Learning Activity 1: Load the Python libraries ...
ceos-seo/data_cube_notebooks
notebooks/machine_learning/Uruguay_Random_Forest/Random_Forests_Uruguay.ipynb
apache-2.0
import pandas as pd df = pd.read_csv('data.csv') df.head() """ Explanation: Read in the data End of explanation """ df.groupby("LandUse").size() from matplotlib import pyplot import seaborn as sns fig, ax = pyplot.subplots(figsize=(15,5)) sns.countplot(x="LandUse",data=df, palette="Greens_d"); """ Explanation: S...
CSB-book/CSB
python/solutions/Singh2015_solution.ipynb
gpl-3.0
import csv """ Explanation: Solution of 3.8.2, Singh et al. 2015 Compute the mean RecombinantFraction for each Drosophila Line and InfectionStatus. Print the results like: Line 45 Average Recombination Rate: W : 0.187 I : 0.191 To read the data, we're going to use the csv module. First, we need to import it: End of ...
timothyb0912/pylogit
examples/notebooks/.ipynb_checkpoints/Python Biogeme Benchmark--01Logit-checkpoint.ipynb
bsd-3-clause
# Load the raw swiss metro data # Note the .dat files are tab delimited text files swissmetro_wide = pd.read_table("../data/swissmetro.dat", sep='\t') """ Explanation: 1. Load the Swissmetro Dataset End of explanation """ # Select obervations whose choice is known (i.e. CHOICE != 0) # **AND** whose PURPOSE is either...
hglanz/phys202-2015-work
assignments/assignment05/InteractEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 3 Imports End of explanation """ def soliton(x, t, c, a): """Return phi(x, t) for a soliton wave with co...
Astrohackers-TW/IANCUPythonAdventure
notebooks/notebooks4HowtoSeries/how_to_fit_data.ipynb
mit
from astropy.io import ascii radio_infrared_NLSy1 = ascii.read('../files4examples/Radio_Infrared_NLSy1.txt',names=['radio luminosity','infrared luminosity']) radio_infrared_SG = ascii.read('../files4examples/Radio_Infrared_spiral.txt',names=['radio luminosity','infrared luminosity']) radio_infrared_RG = ascii.read('../...
ottogroup/dstoolbox
notebooks/Showcase.ipynb
apache-2.0
from functools import partial import operator import random import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_error from sklearn.preprocessing import FunctionTransformer from sklearn.preprocessing import PolynomialFeatures from sklearn.pr...
josephmfaulkner/stoqs
stoqs/contrib/notebooks/explore_BIOM_data_for_SIMZ.ipynb
gpl-3.0
from campaigns import campaigns dbs = [c for c in campaigns if 'simz' in c] print dbs """ Explanation: Update BIOM file with data from STOQS Given a .biom file and multiple STOQS databases, explore Next Generation Sequence and associated STOQS data Executing this Notebook requires a personal STOQS server. Follow the s...
crystalzhaizhai/cs207_yi_zhai
homeworks/HW6/HW6.ipynb
mit
from enum import Enum class AccountType(Enum): SAVINGS = 1 CHECKING = 2 """ Explanation: Homework 6 Due: Tuesday, October 10 at 11:59 PM Problem 1: Bank Account Revisited We are going to rewrite the bank account closure problem we had a few assignments ago, only this time developing a formal class for a Bank ...
kamujun/exercise_of_deep_larning_from_scratch
notebooks/section3.ipynb
mit
import matplotlib.pyplot as plt from matplotlib.image import imread from graphviz import Digraph f = Digraph(format="png") f.attr(rankdir='LR') f.attr('node', shape='circle') f.node('x1','') f.node('x2','') f.node('s1','') f.node('s2','') f.node('s3','') f.node('y1','') f.node('y2','') with f.subgraph(name='cluster...
Hades1996/nummeth
finding roots/tercerPunto.ipynb
mit
import math def funcion(x): return (230*math.pow(x,4))+(18*math.pow(x,3))+(9*math.pow(x,2))-(221*x)-9 def biseccion(intA, intB, errorA, noMaxIter): if(funcion(intA)*funcion(intB)<0): noIter = 0 errorTmp = 1 intTmp = 0 oldInt = intA while(noIter<n...
vladan-jovicic/ComplexNetworks
Notebooks/HowTo.ipynb
mit
import sys, os # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath('../src/')))) sys.path.append('../src/') import graph reload(graph) """ Explanation: How to use implemented algorithms Overview The project has the following structure: doc contains documentation of the project src contains all the sour...
ES-DOC/esdoc-jupyterhub
notebooks/thu/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', 'thu', 'sandbox-2', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: THU Source ID: SANDBOX-2 Topic: Atmoschem Sub-Topics: Transport, Emissions Co...
Alexoner/skynet
notebooks/features.ipynb
mit
import random import numpy as np from skynet.utils.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 extenrna...
ueapy/ueapy.github.io
content/notebooks/2015-12-18-meeting-summary.ipynb
mit
!cat ~/anaconda/lib/python2.7/site-packages/rk/config/rk.ini """ Explanation: This week one of the group's members asked how to use Jupyter on our UEA's supercomputer cluster Grace. So today we tried to walk through that. We also discussed other Jupyter capabilities and advantages. Those who are still sceptical or hav...
jhillairet/scikit-rf
doc/source/examples/networktheory/Time domain reflectometry, measurement vs simulation.ipynb
bsd-3-clause
%matplotlib inline import skrf from skrf.media import MLine, DefinedAEpTandZ0 import numpy as np from numpy import real, log, log10, sum, absolute, pi, sqrt from scipy.optimize import minimize import matplotlib.pyplot as plt from IPython.display import * skrf.stylely() """ Explanation: Time domain reflectometry, measu...
eds-uga/csci1360e-su17
assignments/A3/A3_Q1.ipynb
mit
import numpy as np np.random.seed(7584) list1 = np.random.randint(-100, 100, 10) actual1 = list1 + 1 pred1 = add_one(list1.tolist()) assert set(pred1) == set(actual1.tolist()) np.random.seed(68527) list2 = np.random.randint(-100, 100, 100) actual2 = list2 + 1 pred2 = add_one(list2.tolist()) assert set(pred2) == set(...
tensorflow/docs-l10n
site/en-snapshot/datasets/keras_example.ipynb
apache-2.0
import tensorflow as tf import tensorflow_datasets as tfds """ Explanation: Training a neural network on MNIST with Keras This simple example demonstrates how to plug TensorFlow Datasets (TFDS) into a Keras model. Copyright 2020 The TensorFlow Datasets Authors, Licensed under the Apache License, Version 2.0 <table cla...
Alex-Ian-Hamilton/solarbextrapolation
docs/auto_examples/plot_define_and_run_trivial_preprocessor_and_extrapolator.ipynb
mit
# General imports import sunpy.map as mp import numpy as np from mayavi import mlab # Necessary for visulisation # Module imports from solarbextrapolation.preprocessors import Preprocessors from solarbextrapolation.extrapolators import Extrapolators from solarbextrapolation.map3dclasses import Map3D from solarbextrapo...
mne-tools/mne-tools.github.io
0.20/_downloads/e807ecd348331c3d789aa11b874576a5/plot_decoding_time_generalization_conditions.ipynb
bsd-3-clause
# Authors: Jean-Remi King <jeanremi.king@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import matplotlib.pyplot as plt from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler f...
Benedicto/ML-Learning
Classifier_4_decision_tree_combat_overfitting_assignment.ipynb
gpl-3.0
import graphlab """ Explanation: Decision Trees in Practice In this assignment we will explore various techniques for preventing overfitting in decision trees. We will extend the implementation of the binary decision trees that we implemented in the previous assignment. You will have to use your solutions from this pr...
theandygross/TCGA_differential_expression
Notebooks/DX_screen.ipynb
mit
import NotebookImport from Imports import * """ Explanation: Fraction upregulated screen Import everything from the imports notebook. This reads in all of the expression data as well as the functions needed to analyse differential expression data. End of explanation """ matched_meth = pd.read_hdf(METH_STORE, 'matche...
loudinthecloud/pytorch-ntm
notebooks/copy-task-plots.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pandas as pd from glob import glob import json import os import sys sys.path.append(os.path.abspath(os.getcwd() + "./../")) %matplotlib inline """ Explanation: Copy Task Plots End of explanation """ batch_num = 40000 files = glob("./copy/*-{}.json".format(b...
andim/pysnippets
random-choice.ipynb
mit
import numpy as np %load_ext Cython """ Explanation: A comparison of methods of random choice random.choice vs. a random.multinomial based implementation of the same weighted choice. Also compare with a GNU Scientific Library based implementation. Context: random.choice is only available in numpy >= 1.7, so I was tryi...
lvapeab/nmt-keras
examples/tutorial.ipynb
mit
!pip install update pip !pip uninstall -y kapre keras tensorflow-probability albumentations datascience h5py keras-nightly # Avoid crashes with pre-installed packages !git clone https://github.com/lvapeab/nmt-keras import os os.chdir('nmt-keras') !pip install -e . """ Explanation: <a href="https://colab.research.goo...
BrahmsPotato/PlayWithPrettyFat
kaggle/titanic/reference.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %pylab inline # Get a glimpse of data titanic_df = pd.read_csv('../input/train.csv') titanic_df.head() # Check the information of our data titanic_df.info() # Check Cabin column # print titanic_df['Cabin'] """ Explanation...
lisa-1010/smart-tutor
code/data_preprocessing_for_rnn.ipynb
mit
import sys print sys.executable %load_ext autoreload %autoreload 2 %reload_ext autoreload import sonnet as snt import tensorflow as tf import tflearn import numpy as np import dataset_utils """ Explanation: Sketchbook to experiment with RNN models to model the dynamics. Once tested, the code in this notebook will be...
mne-tools/mne-tools.github.io
0.23/_downloads/8de61cd59c9d83353f96a413e8484686/compute_mne_inverse_raw_in_label.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.minimum_norm import apply_inverse_raw, read_inverse_operator print(__doc__) data_path = sample.data_path() fname_inv = data_path + '/MEG/sample/s...
pjpmarques/Modelling-the-World
Lorenz Attractor.ipynb
mit
%matplotlib inline from scipy.integrate import odeint from mpl_toolkits.mplot3d.axes3d import Axes3D from pylab import * """ Explanation: Lorenz Attractor by Paulo Marques, 2013/09/21 This notebook implements the beautiful Lorenz Attractor in Python. The Lorenz Attractor is probably the most ilustrative example of a...
DJCordhose/ai
notebooks/tf2/nn-model.ipynb
mit
!pip install -q tf-nightly-gpu-2.0-preview import tensorflow as tf print(tf.__version__) import matplotlib.pyplot as plt import pandas as pd import tensorflow as tf import numpy as np from tensorflow import keras !curl -O https://raw.githubusercontent.com/DJCordhose/deep-learning-crash-course-notebooks/master/data/i...
pfschus/fission_bicorrelation
methods/nn_sum_and_br_subtraction.ipynb
mit
import os import sys import matplotlib.pyplot as plt import matplotlib.colors import numpy as np import os import scipy.io as sio import sys import pandas as pd from tqdm import * # Plot entire array np.set_printoptions(threshold=np.nan) import seaborn as sns sns.set_style(style='white') sys.path.append('../scripts/...
OSGeoLabBp/tutorials
english/data_processing/lessons/rtklib_python.ipynb
cc0-1.0
!git clone https://github.com/rtklibexplorer/RTKLIB.git """ Explanation: <a href="https://colab.research.google.com/github/OSGeoLabBp/tutorials/blob/master/english/data_processing/lessons/rtklib_python.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>...
jhamman/xray
examples/xarray_multidimensional_coords.ipynb
apache-2.0
%matplotlib inline import numpy as np import pandas as pd import xarray as xr import cartopy.crs as ccrs from matplotlib import pyplot as plt print("numpy version : ", np.__version__) print("pandas version : ", pd.__version__) print("xarray version : ", xr.__version__) """ Explanation: <h1>Table of Contents<span c...
AllenDowney/ModSimPy
soln/kitten_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 functions from the modsim.py module from modsim import * """ Explanation: Modeling and Simulati...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/deep-learning/tensor-flow-exercises/3_regularization.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. import cPickle as pickle import numpy as np import tensorflow as tf """ Explanation: Deep Learning with TensorFlow Credits: Forked from TensorFlow by Google Setup Refer to the setup instructions. Exercise 3 Pre...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-2/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-2', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-2 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radi...
florianwittkamp/FD_ACOUSTIC
JupyterNotebook/1D/FD_1D_DX8_DT2.ipynb
gpl-3.0
%matplotlib inline import numpy as np import time as tm import matplotlib.pyplot as plt """ Explanation: FD_1D_DX8_DT2 1-D acoustic Finite-Difference modelling GNU General Public License v3.0 Author: Florian Wittkamp Finite-Difference acoustic seismic wave simulation Discretization of the first-order acoustic wave equ...
IBMStreams/streamsx.health
samples/HealthcareJupyterDemo/notebooks/HealthcareDemo-Distributed.ipynb
apache-2.0
from icpd_core import icpd_util from streamsx.topology.context import JobConfig from streamsx.topology import context streams_instance_name = ## Change this to Streams instance try: cfg=icpd_util.get_service_instance_details(name=streams_instance_name, instance_type="streams") except TypeError: cfg=icpd_util...
mne-tools/mne-tools.github.io
0.19/_downloads/1d463c137037878e3b256b9dc4ee82d3/plot_visualize_evoked.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt import mne """ 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.join(data_path, 'MEG', 'sample', 'sample_a...
italoPontes/Machine-learning
Tarefas/Predicao-de-CRA-com-Regressao/.ipynb_checkpoints/Ridge and LASSO Regression-checkpoint.ipynb
lgpl-3.0
features.applymap(np.isreal).apply(pd.value_counts) """ Explanation: 1. Data preprocessing Checking for missing values in data To search for missing values we first apply a function that checks if each value of our data frame is a real number and return true for those who are and false otherwise. In a second moment, w...
vanheck/blog-notes
Analyzes/Volatile movements/02 Volatile movements in python and pandas 2.ipynb
mit
import sys import pandas as pd import pandas_datareader as pdr import pandas_datareader.data as web import matplotlib import seaborn as sns import datetime print('Python', sys.version) print('Pandas', pd.__version__) print('Pandas-datareader', pdr.__version__) print('Matplotlib', matplotlib.__version__) print('Seabor...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-3 Sub-Topics: Radiative Forcings. Properties: 85 (42 ...
nick-youngblut/SIPSim
ipynb/bac_genome/n1147/.ipynb_checkpoints/atomIncorp_taxaIncorp_MW-HR-SIP_preSparsity-checkpoint.ipynb
mit
import os import glob import itertools import nestly %load_ext rpy2.ipython %load_ext pushnote %%R library(ggplot2) library(dplyr) library(tidyr) library(gridExtra) """ Explanation: Goal Follow-up to: atomIncorp_taxaIncorp Determining the effect of 'heavy' BD window (number of windows & window sizes) on HR-SIP accu...
setiQuest/ML4SETI
tutorials/Step_5d_Build_CNN_Tf_DSX.ipynb
apache-2.0
import requests import json #import ibmseti import numpy as np import matplotlib.pyplot as plt %matplotlib inline import tensorflow as tf import pickle import time #!sudo pip install sklearn import os from sklearn.metrics import confusion_matrix from sklearn import metrics """ Explanation: <a href="https://www.cogniti...
Kidel/In-Codice-Ratio-OCR-with-CNN
Notebooks/04_Mnist-Ensemble.ipynb
apache-2.0
import os.path from IPython.display import Image from util import Util u = Util() import numpy as np # Explicit random seed for reproducibility np.random.seed(1337) from keras.callbacks import ModelCheckpoint from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from kera...
Upward-Spiral-Science/team1
other/Descriptive and Exploratory_oldversion.ipynb
apache-2.0
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt %matplotlib inline import numpy as np import urllib2 def check_condition(row): if row[-1] == 0: return False return True url = ('https://raw.githubusercontent.com/Upward-Spiral-Science' '/data/master/syn-density/output.csv...
Intel-Corporation/tensorflow
tensorflow/lite/g3doc/tutorials/model_maker_question_answer.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...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-3/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Trace...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_ml/ml_cc_machine_learning_problems2.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 2A.ml - Boosting, random forest, gradient - les features qu'ils aiment Avantages et inconvénients des méthodes à gradient. Exercice sur la rotation de features avant l'utilisation d'une random forest. End of explanation """ from pyquick...
WNoxchi/Kaukasos
pytorch/nn_practice.ipynb
mit
import torch # PyTorch base from torch.autograd import Variable # Tensor class w gradients import torch.nn as nn # modules, layers, loss fns import torch.nn.functional as F # Conv,Pool,Loss,Actvn,Nrmlz fns from here class Net(nn.Module): def __init__(self): super(Net, self).__init__() # 1 inpu...
sailuh/perceive
Parsers/SecLists/Index-Parse.ipynb
gpl-2.0
import requests from bs4 import BeautifulSoup from IPython.display import Pretty import pprint pp = pprint.PrettyPrinter(indent=4) url = 'http://seclists.org/fulldisclosure/2017/Jan' r = requests.get(url) raw = r.text Pretty(raw) """ Explanation: SecLists Index parsing Example: http://seclists.org/fulldisclosure/...
tpin3694/tpin3694.github.io
statistics/t-tests.ipynb
mit
from scipy import stats import numpy as np """ Explanation: Title: T-Tests Slug: t-tests Summary: T-tests in Python. Date: 2016-02-08 12:00 Category: Statistics Tags: Basics Authors: Chris Albon Preliminaries End of explanation """ # Create a list of 20 observations drawn from a random distribution # with mean ...
jdossgollin/CWC_ANN
Week03/Time Series_example_Water Pollution_LSTM.ipynb
mit
# The data set has the date separated into three columns - we want to reformat the date to set it as our index from datetime import datetime def parse(x): return datetime.strptime(x, '%Y %m %d %H') dataset = read_csv('./raw.csv', parse_dates = [['year', 'month', 'day', 'hour']], index_col=0, date_parser=parse) da...
parrt/msan692
notes/text.ipynb
mit
! head data/IntroIstanbul.txt """ Explanation: Intro to information extraction from text TODO: spacy.io for text processing. does parts of speech even. Merge with some of the content in html->text lecture. strip punct you dummy. Most of the data we've looked at so far has been structured, meaning essentially that the ...
tensorflow/docs-l10n
site/ja/tutorials/interpretability/integrated_gradients.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...
cscottwatson/end_of_day_two
DefensiveProgramming_3.ipynb
gpl-2.0
def test_range_overlap(): assert range_overlap([(-3.0, 5.0), (0.0, 4.5), (-1.5, 2.0)]) == (0.0, 2.0) assert range_overlap([ (2.0, 3.0), (2.0, 4.0) ]) == (2.0, 3.0) assert range_overlap([ (0.0, 1.0), (0.0, 2.0), (-1.0, 1.0) ]) == (0.0, 1.0) """ Explanation: # Defensive programming (2) We have seen the ba...
radhikapc/foundation-homework
homework05/Homework05_NYTimes-radhika.ipynb
mit
#What books topped the Hardcover Fiction NYT best-sellers list on Mother's Day in 2009 and 2010? How about Father's Day? #mothers day in 2010 book_result = data['results'] #print(book_result) print("The hardcover Fiction NYT best-sellers on mothers day in 2010 are:") for i in book_result: #print(i['book_details'...
jphall663/GWU_data_mining
02_analytical_data_prep/src/py_part_2_feature_extraction.ipynb
apache-2.0
import pandas as pd # pandas for handling mixed data sets import numpy as np # numpy for basic math and matrix operations import matplotlib.pyplot as plt # pyplot for plotting # scikit-learn for machine learning and data preprocessing from sklearn.decomposition import PCA """ Explanation:...
brainiak/brainiak
examples/reconstruct/iem2d_example.ipynb
apache-2.0
# Load the fMRI data data = scipy.io.loadmat('AL61_Bilat-V1_attnContrast.mat') trn_conds = data['trn_conds'] # position in space for 128 trials # flip to cartesian coordinates to make life easier trn_conds[:,1] = trn_conds[:,1]*-1 trn = data['trn'] # matrix of (trials, voxels) """ Explanation: In this example, we wi...
neuro-data-science/neuro_data_science
python/modeling/latent_variables_and_dim_reduction.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = (12, 9) plt.rcParams["font.size"] = 20 import numpy as np from sklearn.decomposition import PCA, FactorAnalysis """ Explanation: NOTE: the final analyses don't appear to be correct. Need to debug. Latent Factor in Neural data Original...
ireapps/cfj-2017
completed/13. Web scraping (Part 3).ipynb
mit
import requests from bs4 import BeautifulSoup """ Explanation: Let's scrape the IRE homepage Our goal: Print out the headlines from the IRE home page. requests is a handy third-party library for making HTTP requests. It does the same thing your browser does when you type in a URL and hit enter -- sends a message to a ...