repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
csaladenes/csaladenes.github.io
test/eis-metadata-validation/Planon metadata validation5b.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: EIS metadata validation script Used to validate Planon output with spreadsheet input 1. Data import End of explanation """ planon=pd.read_excel('EIS Assets v2.xlsx',index_col = 'Code') #master_loggerscontroller...
massimo-nocentini/on-python
calculus-I/numbers.ipynb
mit
from sympy import * init_printing() x = symbols('x') x**2 """ Explanation: Numeri In questa pagina introdurremo diversi insiemi di numeri, facendosi aiutare da un sistema di calcolo simbolico: End of explanation """ eq = Eq(x + 3, 2, evaluate=False) eq """ Explanation: $\mathbb{N}$ L'insieme dei Naturali $\mathb...
phoebe-project/phoebe2-docs
2.3/tutorials/intens_weighting.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" """ Explanation: Intensity Weighting Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as np im...
iRipVanWinkle/ml
Data Science UA - September 2017/Lecture 01 - Introduction/US_Baby_Names-2010.ipynb
mit
%pwd """ Explanation: MIE1624H Introductory Example US Baby Names 2010 End of explanation """ import pandas as pd names2010 = pd.read_csv('/resources/yob2010.txt', names=['name', 'sex', 'births']) names2010 """ Explanation: http://www.ssa.gov/oact/babynames/limits.html Load file into a DataFrame End of explanation...
michaelaye/scipy2015
2015-05-22 Basic calibration.ipynb
bsd-2-clause
import pandas as pd import glob folders = glob.glob('/Volumes/Data/ciss/opus/N*') len(folders) def process_folder(folder): import glob from pysis.exceptions import ProcessError from pyciss import pipeline as p # done = glob.glob(folder+'/*.map.cal.cub') # if done: # return folder,True ...
mdiaz236/DeepLearningFoundations
sentiment_network/.ipynb_checkpoints/Sentiment Classification - Mini Project 4-checkpoint.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
Merinorus/adaisawesome
Homework/01 - Pandas and Data Wrangling/.ipynb_checkpoints/Intro+to+Pandas (Katia)-checkpoint.ipynb
gpl-3.0
import pandas as pd import numpy as np pd.options.mode.chained_assignment = None # default='warn' """ Explanation: Table of Contents <p><div class="lev1"><a href="#Introduction-to-Pandas"><span class="toc-item-num">1&nbsp;&nbsp;</span>Introduction to Pandas</a></div><div class="lev2"><a href="#Pandas-Data-Structures"...
rcrehuet/Python_for_Scientists_2017
notebooks/7_0_matplotlib_scatter_plots.ipynb
gpl-3.0
from IPython.display import Image Image('../data/scatter_plot.png') """ Explanation: Matplotlib scatter plots The aim of this tutorial is to reproduce the following figure. You can imagine this figure as measuring A and B from a set of samples numbered (0,1,2,3, and 4). End of explanation """ import numpy as np impo...
fabiansinz/pipeline
jupyter/tutorial/pipeline_eyetracking.ipynb
lgpl-3.0
%pylab inline pylab.rcParams['figure.figsize'] = (6, 6) %matplotlib inline import datajoint as dj from pipeline import vis, preprocess import numpy as np import matplotlib.pyplot as plt import seaborn as sns """ Explanation: Eye traces in pipeline End of explanation """ (dj.ERD.from_sequence([preprocess.EyeTracking...
adrianoglemos/end_of_day_two
notes/DefensiveProgrammingNotes.ipynb
mit
def cell_volume(X, Y, Z): # Return the volume of a unit cell # described by lattice vectors X, Y and Z # The volume is given by the determinant of # the matrix formed by sticking the three # vectors together. i.e. # # | X[0] Y[0] Z[0] | # V = | X[1] Y[1] Z[1] | # | X[2] Y[2...
tsarouch/data_science_references_python
core/Confidence_Prediction_Intervals.ipynb
gpl-2.0
# This is our distribution (we assume gaussian) data = np.random.normal(240, 25, 1000) """ Explanation: To keep in mind. - When a $\alpha=95%$ C.I. is asked => The values at the 2.5 ($(1-\alpha)/2)$) and 97.5 ($ \alpha+((1-\alpha)/2)$) percentiles are selected. Use-Case: CI for normal distribution - Bootstrap The siz...
folivetti/BIGDATA
Spark/Lab4a_regressao_linear.ipynb
mit
# carregar base de dados from test_helper import Test import os.path baseDir = os.path.join('Data') inputPath = os.path.join('Aula04', 'millionsong.txt') fileName = os.path.join(baseDir, inputPath) numPartitions = 2 rawData = sc.textFile(fileName, numPartitions) # EXERCICIO numPoints = rawData.<COMPLETAR> print numPo...
Timonzimm/CS-401
project/report/report.ipynb
mit
import json from urllib.request import urlopen from urllib.parse import quote_plus import pandas as pd import numpy as np from tqdm import tqdm_notebook from multiprocessing import Pool, cpu_count import matplotlib.pyplot as plt plt.style.use('ggplot') import pandas as pd import sqlite3 import warnings warnings.filter...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_tf_lcmv.ipynb
bsd-3-clause
# Author: Roman Goj <roman.goj@gmail.com> # # License: BSD (3-clause) import mne from mne import compute_covariance from mne.datasets import sample from mne.event import make_fixed_length_events from mne.beamformer import tf_lcmv from mne.viz import plot_source_spectrogram print(__doc__) data_path = sample.data_path...
debsankha/network_course_python
exercises/03-exercise-graphs-medium.ipynb
gpl-2.0
G=nx.read_graphml("../data/visualization/small_graph.xml")#Load the graph """ Explanation: E2.1 Shortest Paths and Cycles End of explanation """ # function checks if graph G has K (5) or K (3 ,3) as minors , # returns True / False on planarity import itertools as it from networkx.algorithms import bipartite def is_...
rvperry/phys202-2015-work
assignments/assignment11/OptimizationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Optimization Exercise 1 Imports End of explanation """ def hat(x,a,b): V=-a*x**2+b*x**4 return V assert hat(0.0, 1.0, 1.0)==0.0 assert hat(0.0, 1.0, 1.0)==0.0 assert hat(1.0, 10.0, 1.0)==-9.0 ...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/sandbox-1/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-1', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: NERC Source ID: SANDBOX-1 Sub-Topics: Radiative Forcings. Properties: 85 (42 ...
prasants/pyds
05.Booleans_True_or_False.ipynb
mit
mybool_1 = True print(mybool_1) mybool_2 = False print(mybool_2) """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Booleans" data-toc-modified-id="Booleans-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Booleans</a></div><div class="lev2 toc-item"><a href="#Not-True-/-Not-False?" data-toc-...
AllenDowney/ProbablyOverthinkingIt
bear16.ipynb
mit
from __future__ import print_function, division from thinkbayes2 import Pmf, Cdf, Beta import thinkbayes2 import thinkplot import numpy as np from scipy import stats %matplotlib inline """ Explanation: When will I win the Great Bear Run? This notebook presents an application of Bayesian inference to predicting the...
pligor/predicting-future-product-prices
ARIMA/ShampooSales.ipynb
agpl-3.0
from __future__ import division import pandas as pd from pandas import read_csv from pandas import datetime from matplotlib import pyplot as plt from pandas.plotting import autocorrelation_plot from statsmodels.tsa.arima_model import ARIMA from pandas import DataFrame from sklearn.metrics import mean_squared_error from...
kit-cel/wt
nt1/vorlesung/1_quellencodierung/Uniform_Quantization_Audio.ipynb
gpl-2.0
%matplotlib inline import matplotlib import matplotlib.pyplot as plt import numpy as np from scipy.io import wavfile import IPython.display as ipd from ipywidgets import interactive import ipywidgets as widgets # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=matplotlib.checkdep...
ajgpitch/qutip-notebooks
examples/stinespring.ipynb
lgpl-3.0
from __future__ import division, print_function """ Explanation: QuTiP Example: Stinespring Dilation of Quantum Channels Christopher Granade <br> University of Sydney $\newcommand{\ket}[1]{\left|#1\right\rangle}$ $\newcommand{\bra}[1]{\left\langle#1\right|}$ $\newcommand{\cnot}{{\scriptstyle \rm CNOT}}$ $\newcommand{\...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-1/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-1', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-1 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
Neyt/First-Neural-Network
original.ipynb
mit
%matplotlib inline #commands that start with "%" are called "magic words" and are used in Jupyter %config InlineBackend.figure_format = 'retina' import numpy as np #is a library that helps to manage arrays www.numpy.org/ import pandas as pd #a library to analyze and show data. http://pandas.pydata.org/pandas-docs/stab...
ianozsvald/word2vec_sentences_vs_target_sentence_demo
word2vec similarity example.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import pprint from gensim.models import word2vec %matplotlib inline if False: # start an interactive console %qtconsole style=monokai # %install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark...
diging/tethne-notebooks
6. Words and topic modeling.ipynb
gpl-3.0
from tethne.readers import dfr """ Explanation: Introduction to Tethne: Words and Topic Modeling In this workbook we'll start working with word-based FeatureSets, and use the model.corpus.mallet module to fit a Latent Dirichlet Allocation (LDA) topic model. Before you start Download the practice dataset from here, a...
therealAJ/python-sandbox
data-science/learning/ud1/DataScience/TTest.ipynb
gpl-3.0
import numpy as np from scipy import stats A = np.random.normal(25.0, 5.0, 10000) B = np.random.normal(26.0, 5.0, 10000) stats.ttest_ind(A, B) """ Explanation: T-Tests and P-Values Let's say we're running an A/B test. We'll fabricate some data that randomly assigns order amounts from customers in sets A and B, with ...
ANTsX/ANTsPy
tutorials/10minTutorial.ipynb
apache-2.0
import ants import numpy as np """ Explanation: 10 minute ANTsPy tutorial ANTsPy is a Python wrapper for the ANTs neuroimage processing library, along with other pythonic tools that make it easy and fun to work with brain images directly in Python. This tutorial is available at https://github.com/ANTsX/ANTsPy/tree/mas...
gorayni/fingerprint
12. MLP/MLP-Readable.ipynb
mit
from __future__ import division import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt import numpy as np import random %matplotlib inline """ Explanation: Multilayer Perceptron Network The development of artificial neural networks has been around almost since the beginning of the Articial ...
SheffieldML/notebook
GPy/basic_gp.ipynb
bsd-3-clause
GPy.plotting.change_plotting_library('plotly') """ Explanation: As of Mon 12th of Oct running on devel branch of GPy 0.8.8 End of explanation """ import numpy as np """ Explanation: Gaussian process regression tutorial Nicolas Durrande 2013 with edits by James Hensman and Neil D. Lawrence We will see in this tutori...
ES-DOC/esdoc-jupyterhub
notebooks/inm/cmip6/models/inm-cm5-0/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inm', 'inm-cm5-0', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: INM Source ID: INM-CM5-0 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
dostrebel/working_place_ds_17
03 python II/02 Python II Hausaugaben.ipynb
mit
def double_1(zahl): if zahl == 5: zahl = zahl * 2 return zahl else: return zahl double_1(4) def double(zahl): zahl = zahl * 2 return zahl double(4) """ Explanation: Python II Hausaufgaben 1.Baue eine Funktion mit dem Namen 'double', der die Zahl 5 vedoppelt: End o...
poppy-project/community-notebooks
tutorials-education/poppy-torso__vrep_Prototype d'ininitiation à l'informatique pour les lycéens/dialogue/Dialogue TP2.ipynb
lgpl-3.0
from poppy.creatures import PoppyTorso poppy=PoppyTorso(simulator='vrep') # oui for i in range(0,3): poppy.head_y.goto_position(15,0.5,wait=True) poppy.head_y.goto_position(-15,0.5,wait=True) print i poppy.head_y.goto_position(-15,0.1,wait=True) """ Explanation: ET – Niveau 1 - Python TP2 Et si on communi...
texib/deeplearning_homework
tensor-flow-exercises/4_convolutions.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 pickle_file = 'notMNIST.pickle' with open(pickle_file, 'rb') as f: save = pickle.load(f) train_dataset = save['train_dataset'] train_la...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/dev/.ipynb_checkpoints/n01_first_look_at_the_data-checkpoint.ipynb
mit
import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys %matplotlib inline %pylab inline pylab.rcParams['figure.figsize'] = (20.0, 10.0) %load_ext autoreload %autoreload 2 sys.path.append('../../') data_df = pd.read_pickle('../....
mne-tools/mne-tools.github.io
stable/_downloads/7b89f7dac105a44e25d2fbdd898b911f/vector_mne_solution.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD-3-Clause import numpy as np import mne from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, apply_inverse print(__doc__) data_path = sample.data_path() subjects_dir = data_path / 'subjects' smoothing_steps = 7 # Read...
ecervera/mindstorms-nb
task/sound_teacher.ipynb
mit
from functions import connect, sound, forward, stop connect() """ Explanation: <img src="http://cdn.shopify.com/s/files/1/0059/3932/products/Aldebaran_Robotics_Nao_Humanoid_Robot_07_d2010cf6-cff3-468b-82c4-e2c7cfa6df9b.jpg?v=1439318386" align="right" width=200> Sensor de so (micròfon) El micròfon del robot detecta el...
ES-DOC/esdoc-jupyterhub
notebooks/mri/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', 'mri', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: MRI Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Tracers. Properties: 6...
tiffanyj41/hermes
notebooks/Hermes.Run.Script.Example.ipynb
apache-2.0
#This block of code will set up a spark content and sql context if you are running locally #If you are on cluster or have deployed spark a different way you don't need this from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext try: sc = SparkContext() except: sc = SparkContext._activ...
CS109-comment/NYTimes-Comment-Popularity-Prediction
IPython Process Notebook.ipynb
mit
# Import packages, libraries, and modules to be used from datetime import date, datetime, timedelta import requests, time, simplejson, sys, re import numpy as np import pandas as pd import sys from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LinearRegression, LogisticRegression from sk...
bayesimpact/bob-emploi
data_analysis/notebooks/datasets/job_offers/recent_job_postings.ipynb
gpl-3.0
import datetime from os import path import pandas as pd import seaborn as _ from bob_emploi.data_analysis.lib import plot_helpers DATA_PATH = '../../../data/' pd.options.display.max_rows = 999 """ Explanation: Pôle Emploi Active Job Postings Author: pascal@bayes.org Date: 2016-09-05 Skip the run test because it w...
RTHMaK/RPGOne
scipy-2017-sklearn-master/notebooks/14 Model Complexity and GridSearchCV.ipynb
apache-2.0
from sklearn.model_selection import cross_val_score, KFold from sklearn.neighbors import KNeighborsRegressor # generate toy dataset: x = np.linspace(-3, 3, 100) rng = np.random.RandomState(42) y = np.sin(4 * x) + x + rng.normal(size=len(x)) X = x[:, np.newaxis] cv = KFold(shuffle=True) # for each parameter setting do...
geoneill12/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 """ Explanation: Fitting a quadratic curve For this problem we are going to work with the following mod...
keras-team/keras-io
examples/audio/ipynb/transformer_asr.ipynb
apache-2.0
import os import random from glob import glob import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers """ Explanation: Automatic Speech Recognition with Transformer Author: Apoorv Nandan<br> Date created: 2021/01/13<br> Last modified: 2021/01/13<br> Description: Training a sequence-t...
aepton/python-data-wrangling
Data Wrangling with Python.ipynb
apache-2.0
import agate table = agate.Table.from_csv('data/contracts_data.csv') print table """ Explanation: Data wrangling Who we are Jackie Kazil (@JackieKazil), author of the O'Reilly book Data Wrangling with Python Abe Epton (@aepton) What we'll cover Loading data Transforming it Storing it How we'll do it We'll be work...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/sandbox-1/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'sandbox-1', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: SANDBOX-1 Topic: Aerosol Sub-Topic...
mdeff/ntds_2016
project/reports/youtube_fame/Titles_deep_learning.ipynb
mit
import requests import json import pandas as pd from math import * import numpy as np import tensorflow as tf import time import collections import os from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from IPython.display import display from random i...
physion/ovation-python
examples/activities.ipynb
gpl-3.0
import ovation as ov import ovation.activities as activities import ovation.download as download from ovation.session import connect from tqdm import tqdm_notebook from pprint import pprint """ Explanation: Activities This example shows how to create an Activity record, linking inputs, outputs and related files. End ...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/day-by-day/day09-random-walks/Day_9_Pre_Class_Notebook.ipynb
agpl-3.0
# 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 # WATCH THE VIDEO IN FULL-SCREEN MODE YouTubeVideo("fF841G53fGo",width=640,height=360) # random numbers """ Exp...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/4c_keras_wide_and_deep_babyweight.ipynb
apache-2.0
import datetime import os import shutil import matplotlib.pyplot as plt import numpy as np import tensorflow as tf print(tf.__version__) """ Explanation: LAB 4c: Create Keras Wide and Deep model. Learning Objectives Set CSV Columns, label column, and column defaults Make dataset of features and label from CSV files ...
meg-simula/solving-hdiv-in-practice
src/What is the fastest way to solve H(div) PDEs in practice? .ipynb
lgpl-3.0
# Import useful libraries from dolfin import * import numpy import pylab # Plot inline in this notebook %matplotlib inline # Set basic optimization parameters for FEniCS parameters["form_compiler"]["representation"] = "uflacs" parameters["form_compiler"]["cpp_optimize"] = True #parameters["plotting_backend"] = "matpl...
PG-TUe/tpot
tutorials/Portuguese Bank Marketing/Portuguese Bank Marketing Stratergy.ipynb
lgpl-3.0
# Import required libraries from tpot import TPOTClassifier from sklearn.cross_validation import train_test_split import pandas as pd import numpy as np #Load the data Marketing=pd.read_csv('Data_FinalProject.csv') Marketing.head(5) """ Explanation: Portuguese Bank Marketing Stratergy- TPOT Tutorial The data is rela...
liganega/Gongsu-DataSci
previous/notes2017/old/NB-12-Higher-order_Functions.ipynb
gpl-3.0
def x2_list(xs): L = [] for x in xs: L.append(x**2) return L x2_list([0, 0.5, 1, 1.5, 2, 2.5]) """ Explanation: 고계함수(higher-order functions) 활용법 파이썬은 함수와 메소드를 1급 객체(first-class object)로 다루며, 이는 C, C#, Java 등과 매우 다른 특징 중의 하나이다. 1급 객체는 예를 들어 함수의 인자로 사용될 수 있다. 파이썬을 제외한 기타 언어에서는 함수는 2급 객체로 구분되는 반면에 숫자...
hackthemarket/gym-trading
gym_trading/envs/TradingEnv.ipynb
mit
import gym import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import interactive interactive(True) """ Explanation: TradingEnv-v0 Open AI 'Gym' for reinforcement-learning based trading algorithms This gym implements a very simple trading environment for rei...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/cmse201-spring2016-d2l-export/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...
tensorflow/docs-l10n
site/zh-cn/tutorials/generative/cyclegan.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...
davidparks21/qso_lya_detection_pipeline
docs/nb/Vetting_DR5.ipynb
mit
def lya(z,zem=None): wvobs = (1+z)*1215.67 print('wvobs = {:g}'.format(wvobs)) if zem is not None: wvrest = wvobs/(1+zem) print('wvrest = {:g}'.format(wvrest)) return wvobs """ Explanation: Vetting the DR5 v6.1 End of explanation """ z=2.22131 zem = 2.569999 lya(z,zem) """ Explanatio...
dnc1994/MachineLearning-UW
ml-classification/module-2-linear-classifier-solution.ipynb
mit
from __future__ import division import graphlab import math import string """ Explanation: Predicting sentiment from product reviews The goal of this first notebook is to explore logistic regression and feature engineering with existing GraphLab functions. In this notebook you will use product review data from Amazon....
OpenBookProjects/ipynb
_data-sci-cases/survival_analysis.ipynb
mit
# You can also install packages from within IPython! # Install Python Packages !pip install lifelines !pip install rpy2 !pip install plotly !pip install pandas # Install R libraries %load_ext rpy2.ipython %R install.packages("devtools") %R install_github("ropensci/plotly") %R install.packages("IOsurv") %R install.pa...
qutip/qutip-notebooks
examples/pulse-wise-second-order-coherence-g2.ipynb
lgpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from qutip import * from IPython.display import display, Math, Latex """ Explanation: QuTiP Lecture: Pulse-wise second-order optical coherences of emission from a two-level system K.A. Fischer, Stanford University This Jupyter notebook demonstrat...
christophmark/bayesloop
docs/source/examples/stockmarketfluctuations.ipynb
mit
%matplotlib inline import numpy as np import bayesloop as bl import sympy.stats as stats from tqdm import tqdm_notebook import matplotlib.pyplot as plt import seaborn as sns sns.set_color_codes() # use seaborn colors # minute-scale pricing data prices = np.array( [ 221.14 , 221.09 , 221.17 , 221.3 , 221.3 ...
rh01/ml-course-4-cluster-and-retrieval
4_em-with-text-data_blank.ipynb
agpl-3.0
import graphlab '''Check GraphLab Create version''' from distutils.version import StrictVersion assert (StrictVersion(graphlab.version) >= StrictVersion('1.8.5')), 'GraphLab Create must be version 1.8.5 or later.' """ Explanation: Note to Amazon EC2 users: To conserve memory, make sure to stop all the other notebooks...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_visualize_raw.ipynb
bsd-3-clause
import os.path as op import numpy as np import mne data_path = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample') raw = mne.io.read_raw_fif(op.join(data_path, 'sample_audvis_raw.fif'), preload=True) raw.set_eeg_reference('average', projection=True) # set EEG average reference """ Ex...
M-R-Houghton/euroscipy_2015
modelling/EuroScipy.ipynb
mit
import scipy import numpy as np import pandas as pd import matplotlib.pyplot as plt import sklearn.cross_validation as cv # Extra plotting functionality import visplots from sklearn import preprocessing, metrics from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC from sklearn.linear_model ...
pbutenee/ml-tutorial
release/1/machine_learning.ipynb
mit
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = (13.0, 8.0) %matplotlib inline import pickle import sklearn import sklearn.linear_model import sklearn.preprocessing import sklearn.gaussian_process import sklearn.ensemble """ Explanation: Machine Learning 101++ in Python Created b...
jinhong211/CarND-LaneLines-P1
P1.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline """ Explanation: Self-Driving Car Engineer Nanodegree Project: Finding Lane Lines on the Road In this project, you will use the tools you learned about in the lesson to ide...
kit-cel/wt
qc/speech_coding/first_order_DPCM.ipynb
gpl-2.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.signal import lfilter import librosa import librosa.display import IPython.display as ipd # define circular frequency Omega = np.linspace(0,np.pi,100) """ Explanation: Differential Pulse Code Modulation of First Order This code is provid...
GoogleCloudPlatform/mlops-on-gcp
workshops/tfx-caip-tf23/lab-04-tfx-metadata/solutions/lab-04.ipynb
apache-2.0
import os import json import ml_metadata import tensorflow_data_validation as tfdv import tensorflow_model_analysis as tfma from ml_metadata.metadata_store import metadata_store from ml_metadata.proto import metadata_store_pb2 from tfx.orchestration import metadata from tfx.types import standard_artifacts from ten...
cosmicBboy/cosmicBboy.github.io
notebooks/2018-12-28-validating-pandas-dataframes.ipynb
gpl-2.0
import logging import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from collections import OrderedDict from IPython.display import display, Markdown from sodapy import Socrata logging.disable(logging.WARNING) # utility function to print python output as markdown snippets def print_output(s): ...
usantamaria/ipynb_para_docencia
10b_libreria_sklearn/sklearn.ipynb
mit
from sklearn import __version__ as vsn print(vsn) """ Explanation: <img src="images/utfsm.png" alt="" width="200px" align="right"/> USM Numérica Tema del Notebook Objetivos Conocer el funcionamiento de la librerìa sklearn de Machine Learning Aplicar la librerìa sklearn para solucionar problemas de Machine Learning S...
grigorisg9gr/menpo-notebooks
menpo/Transforms/Thin_Plate_Splines.ipynb
bsd-3-clause
import numpy as np from menpo.transform import ThinPlateSplines from menpo.shape import PointCloud """ Explanation: Thin Plate Splines (TPS) Transforms End of explanation """ # landmarks used in Principal Warps paper # http://user.engineering.uiowa.edu/~aip/papers/bookstein-89.pdf src_landmarks = np.array([[3.6929, ...
giacomov/3ML
docs/notebooks/Minimization_tutorial.ipynb
bsd-3-clause
from threeML import * import matplotlib.pyplot as plt %matplotlib inline from threeML.minimizer.tutorial_material import * """ Explanation: Minimization When using a Maximum Likelihood analysis we want to find the maximum of the likelihood $L(\vec{\theta})$ given one or more datasets (i.e., plugin instances) and o...
MaayanLab/clustergrammer-widget
tmp-API-check.ipynb
mit
import numpy as np import pandas as pd from clustergrammer_widget import * net = Network(clustergrammer_widget) """ Explanation: tmp-API-check The clustergrammer_widget class is now being loaded into the Network class. The class and widget instance are saved in th Network instance, net. This allows us to load data, cl...
fdcl-gwu/MAE3134_examples
Second Order Response.ipynb
gpl-3.0
G1 = signal.TransferFunction([9], [1, 9, 9]) time, resp1 = signal.step(G1) fig, ax = plt.subplots() ax.plot(time, resp1) ax.grid() plt.show() """ Explanation: We want to investigate the relationship between the poles of a second order system, the damping ratio and natural frequency, and the various performance specif...
DavidNorman/tensorflow
tensorflow/compiler/xla/g3doc/tutorials/xla_compile.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...
tensorflow/docs
site/en/r1/tutorials/_index.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...
tritemio/multispot_paper
realtime kinetics/out_notebooks/Simulated Kinetic Curve Fit - Template-out-single-spot-t0_novary.ipynb
mit
sigma = 0.016 time_window = 30 time_step = 5 time_start = -900 time_stop = 900 decimation = 20 t0_vary = True true_params = dict( tau = 60, # time constant init_value = 0.3, # initial value (for t < t0) final_value = 0.8, # final value (for t -> +inf) t0 = 0) # time o...
davewsmith/notebooks
temperature/FoamCoreExperiment.ipynb
mit
%matplotlib inline import matplotlib matplotlib.rcParams['figure.figsize'] = (12, 5) import pandas as pd df = pd.read_csv('temps-foamcore.csv', header=None, names=['time', 'mac', 'f', 'h'], parse_dates=[0]) per_sensor_f = df.pivot(index='time', columns='mac', values='f') downsampled_f = per_sensor_f.resample('2T').mea...
vpenso/scripts
docs/code/python/pandas.ipynb
gpl-3.0
import glob import pandas # read all files from pack/ files = glob.glob('pack/*.json') packs = [] for file in files: packs.append(pandas.read_json(file,orient='records')) # Use Pandas for data analysis cards = pandas.concat(packs,sort=False) # use the unique card identifier as index cards.set_index('code',inplac...
Kaggle/learntools
notebooks/ethics/raw/ex3.ipynb
apache-2.0
# Set up feedback system from learntools.core import binder binder.bind(globals()) from learntools.ethics.ex3 import * import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer # Get the same results each time np.random.seed...
saashimi/code_guild
interactive-coding-challenges/staging/arrays_strings/reverse_words/reverse_words_challenge.ipynb
mit
def reverse_words (S): #TODO: implement me pass """ Explanation: <small> <i> This notebook was prepared by Marco Guajardo. For license visit github </i> </small> . Challenge Notebook Problem: Given a string of words, return a string with the words in reverse Constraits Test Cases Algorithm Code Unit Test Sol...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/03_model_performance/labs/feature_columns_playground.ipynb
apache-2.0
# Toy Features Dictionary features = {"sq_footage": [ 1000, 2000, 3000, 4000, 5000], "house_type": ["house", "house", "apt", "apt", "townhouse"]} """ Explanation: Intro The tf.feature_column package provides several options for encoding categorical data. This mini-lab gives you an oppurtunity to exp...
petrs/ECTester
util/plot_dsa.ipynb
mit
%matplotlib notebook import numpy as np from scipy.stats import describe from scipy.stats import norm as norm_dist from scipy.stats.mstats import mquantiles from math import log, sqrt import matplotlib.pyplot as plt from matplotlib import ticker, colors, gridspec from copy import deepcopy from utils import plot_hist, m...
sequana/resources
coverage/01-virus/virus.ipynb
bsd-3-clause
%pylab inline matplotlib.rcParams['figure.figsize'] = [10,7] """ Explanation: sequana_coverage test case example (Virus) This notebook creates the BED file provided in - https://github.com/sequana/resources/tree/master/coverage and - https://www.synapse.org/#!Synapse:syn10638358/wiki/465309 WARNING: you need an accou...
ethen8181/machine-learning
python/python3_cookbook/1_data_structure.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', '..', 'notebook_format')) from formats import load_style load_style(plot_style=False) os.chdir(path) # magic to print version %load_ext watermark %water...
MonicaGutierrez/PracticalMachineLearningClass
notebooks/02-IntroMachineLearning_update.ipynb
mit
# Import libraries %matplotlib inline import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set(); cmap = mpl.colors.ListedColormap(sns.color_palette("hls", 3)) # Create a random set of examples from sklearn.datasets.samples_generator import make_blobs X, Y = make_blobs(...
sraejones/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 """ Explanation: Fitting a quadratic curve For this problem we are going to work with the following mod...
mlamoureux/PIMS_YRC
PDE_Solve_widget.ipynb
mit
%matplotlib inline import numpy as np from matplotlib.pyplot import * """ Explanation: WaveSolver - slider M. Lamoureux May 31, 2016. Pacific Insitute for the Mathematical Sciences Updated June 2017, to remove all reference to Bokeh, cuz it doesn't work now. (deprecated = broken) (Bokeh = Brokehn) This code does some...
GoogleCloudPlatform/asl-ml-immersion
notebooks/introduction_to_tensorflow/labs/1_core_tensorflow.ipynb
apache-2.0
import numpy as np import tensorflow as tf from matplotlib import pyplot as plt print(tf.__version__) """ Explanation: Getting started with TensorFlow Learning Objectives 1. Practice defining and performing basic operations on constant Tensors 1. Use Tensorflow's automatic differentiation capability 1. Learn ho...
blue-yonder/tsfresh
notebooks/examples/05 Timeseries Forecasting.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pylab as plt from tsfresh import extract_features, select_features from tsfresh.utilities.dataframe_functions import roll_time_series, make_forecasting_frame from tsfresh.utilities.dataframe_functions import impute try: import pandas_dat...
lukechen526/deep-learning
gan_mnist/Intro_to_GANs_Exercises.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...
a-slide/iPython-Notebook
Notebooks/2016_18_08_Epi2_pilot_datasets_analysis_protein_interaction.ipynb
gpl-2.0
# Standard lib imports from glob import glob from os import remove # Local lib import import pycl import pyBioPlot as pbl # Third party import import pandas as pd import numpy as np import pylab as pl import seaborn as sns import scipy.stats as stats # Pyplot tweaking %matplotlib inline pl.rcParams['figure.figsize']...
iskhakovt/numeric
coursework/integral.ipynb
mit
%matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt import scipy.integrate import sys sys.path.append('../numeric-core') import numeric """ Explanation: Численное интегрирование End of explanation """ def estimate_error(derivative_4, derivative_5_roots, a, b, n): n = (n + 1)...
rahulkgup/deep-learning-foundation
first-neural-network/bike-sharing_simple-neural-network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Bike Sharing - simple neural network In this project, I am building simple neural network and use it to predict daily bike rental ridership. Udacity has provided so...
ceos-seo/data_cube_notebooks
notebooks/training/ardc_training/Training_TaskC_Indices.ipynb
apache-2.0
import datacube import utils.data_cube_utilities.data_access_api as dc_api from datacube.utils.aws import configure_s3_access configure_s3_access(requester_pays=True) api = dc_api.DataAccessApi() dc = datacube.Datacube(app = 'ardc_task_c') api.dc = dc """ Explanation: ARDC Training: Python Notebooks Task-C: Fracti...
ayush29feb/cs231n
assignment2/Dropout.ipynb
mit
# 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 ...
sympy/scipy-2017-codegen-tutorial
notebooks/55-C-calling-3rd-party-lib.ipynb
bsd-3-clause
import sympy as sym sym.init_printing() args = x, y, z = sym.symbols('x y z') expr = x + sym.exp(2*y + x) + sym.exp(3*z) expr """ Explanation: Generating C code calling a third-party library In this notebook we will look at how we can customize the CCodePrinter to generate C code which calls functions provided by a 3...
gabrielcs/nyc-subway-canvass
recommender.ipynb
mit
import pandas as pd high_schools = pd.read_pickle('pickle/high_schools.p') print(len(high_schools)) high_schools.head() stations_locations = pd.read_pickle('pickle/stations_locations.p') stations_locations.head() stations_traffic = pd.read_pickle('pickle/stations_traffic.p') stations_traffic.head(6) """ Explanation...
xzturn/tensorflow
tensorflow/compiler/xla/g3doc/tutorials/autoclustering_xla.ipynb
apache-2.0
import tensorflow as tf # Check that GPU is available: cf. https://colab.research.google.com/notebooks/gpu.ipynb assert(tf.test.is_gpu_available()) tf.keras.backend.clear_session() tf.config.optimizer.set_jit(False) # Start with XLA disabled. def load_data(): (x_train, y_train), (x_test, y_test) = tf.keras.dataset...
uwdata/ipython-vega-lite
notebooks/Widget.ipynb
bsd-3-clause
from vega import VegaLite VegaLite(spec=spec_with_data) """ Explanation: Static Vega Plot End of explanation """ from vega.widget import VegaWidget widget = VegaWidget(spec=spec_no_data) values = [ dict( x=random.gauss(0.0, 1.0), y=random.gauss(0.0, 1.0), t=0, ) for _ in range(...