repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
esumitra/minecraft-programming
notebooks/Adventure2.ipynb
mit
from mcpi.minecraft import * import time mc = Minecraft.create() # Type Task 2 program here """ Explanation: Welcome Home Usually when Steve comes home, there is no one at home. Steve can get lonely at times especially after long hard battle with creepers and zombies. In this programming adventure we'll make Minecra...
sjchoi86/Tensorflow-101
notebooks/rnn_mnist_simple.ipynb
mit
import tensorflow as tf import tensorflow.examples.tutorials.mnist.input_data as input_data import numpy as np import matplotlib.pyplot as plt %matplotlib inline print ("Packages imported") mnist = input_data.read_data_sets("data/", one_hot=True) trainimgs, trainlabels, testimgs, testlabels \ = mnist.train.images, m...
rcurrie/tumornormal
pathways.ipynb
apache-2.0
import os import json import numpy as np import pandas as pd import tensorflow as tf import keras import matplotlib.pyplot as plt # fix random seed for reproducibility np.random.seed(42) # See https://github.com/h5py/h5py/issues/712 os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE" """ Explanation: Pathway Classificati...
merryjman/astronomy
Elements.ipynb
gpl-3.0
# Import modules that contain functions we need import pandas as pd import numpy as np %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Elements and the periodic table This data came from Penn State CS professor Doug Hogan. Thanks to UCF undergraduates Sam Borges, for finding the data set, and Lissa...
GoogleCloudPlatform/asl-ml-immersion
notebooks/launching_into_ml/labs/supplemental/intro_logistic_regression.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns %matplotlib inline """ Explanation: Introduction to Logistic Regression Learning Objectives Create Seaborn plots for Exploratory Data Analysis T...
lukemans/Hello-world
t81_558_class3_training.ipynb
apache-2.0
from sklearn import preprocessing import matplotlib.pyplot as plt import numpy as np import pandas as pd # Encode text values to dummy variables(i.e. [1,0,0],[0,1,0],[0,0,1] for red,green,blue) def encode_text_dummy(df,name): dummies = pd.get_dummies(df[name]) for x in dummies.columns: dummy_name = "{}...
feststelltaste/software-analytics
notebooks/Java Type Dependency Analysis.ipynb
gpl-3.0
import py2neo query=""" MATCH (:Project)-[:CONTAINS]->(artifact:Artifact)-[:CONTAINS]->(type:Type) WHERE // we don't want to analyze test artifacts NOT artifact.type = "test-jar" WITH DISTINCT type, artifact MATCH (type)-[:DEPENDS_ON*0..1]->(directDependency:Type)<-[:CONTAINS]-(artifact) RETURN type.f...
vzg100/Post-Translational-Modification-Prediction
old/Phosphorylation Sequence Tests -Bagging -dbptm+ELM-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"] for i in par: print("y", i) y = Predictor() y.load_data(file="Data/Trainin...
DillmannFrench/Intro-PYTHON
Cours13-DILLMANN-ISEP2016.ipynb
gpl-3.0
import pandas from pandas.io.data import DataReader import matplotlib.pyplot as plt %matplotlib inline # Initialisation d'un type dict d = {} """ Explanation: Programation Fonctionnelle Nous allons exploiter la puissance des fonctions offerte par les différentes librairies de Python. L'objectif est de ne pas refaire c...
theandygross/MethylTools
.ipynb_checkpoints/Probe_Annotations-checkpoint.ipynb
apache-2.0
import pandas as pd DATA_STORE = '/data_ssd/methylation_annotation_2.h5' store = pd.HDFStore(DATA_STORE) islands = pd.read_hdf(DATA_STORE, 'islands') locations = pd.read_hdf(DATA_STORE, 'locations') other = pd.read_hdf(DATA_STORE, 'other') snps = pd.read_hdf(DATA_STORE, 'snps') probe_annotations = pd.read_hdf(DATA_ST...
mne-tools/mne-tools.github.io
stable/_downloads/c7633c38a703b9d0a626a5a4fa161026/psf_ctf_label_leakage.ipynb
bsd-3-clause
# Authors: Olaf Hauk <olaf.hauk@mrc-cbu.cam.ac.uk> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Nicolas P. Rougier (graph code borrowed from his matplotlib gallery) # # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as ...
huajianmao/learning
coursera/deep-learning/4.convolutional-neural-networks/week2/pa.1.Keras - Tutorial - Happy House v1.ipynb
mit
import numpy as np from keras import layers from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D from keras.models import Model from keras.preprocessing import im...
lee212/simpleazure
ipynb/Tutorial - Account Setup for Azure Resource Manager (ARM).ipynb
gpl-3.0
!yes|azure login """ Explanation: Azure CLI Account Setup for Azure Resource Manager (ARM) Azure CLI provides an easy way to setup an account for Azure Resource Manager (ARM) and furthermore creates an new service principal for the Simple Azure access. In this tutorial, we use IPython helper (!) to run Azure CLI. Int...
chicagopython/CodingWorkshops
problems/data_science/trackcoder.ipynb
gpl-3.0
import pandas """ Explanation: Data Analysis and visualization for tracking developer productivity Chipy's mentorship program is an extra-ordinary jounery for becoming a better developer. As a mentee, you are expected to do a lot - you read new articles/books, write code, debug and troubleshoot, pair program with othe...
erdewit/ib_insync
notebooks/contract_details.ipynb
bsd-2-clause
from ib_insync import * util.startLoop() import logging # util.logToConsole(logging.DEBUG) ib = IB() ib.connect('127.0.0.1', 7497, clientId=11) """ Explanation: Contract details End of explanation """ amd = Stock('AMD') cds = ib.reqContractDetails(amd) len(cds) """ Explanation: Suppose we want to find the contr...
t-vi/pytorch-tvmisc
misc/2D-Wavelet-Transform.ipynb
mit
import pywt from matplotlib import pyplot %matplotlib inline import numpy from PIL import Image import urllib.request import io import torch URL = 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Zuse-Z4-Totale_deutsches-museum.jpg/315px-Zuse-Z4-Totale_deutsches-museum.jpg' """ Explanation: 2D Wavelet Tran...
msschwartz21/craniumPy
experiments/glial_bridge/landmarks.ipynb
gpl-3.0
import deltascope as ds import deltascope.alignment as ut import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import normalize from scipy.optimize import minimize import os import tqdm import json import datetime """ Explanation: Introduction: Landmarks End of explanati...
jtwhite79/pyemu
verification/Freyberg/verify_unc_results.ipynb
bsd-3-clause
%matplotlib inline import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import pyemu """ Explanation: verify pyEMU results with the henry problem End of explanation """ la = pyemu.Schur("freyberg.jcb",verbose=False,forecasts=[]) la.drop_prior_information() jco_ord = la.jco.get(la.pst.obs_...
EricKightley/sparsekmeans
plots/heuristic/heuristic.ipynb
mit
import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np from scipy.linalg import hadamard from scipy.fftpack import dct %matplotlib inline n = 6 #number of data points (columns in plot) K = 3 #number of centroids m = 4 #subsampling dimension p = 10 #latent (data) dime...
lwahedi/CurrentPresentation
talks/MDI1/Slides.ipynb
mit
my_string = 'Hello World' print(my_string) """ Explanation: Manipulating Data in Python Laila A. Wahedi Massive Data Institute Postdoctoral Fellow <br>McCourt School of Public Policy Follow along: Wahedi.us, Current Presentation Installing packages: On a Mac: Open terminal On Windows: Type cmd into the start menu ...
IESD/cegads-domestic-model
cegads/examples/Basic usage.ipynb
gpl-2.0
%pylab inline import pandas as pd """ Explanation: cegads-domestic-model This ipython notebook describes the basic usage of the cegads-domestic-model python library. The library implements a simple domestic appliance model based on data from chapter three of the DECC ECUK publication (https://www.gov.uk/government/col...
hanhanwu/Hanhan_Data_Science_Practice
sequencial_analysis/after_2020_practice/ts_RNN_basics.ipynb
mit
import pandas as pd import numpy as np import datetime from matplotlib import pyplot as plt import seaborn as sns from sklearn.preprocessing import MinMaxScaler df = pd.read_csv('data/pm25.csv') print(df.shape) df.head() df.isnull().sum()*100/df.shape[0] df.dropna(subset=['pm2.5'], axis=0, inplace=True) df.reset_in...
osamoylenko/YSDA_deeplearning17
Seminar1/Homework 1 (Face Recognition).ipynb
mit
import scipy.io image_h, image_w = 32, 32 data = scipy.io.loadmat('faces_data.mat') X_train = data['train_faces'].reshape((image_w, image_h, -1)).transpose((2, 1, 0)).reshape((-1, image_h * image_w)) y_train = (data['train_labels'] - 1).ravel() X_test = data['test_faces'].reshape((image_w, image_h, -1)).transpose((2...
joonasfo/python
Assignment_03_notebook.ipynb
mit
%matplotlib notebook import matplotlib.pyplot as plt import numpy as np from matplotlib.pyplot import * from numpy import * """ Explanation: Introduction to Numerical Problem Solving TX00BY09-3007 Assignment: 03 Graphical analysis Description: Solve the problem 8 from previous exercises 02. Solve the problems 1c, 2a, ...
dato-code/tutorials
notebooks/AnyGivenSunday.ipynb
apache-2.0
#Fire up the GraphLab engine import graphlab as gl import graphlab.aggregate as agg """ Explanation: Any Given Sunday: Football and a Machine Learning Rookie I love football more than engineers love coffee, all my Turi friends know that. Throughout the course of an NFL season I have fantasy teams, point-spread pools, ...
xpharry/Udacity-DLFoudation
tutorials/sentiment-rnn/Sentiment RNN Solution.ipynb
mit
import numpy as np import tensorflow as tf with open('reviews.txt', 'r') as f: reviews = f.read() with open('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 network that performs sentiment analysis....
MaxRobinson/CS449
project1/mrobi100.ipynb
apache-2.0
from __future__ import division # so that 1/2 = 0.5 and not 0 from IPython.core.display import * import csv, math, copy, random """ Explanation: Module 12 - Programming Assignment Directions There are general instructions on Blackboard and in the Syllabus for Programming Assignments. This Notebook also has instruction...
unpingco/Python-for-Probability-Statistics-and-Machine-Learning
chapters/probability/notebooks/ProbabilityInequalities.ipynb
mit
from pprint import pprint import textwrap import sys, re """ Explanation: Python for Probability, Statistics, and Machine Learning End of explanation """ import sympy import sympy.stats as ss t=sympy.symbols('t',real=True) x=ss.ChiSquared('x',1) """ Explanation: Useful Inequalities In practice, few quantities can b...
LucaCanali/Miscellaneous
Spark_Physics/HEP_benchmark/ADL_HEP_Query_Benchmark_Q1_Q5.ipynb
apache-2.0
# Download the data if not yet available locally # Download the reduced data set (2 GB) ! wget -r -np -R "index.html*" -e robots=off https://sparkdltrigger.web.cern.ch/sparkdltrigger/Run2012B_SingleMu_sample.orc/ # This downloads the full dataset (16 GB) # ! wget -r -np -R "index.html*" -e robots=off https://sparkdlt...
kingsgeocomp/code-camp
notebook-10-recap.ipynb
mit
cities = ["Bristol", "London", "Manchester", "Edinburgh", "Belfast", "York"] """ Explanation: Recap 2 Second Checkpoint Since the first recap, you've learned about lists, dictionaries and loops. Let's revise those concepts and how to use them in this notebook before continuing on to some new material. Answer the quest...
n-witt/MachineLearningWithText_SS2017
exercises/solutions/1 Numpy.ipynb
gpl-3.0
import numpy as np try: np except NameError: print('Numpy not correctly imported') """ Explanation: Import the numpy package under the name np End of explanation """ Z = np.zeros(10) print(Z) assert type(Z).__module__ == np.__name__ assert len(Z) == 10 assert sum(Z) == 0 """ Explanation: 2. Create a null ...
mayuanucas/notes
python/python下划线命名规则.ipynb
apache-2.0
8 * 9 _ + 8 """ Explanation: 在 python 中,下划线命名规则往往令人相当疑惑:单下划线、双下划线、双下划线还分前后……那它们的作用与使用场景到底有何区别呢? 1、单下划线(_) 通常情况下,单下划线(_)会在以下3种场景中使用: 1.1 在解释器中: 在这种情况下,“_”代表交互式解释器会话中上一条执行的语句的结果。这种用法首先被标准CPython解释器采用,然后其他类型的解释器也先后采用。 End of explanation """ for _ in range(1, 11): print(_, end='、 ') """ Explanation: 1.2 作为一个名称: 这与...
AndreySheka/dl_ekb
hw3/HW3_Modules.ipynb
mit
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 ...
GoogleCloudPlatform/training-data-analyst
quests/serverlessml/03_tfdata/solution/input_pipeline.ipynb
apache-2.0
%%bash export PROJECT=$(gcloud config list project --format "value(core.project)") echo "Your current GCP Project Name is: "$PROJECT !pip install tensorflow==2.1.0 --user """ Explanation: Input pipeline into Keras In this notebook, we will look at how to read large datasets, datasets that may not fit into memory, usi...
YaniLozanov/Software-University
Python/Jupyter notebook/04.Complex Conditional Statements/Jupyter notebook/04.Complex Conditional Statements.ipynb
mit
age = float(input()) sex = input() if sex == "m": if age >= 16: print("Mr.") else: print("Master") else: if age >= 16: print("Ms.") else: print("Miss") """ Explanation: <h1 align="center">Complex Conditional Statements<h1> <h2>01.Personal Titles</h2> The first task...
stijnvanhoey/course_gis_scripting
_solved/01-python-introduction.ipynb
bsd-3-clause
print("Hello INBO_course!") # python 3(!) """ Explanation: <p><font size="6"><b>Python the essentials: A minimal introduction</b></font></p> Introduction to GIS scripting May, 2017 © 2017, Stijn Van Hoey (&#115;&#116;&#105;&#106;&#110;&#118;&#97;&#110;&#104;&#111;&#101;&#121;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#...
xray/xray
doc/examples/ROMS_ocean_model.ipynb
apache-2.0
import numpy as np import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt %matplotlib inline import xarray as xr """ Explanation: ROMS Ocean Model Example The Regional Ocean Modeling System (ROMS) is an open source hydrodynamic model that is used for simulating currents and wate...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/sandbox-3/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'sandbox-3', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: MIROC Source ID: SANDBOX-3 Topic: Ocean Sub-Topics: Timestepping Framework, Advecti...
csaladenes/csaladenes.github.io
present/mcc2/PythonDataScienceHandbook/05.06-Linear-Regression.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns; sns.set() import numpy as np """ Explanation: <!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; t...
shernshiou/CarND
Term1/02-CarND-Traffic-Sign-Classifier-Project/Traffic_Sign_Classifier1.ipynb
mit
# Load pickled data import pickle import csv import cv2 import numpy as np import math import matplotlib.pyplot as plt signnames = [] with open("signnames.csv", 'r') as f: next(f) reader = csv.reader(f) signnames = list(reader) n_classes = len(signnames) training_file = "./train.p" testing_file = "./test....
GoogleCloudPlatform/asl-ml-immersion
notebooks/tfx_pipelines/pipeline/labs/tfx_pipeline_vertex.ipynb
apache-2.0
from google.cloud import aiplatform as vertex_ai """ Explanation: Continuous training with TFX and Vertex Learning Objectives Containerize your TFX code into a pipeline package using Cloud Build. Use the TFX CLI to compile a TFX pipeline. Deploy a TFX pipeline version to run on Vertex Pipelines using the Vertex Pytho...
gatakaba/kalmanfilter
examples/kalmanfilter/free_fall.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import os os.chdir('..') from kalmanfilter.kalmanfilter import KalmanFilter dt = 10 ** -3 """ Explanation: 自由落下の状態方程式 質量M,ダンパ係数C,弾性係数Kの運動方程式は以下のようになる $$ M \frac{d^{2}x}{dt^{2}} + C \frac{dx}{dt} + K x = f(t) $$ ここで空気抵抗を無視して方程式を整理すると $$ M \frac{d^{2}x}{dt^{2}} = Mg...
yfur/basic-mechanics-python
1_modeling/1_modeling.ipynb
apache-2.0
import numpy as np from scipy.integrate import odeint from math import sin ''' constants ''' m = 1 # mass of the pendulum [kg] l = 1 # length of the pendulum [m] g = 10 # Gravitational acceleration [m/s^2] c = 0.3 # Damping constant [kg.m/(rad.s)] ''' time setting ''' t_end = 10 # simulation time [s] t_fps = 50 # fra...
scotthuang1989/Python-3-Module-of-the-Week
internet/urllib.parse — Split URLs into Components.ipynb
apache-2.0
from urllib.parse import urlparse url = 'http://netloc/path;param?query=arg#frag' parsed = urlparse(url) print(parsed) """ Explanation: Parsing End of explanation """ from urllib.parse import urlparse url = 'http://user:pwd@NetLoc:80/path;param?query=arg#frag' parsed = urlparse(url) print('scheme :', parsed.schem...
pchmieli/h2o-3
h2o-py/demos/H2O_tutorial_medium.ipynb
apache-2.0
import pandas as pd import numpy from numpy.random import choice from sklearn.datasets import load_boston from h2o.estimators.random_forest import H2ORandomForestEstimator import h2o h2o.init() # transfer the boston data from pandas to H2O boston_data = load_boston() X = pd.DataFrame(data=boston_data.data, columns=b...
jokedurnez/RequiredEffectSize
Figure2_CorrSimulation/Correlation_simulation.ipynb
mit
import numpy import nibabel import os import nilearn.plotting import matplotlib.pyplot as plt from statsmodels.regression.linear_model import OLS import nipype.interfaces.fsl as fsl import scipy.stats if not 'FSLDIR' in os.environ.keys(): raise Exception('This notebook requires that FSL is installed and the FSLDIR...
KushajveerSingh/Data-Science-Libraries
.ipynb_checkpoints/Advancd Python-checkpoint.ipynb
mit
if __name__ == "__main__": # Do anything you want pass """ Explanation: Python is a programming language. Python is often refereed as a scripting language as scripting languages are often interpreted and not compiled.<br> End of explanation """ # If you want to give arguments to a function as a list def f(x,...
mdiaz236/DeepLearningFoundations
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...
mwegrzyn/mindReading2017
content/_006_neurosynthDecoding_pt1.ipynb
gpl-3.0
import os imgList = ['../training/%s'%x for x in os.listdir('../training/')]; imgList.sort() """ Explanation: Wir haben bisher immer nur Daten unserer Person verwendet um Vorhersagen zu treffen. Das macht Sinn, da die Daten der Person gut die Besonderheiten ihrer Art zu denken widerspiegeln. Zum Beispiel könnte man b...
kmclaugh/fastai_courses
kevin_files/lesson1.ipynb
apache-2.0
%matplotlib inline """ Explanation: Using Convolutional Neural Networks Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning. Introduction to this week's task: 'Do...
thehackerwithin/berkeley
code_examples/intropy_sp17/thw-python.ipynb
bsd-3-clause
2 + 3 # Press <Ctrl-Enter to evaluate a cell> 2 + int(3.5 * 4) * float("8") 9 // 2 # Press <Ctrl-Enter to evaluate> """ Explanation: Introduction to Python 1. Installing Python 2. The Language Expressions List, Tuple and Dictionary Strings Functions 3. Example: Word Frequency Analysis with Python Reading...
cavaunpeu/willwolf.io-source
content/downloads/notebooks/intercausal_reasoning.ipynb
mit
from collections import namedtuple import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc3 as pm from scipy.optimize import fmin_powell from scipy.stats import beta as beta_distribution import seaborn as sns from sklearn.linear_model import LogisticRegression %matplotlib inline plt.style.us...
amuniversity/am-mooc
module 2/Ex 2b - Housing ,Linear Regression - Open.ipynb
gpl-2.0
# import libraries import matplotlib import IPython import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import pylab import seaborn as sns import sklearn as sk %matplotlib inline """ Explanation: Linear Regression , Housing Prerequisites: Hopefully you have a good unders...
dlab-berkeley/python-taq
tests/Basic HDF5 Operations.ipynb
bsd-2-clause
# But what symbol is that? max_sym = None max_rows = 0 for sym, rows in rec_counts.items(): if rows > max_rows: max_rows = rows max_sym = sym max_sym, max_rows """ Explanation: Anyway, under a gigabyte. So, nothing to worry about even if we have 24 cores. End of explanation """ # Most symbols al...
viper-framework/har2tree
tutorial/tutorial.ipynb
bsd-3-clause
from pathlib import Path Path.home() """ Explanation: Har2Tree Tutorial Crawling a web page can sound like a bit of an abstract concept at first. How exactly can we extract data from a web page? What data is really interesting to look at? Where can it be found? &rarr; Every web browser generates a HAR file (short fo...
rogerallen/kaggle
dogscats/roger.ipynb
apache-2.0
#Verify we are in the lesson1 directory %pwd %matplotlib inline import os, sys sys.path.insert(1, os.path.join(sys.path[0], '../utils')) from utils import * from vgg16 import Vgg16 from PIL import Image from keras.preprocessing import image from sklearn.metrics import confusion_matrix """ Explanation: Creating my ow...
ericmjl/hiv-resistance-prediction
old_notebooks/Prototype Neural Network for predicting HA host tropism.ipynb
mit
! echo $PATH ! echo $CUDA_ROOT import pandas as pd import numpy as np from Bio import SeqIO from Bio import AlignIO from Bio.Align import MultipleSeqAlignment from collections import Counter from sklearn.preprocessing import LabelBinarizer from sklearn.cross_validation import train_test_split from sklearn.ensemble imp...
scikit-optimize/scikit-optimize.github.io
0.7/notebooks/auto_examples/optimizer-with-different-base-estimator.ipynb
bsd-3-clause
print(__doc__) import numpy as np np.random.seed(1234) import matplotlib.pyplot as plt """ Explanation: Use different base estimators for optimization Sigurd Carlen, September 2019. Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt To use different base_estimator or create a regressor with different para...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/SphericalMeshing/CartesianTriangulations/Ex6-Scattered-Data.ipynb
mit
import numpy as np HFdata = np.loadtxt("../Data/HeatFlowSEAustralia.csv", delimiter=',', usecols=(3,4,5), skiprows=1) eastings = HFdata[:,0] northings = HFdata[:,1] heat_flow = HFdata[:,2] %matplotlib inline import matplotlib.pyplot as plt import cartopy import cartopy.crs as ccrs # local coordinate reference syst...
joekasp/ionic_liquids
ionic_liquids/Interface.ipynb
mit
from ipywidgets import interact, interact_manual, HBox, VBox import ipywidgets as widgets from IPython.display import display, clear_output import numpy as np import pandas as pd import matplotlib.pyplot as plt from visualization import core, plots import utils """ Explanation: ILest: Ionic Liquids Estimation and Stat...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_evoked_whitening.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis A. Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import mne from mne import io from mne.datasets import sample from mne.cov import compute_covariance print(__doc__) """ Explanation: Whitening evoked data with ...
nwfpug/python-primer
notebooks/06-lists.ipynb
gpl-3.0
# import thr random numbers module. More on modules in a future notebook import random """ Explanation: Lists <img src="../images/python-logo.png"> Lists are sequences that hold heterogenous data types that are separated by commas between two square brackets. Lists have zero-based indexing, which means that the first ...
Mynti207/cs207project
docs/stock_example_returns.ipynb
mit
# load data with open('data/returns_include.json') as f: stock_data_include = json.load(f) with open('data/returns_exclude.json') as f: stock_data_exclude = json.load(f) # keep track of which stocks are included/excluded from the database stocks_include = list(stock_data_include.keys()) stocks_exclude ...
mdeff/ntds_2017
projects/reports/movie_success/Treat_Metacritic_ROI.ipynb
mit
%matplotlib inline import configparser import os import requests from tqdm import tqdm import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.mlab as mlab from scipy import sparse, stats, spatial import scipy.sparse.linalg from sklearn import preprocessing, decomposition import libro...
rflamary/POT
notebooks/plot_barycenter_1D.ipynb
mit
# Author: Remi Flamary <remi.flamary@unice.fr> # # License: MIT License import numpy as np import matplotlib.pylab as pl import ot # necessary for 3d plot even if not used from mpl_toolkits.mplot3d import Axes3D # noqa from matplotlib.collections import PolyCollection """ Explanation: 1D Wasserstein barycenter demo ...
YoungKwonJo/mlxtend
docs/examples/classifier_nn_mlp.ipynb
bsd-3-clause
from mlxtend.data import iris_data X, y = iris_data() X = X[:, 2:] """ Explanation: mlxtend - Multilayer Perceptron Examples Sections Classify Iris Classify handwritten digits from MNIST <br> <br> Classify Iris Load 2 features from Iris (petal length and petal width) for visualization purposes. End of explanation ""...
NeuroDataDesign/fngs
docs/ebridge2/fngs_merge/week_0613/friston.ipynb
apache-2.0
import numpy as np def friston_model(mc_params): (t, m) = mc_params.shape friston = np.zeros((t, 4*m)) # the motion parameters themselves friston[:, 0:m] = mc_params # square the motion parameters friston[:, m:2*m] = np.square(mc_params) # use the motion estimated at the preceding timepoin...
mdda/fossasia-2016_deep-learning
notebooks/2-CNN/6-StyleTransfer/4-Art-Style-Transfer-inception_tf.ipynb
mit
import tensorflow as tf import numpy as np import scipy import scipy.misc # for imresize import matplotlib.pyplot as plt %matplotlib inline import time from urllib.request import urlopen # Python 3+ version (instead of urllib2) import os # for directory listings import pickle AS_PATH='./images/art-style' """ E...
mdeff/ntds_2016
toolkit/04_ex_visualization.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline # Random time series. n = 1000 rs = np.random.RandomState(42) data = rs.randn(n, 4).cumsum(axis=0) # plt.figure(figsize=(15,5)) # plt.plot(data[:, 0]) # df = pd.DataFrame(...) # df.plot(...) """ Explanation: A Python Tour of D...
keylime1/courses_12-752
assignments/2/12-752_Assignment_2_Starter.ipynb
mit
temperatureDateConverter = lambda d : dt.datetime.strptime(d,'%Y-%m-%d %H:%M:%S') temperature = np.genfromtxt('../../data/temperature.csv',delimiter=",",dtype=[('timestamp', type(dt.datetime.now)),('tempF', 'f8')],converters={0: temperatureDateConverter}, skiprows=1) """ Explanation: Section 1.1 - Importing the Data L...
jegibbs/phys202-2015-work
assignments/assignment12/FittingModelsEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Fitting Models Exercise 1 Imports End of explanation """ a_true = 0.5 b_true = 2.0 c_true = -4.0 N = 30 dy = 2.0 """ Explanation: Fitting a quadratic curve For this problem we are going to work with t...
ehthiede/PyEDGAR
examples/Delay_Embedding/Delay_Embedding.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pyedgar from pyedgar.data_manipulation import tlist_to_flat, flat_to_tlist, delay_embed, lift_function %matplotlib inline """ Explanation: Delay Embedding and the MFPT Here, we give an example script, showing the effect of Delay Embedding on a Brownian motion ...
Flaviolib/dx
08_dx_fourier_pricing.ipynb
agpl-3.0
import dx import datetime as dt """ Explanation: <img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="45%" align="right" border="4"> Fourier-based Option Pricing For several reasons, it is beneficial to have available alternative valuation and pricing approaches to the Monte Carlo simulation appr...
mohanprasath/Course-Work
machine_learning/learning_python_3.ipynb
gpl-3.0
print("Hello World!") print("Hello Again") print("I like typing this.") print("This is fun.") print('Yay! Printing.') print("I'd much rather you 'not'.") print('I "said" do not touch this.') ''' Notes: octothorpe, mesh, or pund # ''' """ Explanation: Learning Python3 from URL https://learnpythonthehardway.org/pyt...
frederickayala/session-based-recsys
Qvik Session-Based Recommender Systems/GRU4RecLab.ipynb
mit
# -*- coding: utf-8 -*- import theano import pickle import sys import os sys.path.append('../..') import numpy as np import pandas as pd import gru4rec #If this shows an error probably the notebook is not in GRU4Rec/examples/rsc15/ import evaluation # Validate that the following assert makes sense in your platform # T...
fabriziocosta/pyMotif
meme_example.ipynb
mit
# Meme().display_meme_help() from eden.util import configure_logging import logging configure_logging(logging.getLogger(),verbosity=2) from utilities import Weblogo wl = Weblogo(color_scheme='classic') meme1 = Meme(alphabet="dna", # {ACGT} gap_in_alphabet=False, mod="anr", # Any number...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/labs/3c_bqml_dnn_babyweight.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst %%bash pip freeze | grep google-cloud-bigquery==1.6.1 || \ pip install google-cloud-bigquery==1.6.1 """ Explanation: LAB 3c: BigQuery ML Model Deep Neural Network. Learning Objectives Create and evaluate DNN model with BigQuery ML. Create and evalua...
CORE-GATECH-GROUP/serpent-tools
examples/Detector.ipynb
mit
import os pinFile = os.path.join( os.environ["SERPENT_TOOLS_DATA"], "fuelPin_det0.m", ) bwrFile = os.path.join( os.environ["SERPENT_TOOLS_DATA"], "bwr_det0.m", ) """ Explanation: Copyright (c) 2017-2020 Serpent-Tools developer team, GTRC THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,...
ernestyalumni/MLgrabbag
supervised-theano.ipynb
mit
import theano import theano.tensor as T # cf. https://github.com/lisa-lab/DeepLearningTutorials/blob/c4db2098e6620a0ac393f291ec4dc524375e96fd/code/logistic_sgd.py """ Explanation: I started here: Deep Learning tutorial End of explanation """ import cPickle, gzip, numpy import os os.getcwd() os.listdir( os.getcw...
saudijack/unfpyboot
Day_02/00_Scipy/04_Breakout_trapezoid_rule_solution.ipynb
mit
%pylab inline def trapz(x, y): return 0.5*np.sum((x[1:]-x[:-1])*(y[1:]+y[:-1])) """ Explanation: Basic numerical integration: the trapezoid rule Illustrates: basic array slicing, functions as first class objects. In this exercise, you are tasked with implementing the simple trapezoid rule formula for numerical in...
borja876/Thinkful-DataScience-Borja
Amazon+Reviews 180108.ipynb
mit
#Import data from json file and create a list data = [] with open('/home/borjaregueral/Digital_Music_5.json') as f: for line in f: data.append(json.loads(line)) #Create a dataframe with the columns that are interesting for this exercise #Columns left out: 'helpful', 'reviewTime', 'reviewerID','reviewerNam...
NervanaSystems/neon_course
08 Overfitting Tutorial.ipynb
apache-2.0
from neon.initializers import Gaussian from neon.optimizers import GradientDescentMomentum, Schedule from neon.layers import Conv, Dropout, Activation, Pooling, GeneralizedCost from neon.transforms import Rectlin, Softmax, CrossEntropyMulti, Misclassification from neon.models import Model from neon.data import CIFAR10 ...
fotis007/python_intermediate
Python_2_1.ipynb
gpl-3.0
#List a = [1, 5, 2, 84, 23] b = list("hallo") c = range(10) list(c) #dictionary z = dict(a=2,b=5,c=1) z """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Python-für-Fortgeschrittene" data-toc-modified-id="Python-für-Fortgeschrittene-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Python für...
bocklund/notebooks
thermodynamics/.ipynb_checkpoints/miscibility-gaps-checkpoint.ipynb
mit
import warnings warnings.simplefilter('ignore') # ignore warnings for nicer output import numpy as np from sympy import symbols, log, lambdify, solve import scipy.constants from ipywidgets import interact from bokeh.io import push_notebook, show, output_notebook from bokeh.plotting import figure from bokeh.models imp...
cstrelioff/ARM-ipynb
Chapter3/chptr3.3-R.ipynb
mit
%%R # I had to import foreign to get access to read.dta library("foreign") kidiq <- read.dta("../../ARM_Data/child.iq/kidiq.dta") # I won't attach kidiq-- i generally don't attach to avoid confusion(s) #attach(kidiq) """ Explanation: 3.3 Interactions Read the data Data are in the child.iq directory of the ARM_Data do...
Uberi/zen-and-the-art-of-telemetry
Moon Phase Correlation Analysis.ipynb
mit
import ujson as json import matplotlib.pyplot as plt import pandas as pd import numpy as np import plotly.plotly as py from moztelemetry import get_pings, get_pings_properties, get_one_ping_per_client from moztelemetry.histogram import Histogram import datetime as dt %pylab inline """ Explanation: Moon Phase Correl...
rishuatgithub/MLPy
nlp/3. Word Vectors + PCA + Cosine Similarity.ipynb
apache-2.0
## load the word embeddings from the google news vectors. Load it once. #embeddings = KeyedVectors.load_word2vec_format('../../Data/GoogleNews-vectors-negative300.bin', binary=True) ## Building a word embeddings for the small subset that is required in here f = open('../../Data/word_vectors/capitals.txt', 'r').read...
ganprad/rentorbuy
rentorbuy.ipynb
mit
import quandl quandl.ApiConfig.api_key = '############' """ Explanation: Import Data: Explore the data. Pick a starting point and create visualizations that might help understand the data better. Come back and explore other parts of the data and create more visualizations and models. Quandl is a great place to star...
griffinfoster/fundamentals_of_interferometry
1_Radio_Science/1_9_a_brief_introduction_to_interferometry.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary 1. Radio Science using Interferometric Arrays Previous: 1.8 Astronomical radio sources Next: 1.10 The Limits of Single Dish Astronomy ...
Housebeer/Natural-Gas-Model
.ipynb_checkpoints/Fitting curve-checkpoint.ipynb
mit
import numpy as np from scipy.optimize import leastsq import pylab as plt import pandas as pd N = 1000 # number of data points t = np.linspace(0, 4*np.pi, N) data = 3.0*np.sin(t+0.001) + 0.5 + np.random.randn(N) # create artificial data with noise guess_mean = np.mean(data) guess_std = 3*np.std(data)/(2**0.5) guess_p...
google/neural-tangents
notebooks/function_space_linearization.ipynb
apache-2.0
!pip install --upgrade pip !pip install -q tensorflow-datasets !pip install --upgrade jax[cuda11_cudnn805] -f https://storage.googleapis.com/jax-releases/jax_releases.html !pip install -q git+https://www.github.com/google/neural-tangents """ Explanation: <a href="https://colab.research.google.com/github/google/neural-...
krismolendyke/den
notebooks/Authorization.ipynb
mit
import os DEN_CLIENT_ID = os.environ["DEN_CLIENT_ID"] DEN_CLIENT_SECRET = os.environ["DEN_CLIENT_SECRET"] """ Explanation: Authorization Following the Nest authorization documentation. Setup Get the values of Client ID and Client secret from the clients page and set them in the environment before running this IPython...
Aniruddha-Tapas/Applied-Machine-Learning
Clustering/Seeds Clustering.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from sklearn.cross_validation import train_test_split from sklearn import cross_validation, metrics from sklearn import preprocessing import matplotlib.pyplot as plt cols = ['Area', 'Perimeter','Compactness','Kernel_Length','Kernel_Width','Assymetry_Coefficien...
AllenDowney/ThinkStats2
code/chap07ex.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/thi...
RaoUmer/lightning-example-notebooks
plots/circle.ipynb
mit
from lightning import Lightning from numpy import random, asarray """ Explanation: <img style='float: left' src="http://lightning-viz.github.io/images/logo.png"> <br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Circle plots in <a href='http://lightning-viz.github.io/'><font color='#9175f0'>Lightning</font></a> <hr> Setup End ...
mdeff/ntds_2016
project/reports/airbnb_booking/Main Machine Learning.ipynb
mit
import pandas as pd import numpy as np import time import machine_learning_helper as machine_learning_helper import metrics_helper as metrics_helper import sklearn.neighbors, sklearn.linear_model, sklearn.ensemble, sklearn.naive_bayes from sklearn.model_selection import KFold, train_test_split, ShuffleSplit from sklear...
khrapovs/metrix
notebooks/doppler_nonparametrics.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as ss import sympy as sp sns.set_context('notebook') %matplotlib inline """ Explanation: Nonparametric estimatio of Doppler function End of explanation """ x = np.linspace(.01, .99, num=1e3) doppler = lambda x : np.sqrt(x * ...
albahnsen/ML_RiskManagement
exercises/03-IncomePrediction.ipynb
mit
import pandas as pd import numpy as np %matplotlib inline import matplotlib.pyplot as plt # read the data and set the datetime as the index import zipfile with zipfile.ZipFile('../datasets/income.csv.zip', 'r') as z: f = z.open('income.csv') income = pd.read_csv(f, index_col=0) income.head() income.shape "...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MOHC Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbul...
EstevesDouglas/UNICAMP-FEEC-IA369Z
dev/checkpoint/2017-05-09-estevesdouglas-notebook.ipynb
gpl-3.0
-- Campainha IoT - LHC - v1.1 -- ESP Inicializa pinos, Configura e Conecta no Wifi, Cria conexão TCP -- e na resposta de um "Tocou" coloca o ESP em modo DeepSleep para economizar bateria. -- Se nenhuma resposta for recebida em 15 segundos coloca o ESP em DeepSleep. led_pin = 3 status_led = gpio.LOW ip_servidor = "192.1...