repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
karolaya/PDI
PS-05/.ipynb_checkpoints/problem_set_5-checkpoint.ipynb
mit
'''This is a definition script, so we do not have to rewrite code''' import numpy as np import os import cv2 import matplotlib.pyplot as mplt import random import json # set matplotlib to print inline (Jupyter) %matplotlib inline # path prefix pth = '../data/' # files to be used as samples # list *files* holds the...
WomensCodingCircle/CodingCirclePython
Lesson10_Regexs/RegularExpressions.ipynb
mit
import re # To run the examples we are going to use some of the logs from the # django project, a web framework for python django_logs = '''commit 722344ee59fb89ea2cd5b906d61b35f76579de4e Author: Simon Charette <charette.s@gmail.com> Date: Thu May 19 09:31:49 2016 -0400 Refs #24067 -- Fixed contenttypes renam...
ES-DOC/esdoc-jupyterhub
notebooks/nims-kma/cmip6/models/sandbox-3/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-3', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NIMS-KMA Source ID: SANDBOX-3 Topic: Seaice Sub-Topics: Dynamics, Thermodynami...
skdaccess/skdaccess
skdaccess/examples/Demo_SRTM.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt plt.rcParams['figure.dpi'] = 150 import numpy as np from getpass import getpass from skdaccess.geo.srtm.cache import DataFetcher as SDF """ Explanation: The MIT License (MIT)<br> Copyright (c) 2017 Massachusetts Institute of Technology<br> Author: Cody Rude<br> This ...
cougarTech2228/Scouting-2016
notebooks/robocop.ipynb
mit
# Object oriented approach, would have to feed csv data into objects # maybe get rid of this and just use library analysis tools class Robot(object): def __init__(self, name, alliance, auto_points, points): self.name = name self.alliance = alliance self.auto_points = auto_points self.points = points def p...
california-civic-data-coalition/python-calaccess-notebooks
tutorials/first-python-notebook.ipynb
mit
2+2 """ Explanation: First Python Notebook: Scripting your way to the story By Ben Welsh A step-by-step guide to analyzing data with Python and the Jupyter Notebook. This tutorial will teach you how to use computer programming tools to analyze data by exploring contributors to campaigns for and again Proposition 64, a...
henchc/Rediscovering-Text-as-Data
05-Intro-to-SpaCy/01-Intro-to-SpaCy.ipynb
mit
from datascience import * import spacy """ Explanation: SpaCy: Industrial-Strength NLP The tradtional NLP library has always been NLTK. While NLTK is still very useful for linguistics analysis and exporation, spacy has become a nice option for easy and fast implementation of the NLP pipeline. What's the NLP pipeline? ...
phoebe-project/phoebe2-docs
2.2/examples/legacy.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Comparing PHOEBE 2 vs PHOEBE Legacy NOTE: PHOEBE 1.0 legacy is an alternate backend and is not installed with PHOEBE 2. In order to run this backend, you'll need to have PHOEBE 1.0 installed and manually build the python bindings in the phoebe-py directory. Setup Le...
AllenDowney/ModSimPy
notebooks/jump2.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * """ Explanation: Modeling and Simulati...
diegocavalca/Studies
deep-learnining-specialization/1. neural nets and deep learning/week2/Logistic+Regression+with+a+Neural+Network+mindset+v4.ipynb
cc0-1.0
import numpy as np import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage from lr_utils import load_dataset %matplotlib inline """ Explanation: Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a ...
emsi/ml-toolbox
random/catfish/TL_02-1_Fixed feature extraction (CNN Codes vel bottleneck) Max Pooling.ipynb
agpl-3.0
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import zipfile from IPython.display import display, Image from scipy import ndimage from sklearn.linear_model import LogisticRegression from six.moves.urllib.request import urlretrieve from six.moves import cPi...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-2/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-2', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-2 Topic: Landice Sub-Topics: Glaciers, Ice. Properties:...
minireference/noBSLAnotebooks
chapter04_problems.ipynb
mit
# helper code needed for running in colab if 'google.colab' in str(get_ipython()): print('Downloading plot_helpers.py to util/ (only neded for colab') !mkdir util; wget https://raw.githubusercontent.com/minireference/noBSLAnotebooks/master/util/plot_helpers.py -P util # setup SymPy from sympy import * init_pri...
charlesreid1/empirical-model-building
ipython/Factorial - Two-Level Six-Factor Design.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from numpy.random import rand, seed import seaborn as sns import scipy.stats as stats from matplotlib.pyplot import * seed(10) """ Explanation: A Two-Level, Six-Factor Full Factorial Design <br /> <br /> <br /> Table of Contents Introduction Factorial Experi...
srcole/qwm
burrito/Burrito_nonlinear.ipynb
mit
%config InlineBackend.figure_format = 'retina' %matplotlib inline import numpy as np import scipy as sp import matplotlib.pyplot as plt import pandas as pd import statsmodels.api as sm import pandasql import seaborn as sns sns.set_style("white") """ Explanation: San Diego Burrito Analytics: Data characterization Sco...
esa-as/2016-ml-contest
JesperDramsch/Facies_classification_NMM_Split-Jesper.ipynb
apache-2.0
%matplotlib inline import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable from pandas import set_option set_option("display.max_rows", 10) pd.set_option('display.width', 1000) pd.options....
ioggstream/python-course
ansible-101/notebooks/05_inventories.ipynb
agpl-3.0
cd /notebooks/exercise-05 !cat inventory """ Explanation: Inventories Inventories are a fundamental doc entrypoint for our infrastructures. They contain a lot of informations, including: - ansible_user - configuration variables in [group_name:vars] - host grouping eg. by geographical zones in [group_name:children] ...
StingraySoftware/notebooks
Simulator/Simulator Tutorial.ipynb
mit
%load_ext autoreload %autoreload 2 import numpy as np from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Contents This notebook covers the basics of initializing and using the functionalities of simulator class. Various ways of simulating light curves that include 'power law distribution', 'user-...
jdvelasq/pytimeseries
pytimeseries/PyTimeSeries.ipynb
mit
import pytimeseries import pandas import matplotlib """ Explanation: PyTimeSeries Test for pytimeseries package Importamos la librería End of explanation """ tserie = pandas.read_csv('champagne.csv', index_col='Month') print(tserie) """ Explanation: Preparación de los datos pytimeseries recibe una serie de pandas p...
phoebe-project/phoebe2-docs
2.2/examples/contact_spots.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" %matplotlib inline """ Explanation: Contact Binary with Spots Setup Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation ...
zaqwes8811/micro-apps
self_driving/deps/Kalman_and_Bayesian_Filters_in_Python_master/03-Gaussians.ipynb
mit
from __future__ import division, print_function %matplotlib inline #format the book import book_format book_format.set_style() """ Explanation: Table of Contents Probabilities, Gaussians, and Bayes' Theorem End of explanation """ import numpy as np import kf_book.book_plots as book_plots belief = np.array([1, 4, 2...
FiryZeplin/deep-learning
dcgan-svhn/DCGAN.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
tensorflow/examples
courses/udacity_intro_to_tensorflow_lite/tflite_c01_linear_regression.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...
tkurfurst/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...
newsapps/public-notebooks
Red Light Camera Locations.ipynb
mit
few_crashes_url = 'http://www.arcgis.com/sharing/rest/content/items/5a8841f92e4a42999c73e9a07aca0c23/data?f=json&token=lddNjwpwjOibZcyrhJiogNmyjIZmzh-pulx7jPD9c559e05tWo6Qr8eTcP7Deqw_CIDPwZasbNOCSBHfthynf-8WRMmguxHbIFptbZQvnpRupJHSY8Abrz__xUteBS93MitgvoU6AqSN5eDVKRYiUg..' removed_url = 'http://www.arcgis.com/sharing/re...
LucaCanali/Miscellaneous
PLSQL_Neural_Network/MNIST_tensorflow_exp_to_oracle.ipynb
apache-2.0
from __future__ import absolute_import from __future__ import division from __future__ import print_function # Import data from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf flags = tf.app.flags FLAGS = flags.FLAGS flags.DEFINE_string('data_dir', '/tmp/data/', 'Directory for storing da...
ssanderson/pstats-view
examples/ExampleView.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import cProfile from pstatsviewer import StatsViewer from qgrid import nbinstall nbinstall() # Construct two 5000 x 8 frames with random floats. df1 = pd.DataFrame( np.random.randn(5000, 8), columns=[chr(ord('A') + i) for i in range(8)], index=rang...
nickdavidhaynes/python-data-science-intro
week_2/dealing_with_data.ipynb
mit
def to_integer(x): the_sum = 0 for index, val in enumerate(x[::-1]): the_sum += val * 2 ** index return the_sum # [1, 1] == 3 to_integer([1, 0, 0, 0, 1, 1, 0, 1]) """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#Week-2:-Dealing-with-data" data-toc-modified-id="Week-2...
CAChemE/curso-python-datos
notebooks_vacios/022-matplotlib-GeoData-cartopy.ipynb
bsd-3-clause
# Inicializamos una figura con el tamaño que necesitemos # si no la queremos por defecto # Creamos unos ejes con la proyección que queramos # por ejemplo, Mercator # Y lo que queremos representar en el mapa # Tierra # Océanos # Líneas de costa (podemos modificar el color) # Fronteras # Ríos y lagos # Por último, podemo...
dxl0632/deeplearning_nd_udacity
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...
computational-class/computational-communication-2016
code/03.python_intro.ipynb
mit
import random, datetime import numpy as np import pylab as plt import statsmodels.api as sm from scipy.stats import norm from scipy.stats.stats import pearsonr """ Explanation: 数据科学的编程工具 Python使用简介 王成军 wangchengjun@nju.edu.cn 计算传播网 http://computational-communication.com 人生苦短,我用Python。 Python(/ˈpaɪθən/)是一种面向对象、解释型计...
brettavedisian/phys202-2015-work
assignments/assignment05/InteractEx04.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 4 Imports End of explanation """ def random_line(m, b, sigma, size=10): """Create a line y = m*x + b + N(0,si...
enakai00/jupyter_tfbook
Chapter02/MNIST softmax estimation.ipynb
gpl-3.0
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data np.random.seed(20160604) """ Explanation: [MSE-01] モジュールをインポートして、乱数のシードを設定します。 End of explanation """ mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) """ Explanation: ...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session04/Day1/LSSTC-DSFP4-Juric-FrequentistAndBayes-03-Credibility.ipynb
mit
import numpy as np N = 5 Nsamp = 10 ** 6 sigma_x = 2 np.random.seed(0) x = np.random.normal(0, sigma_x, size=(Nsamp, N)) mu_samp = x.mean(1) sig_samp = sigma_x * N ** -0.5 print("{0:.3f} should equal {1:.3f}".format(np.std(mu_samp), sig_samp)) """ Explanation: Frequentism and Bayesianism III: Confidence, Credibilit...
karenlmasters/ComputationalPhysicsUnit
IntroductiontoPython/UserDefinedFunction.ipynb
apache-2.0
import numpy as np import scipy.constants as constants print('Pi = ', constants.pi) h = float(input("Enter the height of the tower (in metres): ")) t = float(input("Enter the time interval (in seconds): ")) s = constants.g*t**2/2 print("The height of the ball is",h-s,"meters") """ Explanation: User Defined Functions ...
ilyankou/passport-index-dataset
Update.ipynb
mit
import requests import pandas as pd import json codes = pd.read_csv( 'https://gist.githubusercontent.com/ilyankou/b2580c632bdea4af2309dcaa69860013/raw/420fb417bcd17d833156efdf64ce8a1c3ceb2691/country-codes', dtype=str ).fillna('NA').set_index('ISO2') def fix_iso2(x): o = { 'UK': 'GB', 'RK'...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/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', 'mohc', 'sandbox-1', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: MOHC Source ID: SANDBOX-1 Sub-Topics: Radiative Forcings. Properties: 85 (42 ...
awjuliani/DeepRL-Agents
Policy-Network.ipynb
mit
from __future__ import division import numpy as np try: import cPickle as pickle except: import pickle import tensorflow as tf %matplotlib inline import matplotlib.pyplot as plt import math try: xrange = xrange except: xrange = range """ Explanation: Simple Reinforcement Learning in Tensorflow Part 2...
CLEpy/CLEpy-MotM
Scrapy_nb/Quotes base case.ipynb
mit
# Settings for notebook from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" # Show Python version import platform platform.python_version() try: import scrapy except: !pip install scrapy import scrapy from scrapy.crawler import CrawlerProcess """ Ex...
scraperwiki/databaker
databaker/tutorial/Introduction.ipynb
agpl-3.0
from databaker.framework import * tab = loadxlstabs("example1.xls", "beatles", verbose=False)[0] savepreviewhtml(tab, verbose=False) """ Explanation: Introduction Databaker is an Open Source Python library for converting semi-structured spreadsheets into computer-friendly datatables. The resulting data can be store...
rishuatgithub/MLPy
torch/PYTORCH_NOTEBOOKS/03-CNN-Convolutional-Neural-Networks/06-CNN-Exercises-Solutions.ipynb
apache-2.0
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from torchvision import datasets, transforms from torchvision.utils import make_grid import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline transform = transforms.ToTensor() t...
AllenDowney/ThinkStats2
code/chap04ex.ipynb
gpl-3.0
import numpy as np 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/ThinkStats...
computational-class/computational-communication-2016
code/09.machine_learning_with_sklearn.ipynb
mit
%matplotlib inline from sklearn import datasets from sklearn import linear_model import matplotlib.pyplot as plt from sklearn.metrics import classification_report from sklearn.preprocessing import scale import sklearn print sklearn.__version__ # boston data boston = datasets.load_boston() y = boston.target X = bosto...
saturn77/CythonBootstrap
.ipynb_checkpoints/CythonBootstrap-checkpoint.ipynb
gpl-2.0
%%file ./src/helloCython.pyx import cython import sys def message(): print(" Hello World ....\n") print(" Hello Central Ohio Python User Group ...\n") print(" The 614 > 650::True") print(" Another line ") print(" The Python version is %s" % sys.version) print(" The Cython version is %s" % cyt...
brinkar/real-world-machine-learning
Chapter 3 - Modeling and prediction.ipynb
mit
%pylab inline """ Explanation: Chapter 3 - Modeling and prediction End of explanation """ import pandas data = pandas.read_csv("data/titanic.csv") data[:5] # We make a 80/20% train/test split of the data data_train = data[:int(0.8*len(data))] data_test = data[int(0.8*len(data)):] """ Explanation: The Titanic datas...
tritemio/PyBroMo
notebooks/PyBroMo - 2. Generate smFRET data, including mixtures.ipynb
gpl-2.0
%matplotlib inline from pathlib import Path import numpy as np import tables import matplotlib.pyplot as plt import seaborn as sns import pybromo as pbm print('Numpy version:', np.__version__) print('PyTables version:', tables.__version__) print('PyBroMo version:', pbm.__version__) """ Explanation: PyBroMo - 2. Genera...
GoogleCloudPlatform/tensorflow-without-a-phd
tensorflow-mnist-tutorial/keras_01_mnist.ipynb
apache-2.0
BATCH_SIZE = 128 EPOCHS = 10 training_images_file = 'gs://mnist-public/train-images-idx3-ubyte' training_labels_file = 'gs://mnist-public/train-labels-idx1-ubyte' validation_images_file = 'gs://mnist-public/t10k-images-idx3-ubyte' validation_labels_file = 'gs://mnist-public/t10k-labels-idx1-ubyte' """ Explanation...
BrentDorsey/pipeline
gpu.ml/notebooks/09_Deploy_Optimized_Model.ipynb
apache-2.0
from tensorflow.python.tools import freeze_graph optimize_me_parent_path = '/root/models/optimize_me/linear/cpu' fully_optimized_model_graph_path = '%s/fully_optimized_cpu.pb' % optimize_me_parent_path fully_optimized_frozen_model_graph_path = '%s/fully_optimized_frozen_cpu.pb' % optimize_me_parent_path model_checkp...
ant0nisk/pybrl
docs/Samples/pdf_translation/Notebook.ipynb
gpl-3.0
# Load our dependencies import pybrl as brl filename = "lorem_ipsum.pdf" # of course :P pdf_password = None language = 'english' # Let's translate the PDF file. translated = brl.translatePDF(filename, password = pdf_password, language = language) # Easy, right? # Let's explore what this object looks like: print...
colour-science/colour-hdri
colour_hdri/examples/examples_variance_minimization_light_probe_sampling.ipynb
bsd-3-clause
import os from pprint import pprint import colour from colour_hdri import ( EXAMPLES_RESOURCES_DIRECTORY, light_probe_sampling_variance_minimization_Viriyothai2009, ) from colour_hdri.sampling.variance_minimization import ( find_regions_variance_minimization_Viriyothai2009, highlight_regions_variance_...
AlJohri/DAT-DC-12
notebooks/10_linear_regression_ml.ipynb
mit
# read the data and set the datetime as the index import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (8, 6) plt.rcParams['font.size'] = 14 import pandas as pd urls = ['../data/KDCA-201601.csv', '../data/KDCA-201602.csv', '../data/KDCA-201603.csv'] frames = [pd.read...
drcgw/bass
Single Wave- Basic.ipynb
gpl-3.0
from bass import * """ Explanation: Welcome to BASS! Single Wave Analysis Notebook. This is the basic version. BASS: Biomedical Analysis Software Suite for event detection and signal processing. Copyright (C) 2015 Abigail Dobyns This program is free software: you can redistribute it and/or modify it under the terms ...
KMFleischer/PyEarthScience
Data_Analysis/convert_ascii_to_netcdf.ipynb
mit
import numpy as np from cdo import * import csv """ Explanation: Convert a CSV data to netCDF Read the CSV file, generate the gridfile from the CSV lon and lat data, write data to file. Then use cdo to write the data to an netCDF file. read the ASCII file generate the gridfile write netcdf file Input data data/1901...
OpenAstronomy/workshop_sunpy_astropy
03-python2-functions-instructors.ipynb
mit
# Let's get our import statements out of the way first from __future__ import division, print_function import numpy as np import glob import matplotlib.pyplot as plt %matplotlib inline def kelvin_to_celsius(temp): return temp - 273.15 """ Explanation: Introduction to Python 2 Creating Functions <section class="ob...
cod3licious/simec
00_matrix_factorization.ipynb
mit
from __future__ import unicode_literals, division, print_function, absolute_import import numpy as np np.random.seed(28) import matplotlib.pyplot as plt import tensorflow as tf tf.set_random_seed(28) import keras from simec import SimilarityEncoder %matplotlib inline %load_ext autoreload %autoreload 2 def msqe(A, B)...
piklprado/ode_examples
Qualitative analysis and Bifurcation diagram Tutorial.ipynb
mit
%matplotlib inline from numpy import * from scipy.integrate import odeint from matplotlib.pyplot import * ion() def RM(y, t, r, K, a, h, e, d): return array([ y[0] * ( r*(1-y[0]/K) - a*y[1]/(1+a*h*y[0]) ), y[1] * (e*a*y[0]/(1+a*h*y[0]) - d) ]) t = arange(0, 1000, .1) y0 = [1, 1.] pars = (1., 1...
kongjy/hyperAFM
Tutorials/Image Registration Tutorial.ipynb
mit
#for igor files: !curl -o util.py https://raw.githubusercontent.com/kongjy/hyperAFM/master/hyperAFM/util.py #for image alignment: !curl -o imagealignment.py https://raw.githubusercontent.com/kongjy/hyperAFM/master/hyperAFM/imagealignment.py #the above will download the files at the specified URL and save them as the...
ALEXKIRNAS/DataScience
Python_for_data_analysis/Chapter_11/Chapter_11.ipynb
mit
from pandas import Series, DataFrame import pandas as pd from numpy.random import randn import numpy as np pd.options.display.max_rows = 12 np.set_printoptions(precision=4, suppress=True) import matplotlib.pyplot as plt plt.rc('figure', figsize=(12, 6)) %matplotlib inline """ Explanation: Financial and Economic Data ...
fazzolini/fast_ai
deeplearning1/nbs/lesson4.ipynb
apache-2.0
ratings = pd.read_csv(path+'ratings.csv') ratings.head() len(ratings) """ Explanation: Set up data We're working with the movielens data, which contains one rating per row, like this: End of explanation """ movie_names = pd.read_csv(path+'movies.csv').set_index('movieId')['title'].to_dict users = ratings.userId.un...
usantamaria/iwi131
ipynb/01-Intro1/Introduccion.ipynb
cc0-1.0
a, b = 2, 3 while b < 300: print b, a, b = b, a+b """ Explanation: <header class="w3-container w3-teal"> <img src="images/utfsm.png" alt="" align="left"/> <img src="images/inf.png" alt="" align="right"/> </header> <br/><br/><br/><br/><br/> IWI131 Programación de Computadores Sebastián Flores ¿Qué contenido apr...
bxin/cwfs
examples/AuxTel.ipynb
gpl-3.0
from lsst.cwfs.instrument import Instrument from lsst.cwfs.algorithm import Algorithm from lsst.cwfs.image import Image, readFile, aperture2image, showProjection import lsst.cwfs.plots as plots import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Patrick provided a pair of images fr...
luctrudeau/DaalaNotebooks
CFL/DCT-Domain Subsampling.ipynb
mpl-2.0
%matplotlib inline import sys import y4m import matplotlib.pyplot as plt import numpy as np def decode_y4m_buffer(frame): W, H = frame.headers['W'], frame.headers['H'] Wdiv2, Hdiv2 = W // 2, H // 2 C, buf = frame.headers['C'], frame.buffer A, Adiv2, div2 = W * H, Hdiv2 * Wdiv2, (Hdiv2, Wdiv2) dtyp...
thaophung/Udacity_deep_learning
tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
VectorBlox/PYNQ
docs/source/9_base_overlay_video.ipynb
bsd-3-clause
from pynq import Overlay from pynq.drivers.video import HDMI # Download bitstream Overlay("base.bit").download() # Initialize HDMI as an input device hdmi_in = HDMI('in') """ Explanation: Video using the Base Overlay The PYNQ-Z1 board contains a HDMI input port, and a HDMI output port connected to the FPGA fabric of...
jdhp-docs/python-notebooks
python_super_fr.ipynb
mit
help(super) """ Explanation: Python's super() TODO * https://docs.python.org/3/library/functions.html#super * https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ * https://stackoverflow.com/questions/904036/chain-calling-parent-constructors-in-python * https://stackoverflow.com/questions/2399307/how-to...
FishingOnATree/deep-learning
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that takes in a sequence of letters, an...
oscarmore2/deep-learning-study
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/training-giga-fren/giga-fren.release2.fixed.en' target_path = 'data/training-giga-fren/giga-fren.release2.fixed.fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """...
ktaneishi/deepchem
examples/tutorials/Uncertainty.ipynb
mit
import deepchem as dc import numpy as np import matplotlib.pyplot as plot tasks, datasets, transformers = dc.molnet.load_sampl() train_dataset, valid_dataset, test_dataset = datasets model = dc.models.MultitaskRegressor(len(tasks), 1024, uncertainty=True) model.fit(train_dataset, nb_epoch=200) y_pred, y_std = model.p...
lenovor/notes-on-dirichlet-processes
2015-08-03-nonparametric-latent-dirichlet-allocation.ipynb
mit
%matplotlib inline %precision 2 """ Explanation: I wrote this in an IPython Notebook. You may prefer to view it on nbviewer. End of explanation """ vocabulary = ['see', 'spot', 'run'] num_terms = len(vocabulary) num_topics = 2 # K num_documents = 5 # M mean_document_length = 5 # xi term_dirichlet_parameter = 1 # bet...
Startupsci/data-science-notebooks
.ipynb_checkpoints/titanic-data-science-solutions-refactor-checkpoint.ipynb
mit
# data analysis and wrangling import pandas as pd import numpy as np import random as rnd # visualization import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline # machine learning from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC, LinearSVC from sklearn.ensemble import ...
martinggww/lucasenlights
MachineLearning/DataScience-Python3/CovarianceCorrelation.ipynb
cc0-1.0
%matplotlib inline import numpy as np from pylab import * def de_mean(x): xmean = mean(x) return [xi - xmean for xi in x] def covariance(x, y): n = len(x) return dot(de_mean(x), de_mean(y)) / (n-1) pageSpeeds = np.random.normal(3.0, 1.0, 1000) purchaseAmount = np.random.normal(50.0, 10.0, 1000) sca...
ES-DOC/esdoc-jupyterhub
notebooks/uhh/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', 'uhh', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: UHH Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
cvxgrp/cvxpylayers
examples/tf/data_poisoning_attack.ipynb
apache-2.0
import cvxpy as cp import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from cvxpylayers.tensorflow.cvxpylayer import CvxpyLayer """ Explanation: Data poisoning attack In this notebook, we use a convex optimization layer to perform a data poisoning attack; i.e., we show how to perturb the data ...
google-research/ott
ott/tools/gaussian_mixture/gmm_pair_demo.ipynb
apache-2.0
import typing import numpy as np import matplotlib import matplotlib.pyplot as plt import jax import jax.numpy as jnp from colabtools import adhoc_import import importlib import ott from ott.tools.gaussian_mixture import gaussian_mixture from ott.tools.gaussian_mixture import gaussian_mixture_pair from ott.tools.ga...
osplanning-data-standards/GTFS-PLUS
tools/Tutorial - GTFS to GTFS-PLUS.ipynb
apache-2.0
import os,datetime,shutil import pandas as pd """ Explanation: Tutorial: Quick Translation of GTFS to GTFS-PLUS End of explanation """ GTFS_LINK = r"http://admin.gotransitnc.org/sites/default/files/developergtfs/GoRaleigh_GTFS_0.zip" BASE_DIR = os.getcwd() NEW_FOLDER = "GoRaleigh_GTFS" GTFS_LOC = os.path.join(...
fweik/espresso
doc/tutorials/lattice_boltzmann/lattice_boltzmann_part2.ipynb
gpl-3.0
import numpy as np import logging import sys import espressomd import espressomd.accumulators import espressomd.observables logging.basicConfig(level=logging.INFO, stream=sys.stdout) # Constants KT = 1.1 STEPS = 400000 # System setup system = espressomd.System(box_l=[16] * 3) system.time_step = 0.01 system.cell_sys...
avehtari/BDA_py_demos
demos_ch2/demo2_4.ipynb
gpl-3.0
# Import necessary packages import numpy as np from scipy.stats import beta %matplotlib inline import matplotlib.pyplot as plt import arviz as az # add utilities directory to path import os, sys util_path = os.path.abspath(os.path.join(os.path.pardir, 'utilities_and_data')) if util_path not in sys.path and os.path...
BrainIntensive/OnlineBrainIntensive
resources/matplotlib/Examples/specialplots.ipynb
mit
%load_ext watermark %watermark -u -v -d -p matplotlib,numpy """ Explanation: Sebastian Raschka back to the matplotlib-gallery at https://github.com/rasbt/matplotlib-gallery End of explanation """ %matplotlib inline """ Explanation: <font size="1.5em">More info about the %watermark extension</font> End of explanati...
vasco-da-gama/ros_hadoop
doc/Rosbag larger than 2 GB.ipynb
apache-2.0
%%bash ls -tralFh /root/project/doc/el_camino_north.bag %%bash # same size, no worries, just the -h (human) formating differs in rounding hdfs dfs -ls -h """ Explanation: Let us have a look at a 20 GB Rosbag file Note data can be found for instance at https://github.com/udacity/self-driving-car/tree/master/dataset...
thewtex/ieee-nss-mic-scipy-2014
4_Cython.ipynb
apache-2.0
import numpy as np """ Explanation: Cython The Cython language is a superset of the Python language that additionally supports calling C functions and declaring C types on variables and class attributes. This allows the compiler to generate very efficient C code from Cython code. Write Python code that calls back...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/introduction_to_tensorflow/solutions/adv_logistic_reg_TF2.0.ipynb
apache-2.0
# You can use any Python source file as a module by executing an import statement in some other Python source file. # The import statement combines two operations; it searches for the named module, then it binds the # results of that search to a name in the local scope. import tensorflow as tf from tensorflow import ke...
google/tf-quant-finance
tf_quant_finance/experimental/notebooks/Cashflows_Rate_Curves.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
mne-tools/mne-tools.github.io
0.24/_downloads/b36af73820a7a52a4df3c42b66aef8a5/source_power_spectrum_opm.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Luke Bloy <luke.bloy@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import os.path as op from mne.filter import next_fast_len import mne print(__doc__) data_path = mne.datasets.opm.data_path() subject = 'OPM_sam...
xpmanoj/content
HW5.ipynb
mit
%matplotlib inline import json import numpy as np import networkx as nx import requests from pattern import web import matplotlib.pyplot as plt from bs4 import BeautifulSoup as bs # set some nicer defaults for matplotlib from matplotlib import rcParams #these colors come from colorbrewer2.org. Each is an RGB triple...
Nathx/think_stats
resolved/chap05ex.ipynb
gpl-3.0
from __future__ import print_function, division import thinkstats2 import thinkplot from brfss import * import populations as p import random import pandas as pd import test_models %matplotlib inline """ Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br> Allen Downey End of explanation """ i...
datascience-practice/data-quest
python_introduction/beginner/.ipynb_checkpoints/Functions and Debugging-checkpoint.ipynb
mit
# The story is stored in the file "story.txt". f = open("story.txt", "r") story = f.read() print(story) """ Explanation: 2: Reading the file in Instructions The story is stored in the "story.txt" file. Open the file and read the contents into the story variable. Answer End of explanation """ # We can split strings i...
texib/spark_tutorial
2.ProcessText Data.ipynb
gpl-2.0
urllist = ['http://chahabi77.pixnet.net/blog/post/436715527', 'http://chahabi77.pixnet.net/blog/post/403682269', 'http://chahabi77.pixnet.net/blog/post/354943724', 'http://chahabi77.pixnet.net/blog/post/386442944', 'http://chahabi77.pixnet.net/blog/post/235296791', ...
angelmtenor/deep-learning
tensorboard/Anna_KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
NEONScience/NEON-Data-Skills
tutorials/Python/Hyperspectral/indices/Calc_NDVI_Extract_Spectra_Masks_Tiles_py/Calc_NDVI_Extract_Spectra_Masks_Tiles_py.ipynb
agpl-3.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import warnings warnings.filterwarnings('ignore') #don't display warnings # %load ../neon_aop_hyperspectral.py """ Created on Wed Jun 20 10:34:49 2018 @author: bhass """ import matplotlib.pyplot as plt import numpy as np import h5py, os, copy de...
KitwareMedical/ITKUltrasound
examples/PlotPowerSpectra.ipynb
apache-2.0
import sys !"{sys.executable}" -m pip install itk matplotlib scipy numpy import os import itk import matplotlib.pyplot as plt from scipy import signal import numpy as np """ Explanation: Plot Power Spectra Power spectra are used to analyze the average frequency content across signals in an RF image such as that prod...
joelowj/Udacity-Projects
Udacity-Deep-Learning-Foundation-Nanodegree/Project-1/dlnd-your-first-neural-network.ipynb
apache-2.0
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
mauroalberti/geocouche
pygsf/docs/notebooks/General 2 - orientations.ipynb
gpl-2.0
%load_ext autoreload %autoreload 1 """ Explanation: pygsf 2: vectors and orientations March-April, 2018, Mauro Alberti, alberti.m65@gmail.com Developement code: End of explanation """ %matplotlib inline """ Explanation: 1. Introduction Since we will plot geometric data into stereonets, prior to any other operation,...
bollwyvl/ipylivecoder
examples/Three Little Circles.ipynb
bsd-2-clause
from livecoder.widgets import Livecoder from IPython.utils import traitlets as T """ Explanation: Three Little Circles The "Hello World" (or Maxwell's Equations) of d3, Three Little Circles introduces all of the main concepts in d3, which gives you a pretty good grounding in data visualization, JavaScript, and SVG. Le...
hainesr/tdd-fibonacci-example
walkthrough-notebook.ipynb
bsd-3-clause
import unittest def run_tests(): suite = unittest.TestLoader().loadTestsFromTestCase(TestFibonacci) unittest.TextTestRunner().run(suite) """ Explanation: Agile and Test-Driven Development TDD Worked Example Robert Haines, University of Manchester, UK Adapted from "Test-Driven Development By Example", Kent Bec...
unpingco/Python-for-Probability-Statistics-and-Machine-Learning
chapters/statistics/notebooks/Hypothesis_Testing.ipynb
mit
from __future__ import division %pylab inline """ Explanation: Python for Probability, Statistics, and Machine Learning End of explanation """ %matplotlib inline from matplotlib.pylab import subplots import numpy as np fig,ax=subplots() fig.set_size_inches((6,3)) xi = np.linspace(0,1,50) _=ax.plot(xi, (xi)**5,'-k',...
GoogleCloudPlatform/asl-ml-immersion
notebooks/kubeflow_pipelines/pipelines/solutions/kfp_pipeline_vertex_automl_batch_predictions.ipynb
apache-2.0
import os from google.cloud import aiplatform REGION = "us-central1" PROJECT = !(gcloud config get-value project) PROJECT = PROJECT[0] os.environ["PROJECT"] = PROJECT # Set `PATH` to include the directory containing KFP CLI PATH = %env PATH %env PATH=/home/jupyter/.local/bin:{PATH} """ Explanation: Continuous Trai...
ColeLab/informationtransfermapping
MasterScripts/ManuscriptS5b_PerformanceDecoding_withITE.ipynb
gpl-3.0
import sys import os sys.path.append('utils/') import numpy as np import loadGlasser as lg import scipy.stats as stats import matplotlib.pyplot as plt import statsmodels.sandbox.stats.multicomp as mc import sys import multiprocessing as mp import warnings warnings.filterwarnings('ignore') %matplotlib inline import nib...
SeismicPi/SeismicPi
Lessons/Stethoscope/Piezo Stethoscope.ipynb
mit
import SensDisLib as s plot = s.SensorDisplay() """ Explanation: Piezo Stethoscope In this module we will be creating a sthethoscope to monitor our heartbeats via a piezosensor and learn how log and read data. The idea is that if you tape a contact microphone directly to your skin, it will pick up on your pulse and ge...
mne-tools/mne-tools.github.io
0.22/_downloads/59a29cf7eb53c7ab95857dfb2e3b31ba/plot_40_sensor_locations.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io...
NuGrid/NuPyCEE
regression_tests/Stellab_tests.ipynb
bsd-3-clause
# Import the needed packages import matplotlib import matplotlib.pyplot as plt # Import the observational data module import stellab import sys # Trigger interactive or non-interactive depending on command line argument __RUNIPY__ = sys.argv[0] if __RUNIPY__: %matplotlib inline else: %pylab nbagg """ Explan...