repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
squishbug/DataScienceProgramming
03-NumPy-and-Linear-Algebra/Introduction_class.ipynb
cc0-1.0
%matplotlib inline import math import numpy as np import matplotlib.pyplot as plt ##import seaborn as sbn ##from scipy import * """ Explanation: Introduction to NumPy Topics Basic Synatx creating vectors matrices special: ones, zeros, identity eye add, product, inverse Mechanics: indexing, slicing, concatenating, r...
zzsza/TIL
Tensorflow-Extended/TFDV(data validation) example.ipynb
mit
from __future__ import print_function import sys, os import tempfile, urllib, zipfile # Confirm that we're using Python 2 assert sys.version_info.major is 2, 'Oops, not running Python 2' # Set up some globals for our file paths BASE_DIR = tempfile.mkdtemp() DATA_DIR = os.path.join(BASE_DIR, 'data') OUTPUT_DIR = os.pat...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_brainstorm_auditory.ipynb
bsd-3-clause
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: BSD (3-clause) import os.path as op import pandas as pd import numpy as np import mne from mne import combine_evoked from mne.minimum_norm impor...
maxhutch/thesis-notebooks
Vorticity.ipynb
gpl-3.0
%matplotlib inline import matplotlib matplotlib.rcParams['figure.figsize'] = (10.0, 16.0) import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import interp1d, InterpolatedUnivariateSpline from scipy.optimize import bisect import json from functools import partial class Foo: pass """ Explanation: ...
otavio-r-filho/AIND-Deep_Learning_Notebooks
sentiment-rnn/Sentiment_RNN_Solution.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
WaylonWalker/pyDataVizDay
notebooks/Explore Movie Dataset.ipynb
mit
import os import pandas as pd import settings import etl %matplotlib inline %load_ext watermark %watermark -d -t -v -m -p pea,pandas data = etl.Data() data.load() """ Explanation: Explore Movie Dataset End of explanation """ data.movie.columns """ Explanation: Available Columns End of explanation """ data.movi...
jphall663/GWU_data_mining
02_analytical_data_prep/src/py_part_2_impute.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 """ Explanation: License Copyright (C) 2017 J. Patrick Hall, jphall@gwu.edu Permission is hereby granted, free of charge, to any person obtaining a copy of this softwar...
xtr33me/deep-learning
gan_mnist/Intro_to_GANs_Solution.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
d-li14/CS231n-Assignments
assignment2/Dropout.ipynb
gpl-3.0
# As usual, a bit of setup from __future__ import print_function import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solv...
robertchase/rhc
mock.ipynb
mit
import sys sys.path.append('/opt/rhc') import rhc.micro as micro import rhc.async as async import logging logging.basicConfig(level=logging.DEBUG) """ Explanation: Defining mock connections Start with some setup. End of explanation """ p=micro.load_connection([ 'CONNECTION placeholder http://jsonplaceholder.ty...
woters/ds101
1-pandas.ipynb
mit
import pandas as pd print("Pandas version: {}".format(pd.__version__)) # опции отображения pd.options.display.max_rows = 6 pd.options.display.max_columns = 6 pd.options.display.width = 100 """ Explanation: 1 - Введение в Pandas Pandas это очень мощная библиотека с множеством полезных функций, ею можно пользаться мног...
thehackerwithin/berkeley
code_examples/spring17_survey/survey.ipynb
bsd-3-clause
import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: The Hacker Within Spring 2017 survey by R. Stuart Geiger, freely licensed CC-BY 4.0, MIT license Importing and processing data Importing libraries End of explanation """ df = pd.read_csv("survey.tsv",sep="\t") df[0:4] """ Explan...
relopezbriega/mi-python-blog
content/notebooks/MyPy-Python-Tipado-estatico.ipynb
gpl-2.0
def saludo(nombre): return 'Hola {}'.format(nombre) """ Explanation: MyPy - Python y un sistema de tipado estático Esta notebook fue creada originalmente como un blog post por Raúl E. López Briega en Mi blog sobre Python. El contenido esta bajo la licencia BSD. Una de las razones por la que solemos amar a Python, ...
benwaugh/NuffieldProject2016
notebooks/InvariantMassCalcExample.ipynb
mit
from ROOT import TLorentzVector """ Explanation: How to calculate the invariant mass of a pair of particles We will use the TLorentzVector class from ROOT, which has useful functions for converting coordinates, adding together four-momenta, and calculating the invariant mass. End of explanation """ pt1 = 25.0 eta1 =...
nmih/ssbio
docs/notebooks/SeqProp - Protein Sequence Properties.ipynb
mit
import sys import logging import os.path as op # Import the SeqProp class from ssbio.protein.sequence.seqprop import SeqProp # Printing multiple outputs per cell from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" """ Explanation: SeqProp - Protein Sequence Prop...
davidrpugh/pyAM
examples/negative-assortative-matching.ipynb
mit
# define some workers skill x, loc1, mu1, sigma1 = sym.var('x, loc1, mu1, sigma1') skill_cdf = 0.5 + 0.5 * sym.erf((sym.log(x - loc1) - mu1) / sym.sqrt(2 * sigma1**2)) skill_params = {'loc1': 1e0, 'mu1': 0.0, 'sigma1': 1.0} workers = pyam.Input(var=x, cdf=skill_cdf, params=ski...
intel-analytics/analytics-zoo
apps/dogs-vs-cats/transfer-learning.ipynb
apache-2.0
import re from bigdl.nn.criterion import CrossEntropyCriterion from pyspark.ml import Pipeline from pyspark.sql.functions import col, udf from pyspark.sql.types import DoubleType, StringType from zoo.common.nncontext import * from zoo.feature.image import * from zoo.pipeline.api.keras.layers import Dense, Input, Flat...
mzszym/oedes
examples/light-emitting/doping-dynamics-orgel12.ipynb
agpl-3.0
%matplotlib inline from matplotlib import colors import matplotlib.pylab as plt from oedes.fvm import mesh1d from oedes import context,init_notebook,testing,models import numpy as np from oedes.functions import Aux2 init_notebook() """ Explanation: Transient simulation of organic light emitting electrochemical cell ...
jburos/survivalstan
example-notebooks/Test pem_survival_model_timevarying with simulated data.ipynb
apache-2.0
survivalstan.utils.print_stan_summary([testfit], pars='lp__') survivalstan.utils.plot_stan_summary([testfit], pars='log_baseline') """ Explanation: superficial check of convergence End of explanation """ survivalstan.utils.plot_coefs([testfit], element='baseline') survivalstan.utils.plot_coefs([testfit]) """ Expl...
google/applied-machine-learning-intensive
content/00_prerequisites/01_intermediate_python/02-lambdas.ipynb
apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
specdb/specdb
docs/nb/Query_Meta.ipynb
gpl-3.0
# imports from astropy import units as u from astropy.coordinates import SkyCoord import specdb from specdb.specdb import SpecDB from specdb import specdb as spdb_spdb from specdb.cat_utils import flags_to_groups """ Explanation: Query Meta data in database Groups [v1.1] End of explanation """ db_file = specdb.__pa...
JJINDAHOUSE/deep-learning
embeddings/Skip-Gram_word2vec.ipynb
mit
import time import numpy as np import tensorflow as tf import utils """ Explanation: Skip-gram word2vec In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p...
Phylliade/poppy-inverse-kinematics
tutorials/Hand follow.ipynb
gpl-2.0
import time import numpy as np from pypot.creatures import PoppyTorso """ Explanation: Hand Following example In this notebook, you will use Pypot and an Inverse Kinematics toolbox to make Torso's hands follow each other. Your Torso has two arms, and you can use simple methods to get and set the position of each hand....
kfollette/AST337-Fall2017
Labs/Lab6/Unix_Programming_Refresher.ipynb
mit
ls pwd cd 2017oct04 """ Explanation: Appendix 1: Optional Refresher on the Unix Environment A1.1) A Quick Unix Overview In Jupyter, many of the same Unix commands we use to navigate in the regular terminal can be used. (However, this is not true when we write standalone code outside Jupyter.) As a quick refresher,...
jdhp-docs/python_notebooks
nb_misc/misc_read_ca_csv_fr.ipynb
mit
%matplotlib inline #%matplotlib notebook from IPython.display import display import matplotlib matplotlib.rcParams['figure.figsize'] = (9, 9) import pandas as pd import numpy as np !head -n30 /Users/jdecock/Downloads/CA20170725_1744.CSV #df = pd.read_csv("/Users/jdecock/Downloads/CA20170725_1744.CSV") df = pd.rea...
ceos-seo/data_cube_notebooks
notebooks/animation/3D/GA_Water_3D_Reservoir/GA_Water_3DReservoir.ipynb
apache-2.0
import sys import os sys.path.append(os.environ.get('NOTEBOOK_ROOT')) # Supress Warning import warnings warnings.filterwarnings('ignore') import datacube import glob import rasterio import scipy import xarray as xr import numpy as np import pandas as pd import geopandas as gpd from skimage import filters from skimage...
hunterherrin/phys202-2015-work
assignments/assignment06/DisplayEx01.ipynb
mit
from IPython.display import Image from IPython.display import HTML from IPython.display import display assert True # leave this to grade the import statements """ Explanation: Display Exercise 1 Imports Put any needed imports needed to display rich output the following cell: End of explanation """ Image(url='http:/...
karst87/ml
01_openlibs/tensorflow/01_examples/0_prerequisite/mnist_dataset_intro.ipynb
mit
# 导入MNIST from tensorflow.examples.tutorials.mnist import input_data # 加载数据 X_train = mnist.train.images Y_train = mnist.train.labels X_test = mnist.test.images Y_test = mnist.test.labels print(X_train.shape) print(Y_train.shape) print(X_test.shape) print(Y_test.shape) """ Explanation: MNIST数据集介绍 大多数例子使用了手写数字的MNIST数...
Radiomics/pyradiomics
notebooks/helloFeatureClass.ipynb
bsd-3-clause
from __future__ import print_function import os import collections import SimpleITK as sitk import numpy import six import radiomics from radiomics import firstorder, glcm, imageoperations, shape, glrlm, glszm """ Explanation: Hello Feature Class example: using the feature classes to calculate features This example sh...
wanderer2/pymc3
docs/source/notebooks/stochastic_volatility.ipynb
apache-2.0
import numpy as np import pymc3 as pm from pymc3.distributions.timeseries import GaussianRandomWalk from scipy import optimize %pylab inline """ Explanation: Stochastic Volatility model End of explanation """ n = 400 returns = np.genfromtxt("../data/SP500.csv")[-n:] returns[:5] plt.plot(returns) """ Explanation:...
gtzan/mir_book
data_mining_random_variables.ipynb
cc0-1.0
%matplotlib inline import matplotlib.pyplot as plt from scipy import stats import numpy as np class Random_Variable: def __init__(self, name, values, probability_distribution): self.name = name self.values = values self.probability_distribution = probability_distribution ...
jsvine/spectra
docs/walkthrough.ipynb
mit
import spectra """ Explanation: Spectra Walkthrough This notebook provides basic documentation of the spectra Python library, which aims to simplify the process of creating color scales and converting colors from one "color space" to another. End of explanation """ from IPython.display import HTML swatch_template =...
tpin3694/tpin3694.github.io
machine-learning/bernoulli_naive_bayes_classifier.ipynb
mit
# Load libraries import numpy as np from sklearn.naive_bayes import BernoulliNB """ Explanation: Title: Bernoulli Naive Bayes Classifier Slug: bernoulli_naive_bayes_classifier Summary: How to train a Bernoulli naive bayes classifer in Scikit-Learn Date: 2017-09-22 12:00 Category: Machine Learning Tags: Naive Bayes...
mikekestemont/lot2016
Chapter 1 - Variables.ipynb
mit
print("Mike") """ Explanation: Chapter 1: Variables -- A Python Course for the Humanities by Folgert Karsdorp and Maarten van Gompel, with modifications by Mike Kestemont and Lars Wieneke First steps Everyone can learn how to program and the best way to learn it is by doing it. This tutorial on the Python programming...
dereneaton/ipyrad
tests/quickguide_API.ipynb
gpl-3.0
import ipyrad as ip """ Explanation: Quick guide to the ipyrad API Getting Started Welcome! This tutorial will introduce you to the basics of working with ipyrad to assemble RADseq data. Note: this tutorial was created in a Jupyter Notebook and assumes that you’re following-along in a notebook of your own. If you inst...
rastala/mmlspark
notebooks/samples/101 - Adult Census Income Training.ipynb
mit
import numpy as np import pandas as pd import mmlspark # help(mmlspark) """ Explanation: 101 - Training and Evaluating Classifiers with mmlspark In this example, we try to predict incomes from the Adult Census dataset. First, we import the packages (use help(mmlspark) to view contents), End of explanation """ dataF...
tpin3694/tpin3694.github.io
python/pandas_create_column_with_loop.ipynb
mit
import pandas as pd import numpy as np """ Explanation: Title: Create A Pandas Column With A For Loop Slug: pandas_create_column_with_loop Summary: Create A Pandas Column With A For Loop Date: 2016-05-01 12:00 Category: Python Tags: Data Wrangling Authors: Chris Albon Preliminaries End of explanation """ raw_data ...
ucsd-ccbb/jupyter-genomics
notebooks/networkAnalysis/network_differential_expression_viz/network_differential_expression_viz.ipynb
mit
# import some useful packages import numpy as np import pandas as pd import networkx as nx import matplotlib.pyplot as plt % matplotlib inline """ Explanation: Visualize and analyze differential expression data in a network In analysis of differential expression data, it is often useful to analyze properties of the ...
GoogleCloudPlatform/professional-services
examples/kubeflow-fairing-example/Fairing_XGBoost.ipynb
apache-2.0
import argparse import logging import joblib import sys import pandas as pd from sklearn.metrics import roc_auc_score from sklearn.model_selection import train_test_split from sklearn.impute import SimpleImputer from xgboost import XGBClassifier logging.basicConfig(format='%(message)s') logging.getLogger().setLevel(lo...
flyinactor91/Find-Me
FindMe.ipynb
mit
import cv2 import numpy as np CASCADE = cv2.CascadeClassifier('findme/haar_cc_front_face.xml') def find_faces(img: np.ndarray, sf=1.16, mn=5) -> np.array([[int]]): """Returns a list of bounding boxes for every face found in an image""" return CASCADE.detectMultiScale( cv2.cvtColor(img, cv2.COLOR_RGB2G...
ThunderShiviah/code_guild
wk3/notebooks/wk3.0.ipynb
mit
def turn_clockwise(direction): compass = {"N":"E" , "E": "S", "S":"W", "W":"N"} return compass[direction] assert turn_clockwise("N") == "E" assert turn_clockwise("W") == "N" turn_clockwise("N") """ Explanation: wk3.0 Warm-up The four compass points can be abbreviated by single-letter strings as “N”, “E”, “S...
mdeff/ntds_2017
projects/reports/course_suggester/Weighting Metrics and Graph Diffusion.ipynb
mit
%matplotlib inline import os import pandas as pd import numpy as np import pickle from pygsp import graphs, filters, plotting from scipy.spatial import distance import matplotlib.pyplot as plt import itertools from tqdm import tqdm plt.rcParams['figure.figsize'] = (17, 5) plotting.BACKEND = 'matplotlib' do_prints = Fa...
DS-100/sp17-materials
sp17/hw/hw2/hw2_solution.ipynb
gpl-3.0
import math import numpy as np import matplotlib %matplotlib inline import matplotlib.pyplot as plt !pip install -U okpy from client.api.notebook import Notebook ok = Notebook('hw2.ok') """ Explanation: Homework 2: Language in the 2016 Presidential Election Popular figures often have help managing their media presenc...
TurkuNLP/BINF_Programming
lectures/week-5-sequence-alignment.ipynb
gpl-2.0
from Bio import pairwise2 ## load the module ## globalxx ## use global alignment function which only score 1 ## for each match (0 for both penalty and mismatch) alignments = pairwise2.align.globalxx("ACCGT", "ACG") ## perform global alignments (xx) between two sequences. for alignment in alignments: ## Each ...
ledeprogram/algorithms
class6/donow/ronga_paul_DoNow_6.ipynb
gpl-3.0
import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import statsmodels.formula.api as smf """ Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model End of explanation """ df = pd.read_csv('../data/hanford.csv') df.head() """ Explanation: 2. ...
ForestClaw/forestclaw
applications/clawpack/transport/2d/sonic/swirl.ipynb
bsd-2-clause
!swirlcons --user:example=2 --user:rp-solver=4 """ Explanation: Advection (conservative form) Scalar advection problem in conservative form with variable velocity field. There are four Riemann solvers that can be tried out here, all described in LeVeque (Cambridge Press, 2002) rp-solver=1 : Q-star approach in whic...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch8-Problem_8-10to11.ipynb
unlicense
%pylab notebook %precision %.4g """ Explanation: Excercises Electric Machinery Fundamentals Chapter 8 Problem 8-10 to Problem 8-11 End of explanation """ P_rated = 30 # [hp] Il_rated = 110 # [A] Vt = 240 # [V] Nf = 2700 n_0 = 1800 # [r/min] Nse = 14 Ra = 0.19 # [Ohm] Rf = 75...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/tsa_arma_1.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd from statsmodels.graphics.tsaplots import plot_predict from statsmodels.tsa.arima_process import arma_generate_sample from statsmodels.tsa.arima.model import ARIMA np.random.seed(12345) """ Explanation: Autoregressive Moving Average (ARMA): Artificial data E...
jmhsi/justin_tinker
data_science/lendingclub_bak/dataprep_and_modeling/0.2.0_RF_regressor_no_weighting.ipynb
apache-2.0
platform = 'lendingclub' store = pd.HDFStore( '/Users/justinhsi/justin_tinkering/data_science/lendingclub/{0}_store.h5'. format(platform), append=True) loan_info = store['train_filtered_columns'] columns = loan_info.columns.values # checking dtypes to see which columns need one hotting, and which need nul...
SlipknotTN/udacity-deeplearning-nanodegree
reinforcement/Q-learning-cart.ipynb
mit
import gym import tensorflow as tf import numpy as np """ Explanation: Deep Q-learning In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p...
hadrianpaulo/project_deathstar
analytics/Classification_cycle_1.ipynb
mit
df_train = pd.DataFrame() # MNCHN df_train['body'] = df_mnchn['body'].append(df_mnchn['Final Keywords']) df_train['label'] = 1 # Adolescent df_train = df_train.append(pd.DataFrame({ 'body': df_adolescent['body'].append(df_adolescent['Final Keywords']), 'label': 2 })) # Geriatrics df_train = df_train.append(pd.D...
projectmesa/mesa-examples
examples/PD_Grid/Demographic Prisoner's Dilemma Activation Schedule.ipynb
apache-2.0
from pd_grid import PD_Model import random import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec %matplotlib inline """ Explanation: Demographic Prisoner's Dilemma The Demographic Prisoner's Dilemma is a family of variants on the classic two-player Prisoner's Dilemma, first developed by Joshu...
ES-DOC/esdoc-jupyterhub
notebooks/hammoz-consortium/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: HAMMOZ-CONSORTIUM Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Top...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session11/Day1/InvestigatingDetectors.ipynb
mit
from astropy.io import fits import numpy as np import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['figure.dpi'] = 120 """ Explanation: Investigating Detectors Version 0.1 Understanding the behavior of the CCDs in a camera requires digging deep into calibration exposures. That is where you can unco...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session11/Day3/GalaxyPhotometryAndShapes.ipynb
mit
# Load the packages we will use import numpy as np import astropy.io.fits as pf import astropy.coordinates as co from matplotlib import pyplot as pl import scipy.fft as fft %matplotlib inline """ Explanation: Practice with galaxy photometry and shape measurement To accompany galaxy-measurement lecture from the LSSTC D...
liganega/Gongsu-DataSci
ref_materials/exams/2015/midterm.ipynb
gpl-3.0
def interval_point(a, b, x): if a < b: return (b-a)*x + a else: return a - (a-b)*x """ Explanation: 2015년 2학기 공업수학 중간고사 시험지 이름: 학번: 시험지 작성 요령 예제코드를 보면서 문제의 내용을 이해하도록 노력한다. 문제별로 '해야 할 일' 에서 요구하는 방향으로 변경된 코드의 빈자리를 채우거나 답을 한다. 문제 1 세 개의 숫자를 입력받는 함수 interval_point는 아래 기능을 구현한다. 숫자 a와 b는 구간의 처음과 ...
Rantanen/igraph
examples/ipython.ipynb
mit
import igraph igraph.draw([(1, 2), (2, 3), (3, 4), (4, 1), (4, 5), (5, 2)]) """ Explanation: igraph in the IPython notebook I wrote igraph to visualize graphs in 3D purely out of curiosity. I couldn't find any 3D force-directed graph libraries when I wrote it, so this happened. It can be used with the notebook to inte...
ucsd-ccbb/mali-dual-crispr-pipeline
dual_crispr/distributed_files/notebooks/Dual CRISPR 5-Count Plots.ipynb
mit
g_dataset_name = "Notebook5Test" g_fastq_counts_run_prefix = "TestSet5" g_fastq_counts_dir = '~/dual_crispr/test_data/test_set_5' g_collapsed_counts_run_prefix = "" g_collapsed_counts_dir = "" g_combined_counts_run_prefix = "" g_combined_counts_dir = "" g_plots_run_prefix = "" g_plots_dir = '~/dual_crispr/test_outputs/...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/mnist/04_Reusable_and_Pre-build_Components_as_Pipeline.ipynb
apache-2.0
import kfp import kfp.gcp as gcp import kfp.dsl as dsl import kfp.compiler as compiler import kfp.components as comp import datetime import kubernetes as k8s # Required Parameters PROJECT_ID='<ADD GCP PROJECT HERE>' GCS_BUCKET='gs://<ADD STORAGE LOCATION HERE>' """ Explanation: Composing a pipeline from reusable, pr...
spacy-io/thinc
examples/02_transformers_tagger_bert.ipynb
mit
!pip install "thinc>=8.0.0a0" transformers torch "ml_datasets>=0.2.0a0" "tqdm>=4.41" """ Explanation: Training a part-of-speech tagger with transformers (BERT) This example shows how to use Thinc and Hugging Face's transformers library to implement and train a part-of-speech tagger on the Universal Dependencies AnCora...
pradau/udacity
Data_Analyst_ND_Project0.ipynb
bsd-2-clause
import pandas as pd # pandas is a software library for data manipulation and analysis # We commonly use shorter nicknames for certain packages. Pandas is often abbreviated to pd. # hit shift + enter to run this cell or block of code path = r'/Users/pradau/Dropbox/temp/Downloads/chopstick-effectiveness.csv' # Change t...
data-cube/agdc-v2-examples
notebooks/02_loading_data.ipynb
apache-2.0
import datacube dc = datacube.Datacube(app='load-data-example') """ Explanation: Loading data from the datacube This notebook will briefly discuss how to load data from the datacube. Importing the datacube To start with, we'll import the datacube module and load an instance of the datacube and call our application nam...
ireapps/pycar
completed/read_csv_notebook_complete.ipynb
mit
from urllib.request import urlretrieve import csv """ Explanation: Read a CSV We're going to use built-in Python modules - programs really - to download a csv file from the Internet and save it locally. CSV stands for comma-separated values. It's a common file format a file format that resembles a spreadsheet or datab...
Yangqing/caffe2
caffe2/python/tutorials/Control_Ops.ipynb
apache-2.0
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import workspace from caffe2.python.core import Plan, to_execution_step, Net from caffe2.python.net_builder import ops, NetBuilder """ Explanation: Co...
BrandonSmithJ/tensorflow-double-DQN
Double-DQN/tensorflow-deepq/notebooks/.ipynb_checkpoints/karpathy_game-checkpoint.ipynb
mit
g.plot_reward(smoothing=100) """ Explanation: Average Reward over time End of explanation """ g.__class__ = KarpathyGame np.set_printoptions(formatter={'float': (lambda x: '%.2f' % (x,))}) x = g.observe() new_shape = (x[:-2].shape[0]//g.eye_observation_size, g.eye_observation_size) print(x[:-2].reshape(new_shape)) p...
treasure-data/pandas-td
doc/magic.ipynb
apache-2.0
%load_ext pandas_td.ipython """ Explanation: Magic functions You can enable magic functions by loading pandas_td.ipython: End of explanation """ c = get_config() c.InteractiveShellApp.extensions = [ 'pandas_td.ipython', ] """ Explanation: It can be loaded automatically by the following configuration in "~/.ipy...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/day-by-day/day02-modeling-cold-spread/Day 2 pre-class assignment.ipynb
agpl-3.0
# The command below this comment imports the functionality that we need to display # YouTube videos in a Jupyter Notebook. You need to run this cell before you # run ANY of the YouTube videos. from IPython.display import YouTubeVideo """ Explanation: Day 2 pre-class assignment Goals for today's pre-class assignment...
bradhowes/keystrokecountdown
src/articles/poisson/index.ipynb
mit
N = 10000.0 T = 2.0 lmbda = N / T / 60 / 60 lmbda """ Explanation: Introduction We wish to simulate a stochastic process where there are N users of our application that we contend will use our app within a 2 hour time period. To perform the simulation, we would like to have our users attempt to use the application at ...
TheOregonian/articles
air_quality/air_quality.ipynb
mit
df_list = pd.read_html( 'https://en.wikipedia.org/wiki/Air_quality_index', header=0) aqi_df = df_list[14].drop(0) aqi_df[['min','max']] = aqi_df['AQI'].str.split('-', 1, expand=True) aqi_df.columns aqi_df.rename(columns={'O3 (ppb).1': 'O3 (ppb) 1 hour', 'AQI.1': 'Category'}, inplace=True) # The final value for...
UCSBarchlab/PyRTL
ipynb-examples/example6-memory.ipynb
bsd-3-clause
import random import pyrtl from pyrtl import * pyrtl.reset_working_block() """ Explanation: Example 6: Memories in PyRTL One important part of many circuits is the ability to have data in locations that are persistent over clock cycles. In previous examples, we have shown the register wirevector, which is great for ...
tbarrongh/cosc-learning-labs
src/notebook/03_interface_startup.ipynb
apache-2.0
help('learning_lab.03_interface_startup') """ Explanation: COSC Learning Lab 03_interface_startup.py Related Scripts: * 03_interface_shutdown.py * 03_interface_configuration.py Table of Contents Table of Contents Documentation Implementation Execution HTTP Documentation End of explanation """ from importlib import...
jepegit/cellpy
examples/jupyter notebooks/cellpy_batch_processing.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import cellpy from cellpy import prms from cellpy import prmreader from cellpy.utils import batch %matplotlib inline ## Uncomment this and run for checking your cellpy parameters. # prmreader.info() """ Explanation: Notebook for cellpy batch processing You can fill...
albahnsen/PracticalMachineLearningClass
notebooks/02-IntroPython_Numpy_Scypy_Pandas.ipynb
mit
import sys print('Python version:', sys.version) import IPython print('IPython:', IPython.__version__) import numpy print('numpy:', numpy.__version__) import scipy print('scipy:', scipy.__version__) import matplotlib print('matplotlib:', matplotlib.__version__) import pandas print('pandas:', pandas.__version__) ...
hanleilei/note
training/submit/PythonExercises1stAnd2nd.ipynb
cc0-1.0
planet = "Earth" diameter = 12742 """ Explanation: Python入门 第一周和第二周的练习 练习 回答下列粗体文字所描述的问题,如果需要,使用任何合适的方法,以掌握技能,完成自己想要的程序为目标,不用太在意实现的过程。 7 的四次方是多少? 分割以下字符串 s = "Hi there Sam!" 到一个列表中 提供了一下两个变量 planet = "Earth" diameter = 12742 使用format()函数输出一下字符串 The diameter of Earth is 12742 kilometers. End of explanation ...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/gee_nested_simulation.ipynb
bsd-3-clause
import numpy as np import pandas as pd import statsmodels.api as sm """ Explanation: GEE nested covariance structure simulation study This notebook is a simulation study that illustrates and evaluates the performance of the GEE nested covariance structure. A nested covariance structure is based on a nested sequence of...
QuantCrimAtLeeds/PredictCode
examples/Case Study Chicago South Side/SEPP2.ipynb
artistic-2.0
%matplotlib inline from common import * datadir = os.path.join("//media", "disk", "Data") #datadir = os.path.join("..", "..", "..", "..", "..", "Data") import open_cp.logger open_cp.logger.log_to_true_stdout() south_side, points = load_data(datadir) points.time_range masked_grid = grid_for_south_side() masked_grid2 ...
UWSEDS/LectureNotes
Fall2018/02_Procedural_Python/Lecture-Python-And-Data.ipynb
bsd-2-clause
# Integer arithematic 1 + 1 # Integer division version floating point division print (6 // 4, 6/ 4) """ Explanation: Software Engineering for Data Scientists Manipulating Data with Python DATA 515 A Today's Objectives 0. Cloning LectureNotes 1. Opening & Navigating the Jupyter Notebook 2. Data type basics 3. Loading ...
PublicHealthEngland/pygom
notebooks/Stochasticity.ipynb
gpl-2.0
import pygom import pkg_resources print('PyGOM version %s' %pkg_resources.get_distribution('pygom').version) """ Explanation: Stochastic simulation Examples taken from https://arxiv.org/pdf/1803.06934.pdf (see page 11 for stochastic simulations). Examples are performed on an SIR model. $\frac{dS}{dt} = -\beta S I $ $\...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/miroc-es2h/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'miroc-es2h', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MIROC Source ID: MIROC-ES2H Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Tu...
hail-is/hail
datasets/notebooks/1kg_NYGC_30x_datasets.ipynb
mit
ht_samples = hl.import_table( "gs://hail-datasets-tmp/1000_Genomes_NYGC_30x/1000_Genomes_NYGC_30x_samples_ped_population.txt.bgz", delimiter="\s+", impute=True ) ht_samples = ht_samples.annotate( FatherID = hl.if_else(ht_samples.FatherID == "0", hl.missing(hl.tstr), ...
Diyago/Machine-Learning-scripts
time series regression/DL aproach for timeseries/pytorch_timeseries_RNN.ipynb
apache-2.0
import torch from torch import nn import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.figure(figsize=(8,5)) # how many time steps/data pts are in one batch of data seq_length = 20 # generate evenly spaced data pts time_steps = np.linspace(0, np.pi, seq_length + 1) data = np.sin(time_steps) data...
roatienza/Deep-Learning-Experiments
versions/2022/tools/python/np_demo.ipynb
mit
import numpy as np import matplotlib.pyplot as plt """ Explanation: Demonstration of numpy for data synthesis and manipulation numpy is a numerical computing library in Python. It supports linear algebra operations that are useful in deep learning. In particular, numpy is useful for data loading, preparation, synthesi...
pyemma/deeplearning
assignment2/FullyConnectedNets.ipynb
gpl-3.0
# As usual, a bit of setup import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solver import Solver %matplotlib inline ...
davisincubator/digblood
notebooks/jfa-1.0-initial_data_exploration.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import pandas as pd import numpy as np data_dir = '../data/raw/' data_filename = 'blood_train.csv' df_blood = pd.read_csv(data_dir+data_filename) df_blood.head() """ Explanation: Predicting Blood Donations: Initial Data Exploration To do: - Import data -...
NeuroDataDesign/pan-synapse
pipeline_1/background/Sort.ipynb
apache-2.0
def newRandomCentroids(n, l, u): diff = u-l return [[random()*diff+l for _ in range(3)] for _ in range(n)] newRandomCentroids(10, 10, 100) """ Explanation: Goal The goal of this notebook is to explore better methods for the final l2 centorid match during registration in the pipeline. Generate Data End of expl...
carthach/essentia
src/examples/tutorial/example_discontinuitydetector.ipynb
agpl-3.0
import essentia.standard as es import numpy as np import matplotlib.pyplot as plt from IPython.display import Audio from essentia import array as esarr plt.rcParams["figure.figsize"] =(12,9) def compute(x, frame_size=1024, hop_size=512, **kwargs): discontinuityDetector = es.DiscontinuityDetector(frameSize=frame_s...
littlewizardLI/Udacity-ML-nanodegrees
Project1-boston_housing/boston_housing.ipynb
apache-2.0
# Import libraries necessary for this project import numpy as np import pandas as pd from sklearn.cross_validation import ShuffleSplit # Import supplementary visualizations code visuals.py import visuals as vs # Pretty display for notebooks %matplotlib inline # Load the Boston housing dataset data = pd.read_csv('hou...
jmhsi/justin_tinker
data_science/courses/deeplearning1/fastai-course-1-pytorch/lesson5-pytorch.ipynb
apache-2.0
from keras.datasets import imdb idx = imdb.get_word_index() """ Explanation: Setup data We're going to look at the IMDB dataset, which contains movie reviews from IMDB, along with their sentiment. Keras comes with some helpers for this dataset. End of explanation """ idx_arr = sorted(idx, key=idx.get) idx_arr[:10] ...
kimkipyo/dss_git_kkp
Python 복습/14일차.금_pandas + SQL_2/14일차_1T_os, shutil 모듈을 이용한 파일,폴더 관리하기 (1) - 폴더 생성 및 제거.ipynb
mit
import os #os 모듈을 통해서 #운영체제 레벨(서버는 ex.우분투)에서 다루는 파일 폴더 생성하고 삭제하기가 가능 #기존에는 ("../../~~") 이런 식으로 경로를 직접 입력 했으나 os.listdir() #현재 폴더 안에 있는 파일들을 리스트로 뽑는 것 os.listdir("../") for csv_file in os.listdir("../"): pass """ Explanation: 1T_os, shutil 모듈을 이용한 파일,폴더 관리하기 (1) - 폴더 생성 및 제거 영화별 매출 - Revenue per Film 이거 어려워. 이거...
ContextLab/quail
docs/tutorial/egg.ipynb
mit
import quail %matplotlib inline """ Explanation: The Egg data object This tutorial will go over the basics of the Egg data object, the essential quail data structure that contains all the data you need to run analyses and plot the results. An egg is made up of two primary pieces of data: pres data - stimuli/feature...
kmunve/APS
Predict_aval_problem_combined.ipynb
mit
import pandas as pd import numpy as np import json import sklearn import matplotlib import matplotlib.pyplot as plt %matplotlib inline import warnings warnings.simplefilter('ignore') print('Pandas:\t', pd.__version__) print('Numpy:\t', np.__version__) print('Scikit Learn:\t', sklearn.__version__) print('Matplotlib:\t...
bigdata-i523/hid335
experiment/Python_SKL_NeuralNetworkClassifier.ipynb
gpl-3.0
display(mglearn.plots.plot_logistic_regression_graph()) """ Explanation: Introduction to Machine Learning Andreas Mueller and Sarah Guido (2017) O'Reilly Ch. 2 Supervised Learning Neural Networks (Deep Learning) MLP feedforward neural network Generalization of linear models for classification and regression Predictio...
mrcslws/nupic.research
projects/archive/dynamic_sparse/notebooks/ExperimentAnalysis-SigOptTest.ipynb
agpl-3.0
%load_ext autoreload %autoreload 2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands import * from nupic.research.frameworks.dynamic...
dogrdon/native_ad_data
analysis/native_ad_analysis.ipynb
gpl-3.0
import pandas as pd from datetime import datetime import dateutil import matplotlib.pyplot as plt from IPython.core.display import display, HTML import re from urllib.parse import urlparse import json """ Explanation: Performing Clean-up and Analysis on Native Ad Data Scraped "From Around the Web" End of explanation "...
dvkonst/ml_mipt
task_5/hw1_Modules.ipynb
gpl-3.0
class Module(object): def __init__ (self): self.output = None self.gradInput = None self.training = True """ Basically, you can think of a module as of a something (black box) which can process `input` data and produce `ouput` data. This is like applying a function which is ...
bbglab/adventofcode
2015/ferran/day12.ipynb
mit
with open('inputs/input12.txt') as f_input: s = next(f_input).rstrip() import re def sum_numbers(s): p = re.compile('[-]?[\d]+') numbers = list(map(int, p.findall(s))) return sum(numbers) sum_numbers(s) """ Explanation: Day 12: JSAbacusFramework.io Day 12.1 End of explanation """ def transform_red...
rayjustinhuang/DataAnalysisandMachineLearning
Logistic Regression.ipynb
mit
# Import necessary libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split, cross_val_score from sklearn import metrics """ Explanation: Predicting Grad School Admiss...
jgoppert/iekf_analysis
Temperature Calibration.ipynb
bsd-3-clause
import sympy sympy.init_printing() Theta = sympy.Matrix(sympy.symbols( 'theta_0:3_0:4')).reshape(3,4) def Y(n): return sympy.Matrix(sympy.symbols( 'G_x:z_0:{:d}'.format(n+1))).T.reshape(3, n+1) def C(n): return sympy.ones(n+1, 1) def T(n): return sympy.Matrix(sympy.symbols('T_0:{:d}'.format(...
jeffcarter-github/MachineLearningLibrary
MachineLearningLibrary/NeuralNetworks/CNN_MNIST_Keras_Tensorflow.ipynb
mit
from __future__ import print_function import matplotlib.pyplot as plt %matplotlib notebook """ Explanation: This notebook walks through training a CNN Model on the MNIST data using Keras and Tensorflow... Load Data and Reshape Build Model Train / Test Build interactive OpenCV GUI for playing import ploting library.....
ioggstream/python-course
connexion-101/notebooks/05-reusing-and-bundling.ipynb
agpl-3.0
# Exercise: creating a bundle from a $ref file # # You can resolve dependencies and create a bundle file with !pip install openapi_resolver # Exercise: create a bundle from the previous file with !python -m openapi_resolver /code/notebooks/oas3/ex-05-01-bundle.yaml """ Explanation: Reusing and bundling Our strategy...