repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
herruzojm/udacity-deep-learning
tv-script-generation/.ipynb_checkpoints/dlnd_tv_script_generation-checkpoint.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...
mbatchkarov/ExpLosion
notebooks/effect_of_adding_noise_to_vectors.ipynb
bsd-3-clause
def plot(d): experiments = Experiment.objects.filter(**d).order_by('expansions__noise') e = [x.id for x in experiments if x.expansions.entries_of is None] print('experiments are', e) for eid in e: print('id %d noise %2.2f, acc %2.2f, macrof1 %2.2f'%(eid, ...
LimeeZ/phys292-2015-work
days/day13/ODEs.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns """ Explanation: Ordinary Differential Equations Learning Objectives: Understand the numerical solution of ODEs and use scipy.integrate.odeint to solve and explore ODEs numerically. Imports End of explanation """ tmax = 10.0 ...
google/physics-math-tutorials
colabs/Binomial Proportion Confidence with Coin Flipping.ipynb
apache-2.0
#@title Interesting Tweet class Tweet(object): def __init__(self, embed_str=None): self.embed_str = embed_str def _repr_html_(self): return self.embed_str s = (""" <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Without doing the math or looking it up, approximately how many coin flip...
henchc/Rediscovering-Text-as-Data
04-Stylometry/01-Ad-Hoc-Stylometry.ipynb
mit
["þæt", "wearð", "underne"] """ Explanation: Stylometry This notebook is designed to reproduce several findings from Emily Thornbury's chapter "The Poet Alone" in her book Becoming a Poet in Anglo-Saxon England. In particular, Fig. 4.5 on page 170. First, however, we're going to think about what we might do with lists...
xray/xray
doc/examples/visualization_gallery.ipynb
apache-2.0
import cartopy.crs as ccrs import matplotlib.pyplot as plt import xarray as xr %matplotlib inline """ Explanation: Visualization Gallery This notebook shows common visualization issues encountered in Xarray. End of explanation """ ds = xr.tutorial.load_dataset('air_temperature') """ Explanation: Load example datase...
weichetaru/weichetaru.github.com
notebook/machine-learning/deep_learning-linear-regression-gradient-decent.ipynb
mit
import numpy import matplotlib.pyplot as plt %matplotlib inline numpy.random.seed(seed=1) x = numpy.random.uniform(0, 1, 20) # real model def f(x): return x * 2 noise_variance = 0.2 # Variance of the gaussian noise # Gaussian noise error for each sample in x noise = numpy.random.randn(x.shape[0]) * noise_varianc...
martinggww/lucasenlights
MachineLearning/DataScience-Python3/SVC.ipynb
cc0-1.0
import numpy as np #Create fake income/age clusters for N people in k clusters def createClusteredData(N, k): pointsPerCluster = float(N)/k X = [] y = [] for i in range (k): incomeCentroid = np.random.uniform(20000.0, 200000.0) ageCentroid = np.random.uniform(20.0, 70.0) for j i...
icrtiou/coursera-ML
ex1-linear regression/2- batch gradient decent.ipynb
mit
%reload_ext autoreload %autoreload 2 %matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import sys sys.path.append('..') from helper import linear_regression as lr # my own module from helper import general as general data = pd.read_csv('ex1data1.txt', n...
Danghor/Algorithms
Python/Chapter-09/Dijkstra-Heap.ipynb
gpl-2.0
%run Heap-Array.ipynb def shortest_path(source, Edges): Distance = { source: 0 } Visited = { source } # this set is only needed for visualization Fringe = [] # priority queue, organized as array based heap insert(Fringe, (0, source)) while Fringe != []: display(heapToDot(Fringe...
moble/MatchedFiltering
GW150914/HybridizeNR_GW151226.ipynb
mit
metadata = read_metadata_into_object(data_dir + '/metadata.txt') m1 = metadata.relaxed_mass1 m2 = metadata.relaxed_mass2 chi1 = np.array(metadata.relaxed_spin1) / m1**2 chi2 = np.array(metadata.relaxed_spin2) / m2**2 # I guess(...) that the units on the metadata quantity are just those of M*Omega, so I'll divide by M...
sassoftware/sas-viya-programming
python/karate-club/Zachary's Karate Club Social Network Analysis using CAS HyperGroup.ipynb
apache-2.0
import swat import time import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cmx # Also import networkx used for rendering a network import networkx as nx %matplotlib inline """ Explanation: A simple pipeline using hypergroup to perform com...
Nikolay-Lysenko/dsawl
docs/stacking_demo.ipynb
mit
from sklearn.datasets import load_boston from sklearn.metrics import r2_score from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.neighbors import KNeighborsRegressor from sklearn.ensemble import RandomForestRegressor from dsawl.stacking import Stacking...
adrn/AASAbstractSorter
notebooks/AAS abstract similarity.ipynb
mit
# Standard lib import re import pickle from collections import OrderedDict from datetime import datetime # Third-party from sqlalchemy import create_engine import numpy as np import matplotlib.pyplot as pl %matplotlib inline from sklearn.feature_extraction import text from sklearn.utils.extmath import cartesian impor...
me-surrey/dl-gym
10_introduction_to_artificial_neural_networks.ipynb
apache-2.0
# To support both python 2 and python 3 from __future__ import division, print_function, unicode_literals # Common imports import numpy as np import os # to make this notebook's output stable across runs def reset_graph(seed=42): tf.reset_default_graph() tf.set_random_seed(seed) np.random.seed(seed) # To...
haltaro/predicting-comic-end
0_obtain_comic_data_j.ipynb
mit
import json import urllib.request from time import sleep """ Explanation: 0. Web APIを用いた目次情報の取得 文化庁メディア芸術データベース マンガ分野 WebAPIを用いて,分析に必要なデータを入手します.なお,python3を使ったweb APIの利用については,Python3でjsonを返却するwebAPIにアクセスして結果を出力するまでを参考にさせて頂きました. 環境構築 bash conda env create -f env.yml 準備 End of explanation """ def search_magazine(key='...
elsdrm/shared_note
Parallel Monte Carlo Option Pricing.ipynb
mit
%pylab inline import sys import time from IPython.parallel import Client import numpy as np """ Explanation: Parallel Monto-Carlo options pricing This notebook shows how to use IPython.parallel to do Monte-Carlo options pricing in parallel. We will compute the price of a large number of options for different strike p...
jeffsilverm/presentation
SeaGL-2018/3d_scatter.ipynb
gpl-2.0
import plotly.plotly as py import plotly.graph_objs as go import numpy as np x, y, z = np.random.multivariate_normal(np.array([0,0,0]), np.eye(3), 200).transpose() trace1 = go.Scatter3d( x=x, y=y, z=z, mode='markers', marker=dict( size=12, line=dict( color='rgba(217, 21...
jhseu/tensorflow
tensorflow/lite/g3doc/performance/post_training_integer_quant.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...
jpilgram/phys202-2015-work
days/day13/ODEs.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns """ Explanation: Ordinary Differential Equations Learning Objectives: Understand the numerical solution of ODEs and use scipy.integrate.odeint to solve and explore ODEs numerically. Imports End of explanation """ tmax = 10.0 ...
open2c/bioframe
docs/guide-io.ipynb
mit
import bioframe """ Explanation: Reading genomic dataframes End of explanation """ df = bioframe.read_table( 'https://www.encodeproject.org/files/ENCFF001XKR/@@download/ENCFF001XKR.bed.gz', schema='bed9' ) display(df[0:3]) df = bioframe.read_table( "https://www.encodeproject.org/files/ENCFF401MQL/@@dow...
oresat/oresat-ground-station
eb-ground-station/structure/independent-structure-design/loadAnalysis.ipynb
gpl-3.0
import numpy as np import sys import matplotlib.pyplot as plt import sympy as sym import pandas as pd import magnitude as mag from magnitude import mg mag.new_mag('lbm', mag.Magnitude(0.45359237, kg=1)) mag.new_mag('lbf', mg(4.4482216152605, 'N')) mag.new_mag('mph', mg(0.44704, 'm/s')) mag.new_mag('slug', mg(1,'lbf')/m...
Adamage/python-training
Lesson_03_loops_flow_control_exceptions.ipynb
apache-2.0
for i in range(0,100): pass """ Explanation: Python Training - Lesson 3 - loops, flow control and exceptions Now that we have seen some basics in action, let's summarize what we should already know by this point: - types and their methods - classes and objects - simple condition checks with "if" - using importe...
IIPBC/Material
machine_learning_Nina/Exercise3-1.ipynb
mit
import matplotlib.pyplot as plt %matplotlib inline import numpy as np # draw N random points in the [0,1]x[0,1] square N = 100 x1 = np.random.rand(N) x2 = np.random.rand(N) X = np.vstack(zip(np.ones(N),x1, x2)) print X.shape # use cosine to define positive and negative classes y = np.array([1 if np.cos(2*np.pi*X[i,1...
brettavedisian/phys202-2015-work
assignments/assignment06/DisplayEx01.ipynb
mit
from IPython.display import display from IPython.display import Image assert True # leave this to grade the import statements """ Explanation: Display Exercise 1 Imports Put any needed imports needed to display rich output the following cell: End of explanation """ Image(url='http://easyscienceforkids.com/wp-conten...
tensorflow/docs-l10n
site/ko/hub/tutorials/image_enhancing.ipynb
apache-2.0
# Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
GoogleCloudPlatform/asl-ml-immersion
notebooks/tfx_pipelines/cicd/solutions/tfx_cicd.ipynb
apache-2.0
import yaml # Set `PATH` to include the directory containing TFX CLI. PATH = %env PATH %env PATH=/home/jupyter/.local/bin:{PATH} !python -c "import tfx; print('TFX version: {}'.format(tfx.__version__))" """ Explanation: CI/CD for TFX pipelines Learning Objectives Develop a CI/CD workflow with Cloud Build to build a...
chemelnucfin/tensorflow
tensorflow/contrib/autograph/examples/notebooks/algorithms.ipynb
apache-2.0
!pip install -U -q tf-nightly-2.0-preview import tensorflow as tf tf = tf.compat.v2 tf.enable_v2_behavior() """ Explanation: AutoGraph: examples of simple algorithms This notebook shows how you can use AutoGraph to compile simple algorithms and run them in TensorFlow. It requires the nightly build of TensorFlow, whi...
eshlykov/mipt-day-after-day
optimizaion/kaggle/eshlykov-kaggle.ipynb
unlicense
# Выделяем outdoor'ы и indoor'ы. sample_out = sample[result[:, 0] == 1] sample_in = sample[result[:, 1] == 1] result_out = result[result[:, 0] == 1] result_in = result[result[:, 1] == 1] # Считаем размер indoor- и outdoor-частей в train'е. train_size_in = int(sample_in.shape[0] * 0.75) train_size_out = int(sample_out....
ES-DOC/esdoc-jupyterhub
notebooks/nuist/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NUIST Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Bal...
ComputationalModeling/spring-2017-danielak
past-semesters/fall_2016/day-by-day/day08-modeling-viral-load-day1/viral_load_model_STUDENT.ipynb
agpl-3.0
# some code to set up the problem. # Make plots inline %matplotlib inline # Make inline plots vector graphics instead of raster graphics from IPython.display import set_matplotlib_formats set_matplotlib_formats('pdf', 'svg') # import modules for plotting and data analysis import matplotlib.pyplot as plt import numpy...
awjuliani/DeepRL-Agents
Q-Exploration.ipynb
mit
from __future__ import division import gym import numpy as np import random import tensorflow as tf import matplotlib.pyplot as plt %matplotlib inline import tensorflow.contrib.slim as slim """ Explanation: Simple Reinforcement Learning: Exploration Strategies This notebook contains implementations of various action...
oditorium/blog
iPython/MCRisk1-LargePoolCap.ipynb
agpl-3.0
import numpy as np import matplotlib.pyplot as plt """ Explanation: iPython Cookbook - Monte Carlo Risk Analysis - Large Pool Capital Model Looking at the Large Pool Capital Model and idiosyncratic risks on top of it Set-up End of explanation """ from scipy.stats import norm from functools import partial from oper...
jinntrance/MOOC
coursera/deep-neural-network/quiz and assignments/NLP and Word Embedding/Emojify+-+v2.ipynb
cc0-1.0
import numpy as np from emo_utils import * import emoji import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier. Have you ever wanted to make your text messages more expressive? You...
harpolea/CMG_testing_workshop
Testing-presentation.ipynb
mit
def normalise(v): norm = numpy.sqrt(numpy.sum(v**2)) return v / norm normalise(numpy.array([0,0])) """ Explanation: <center> bit.ly/2nDtVj6 </center> Testing Scientific Codes Why do we test? In the experimental Sciences, new theories are developed by applying the Scientific method Perform tests to demon...
JoseGuzman/myIPythonNotebooks
Stochastic_systems/NaiveBayesanClassifier.ipynb
gpl-2.0
%pylab inline import pandas as pd # first row contains units df = pd.read_excel(io='../data/Cell_types.xlsx', sheetname='PFC', skiprows=1) del df['CellID'] # remove column with cell IDs df.head() # show first elements """ Explanation: <H1> Naive Bayesan classifier</H1> <H2>Bayesan theorem</H2> We will try to comp...
Aniruddha-Tapas/Applied-Machine-Learning
Machine Learning using GraphLab/Recommender Systems using Affinity Analysis.ipynb
mit
ratings_filename = "data/ml-100k/u.data" import pandas as pd all_ratings = pd.read_csv(ratings_filename, delimiter="\t", header=None, names = ["UserID", "MovieID", "Rating", "Datetime"]) all_ratings["Datetime"] = pd.to_datetime(all_ratings['Datetime'],unit='s') all_ratings[:5] """ Explanation: Recommender Systems us...
DiXiT-eu/collatex-tutorial
unit6/Normalization.ipynb
gpl-3.0
from collatex import * collation = Collation() collation.add_plain_witness('A', 'Look, a koala!') collation.add_plain_witness('B', 'Look, Koala!') alignment_table = collate(collation, segmentation=False) print(alignment_table) """ Explanation: Normalization At the alignment stage, CollateX identifies the tokens to ali...
arasdar/DL
udacity-dl/RNN/tv-script-generation/dlnd_tv_script_generation.ipynb
unlicense
""" 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...
JoseGuzman/myIPythonNotebooks
tests/Multivariate regression.ipynb
gpl-2.0
%pylab inline import pandas as pd mypath = 'Cell_types.xlsx' xls = pd.read_excel(mypath) xls.head() xls.InputR xls['Vrest'].mean() xls['Vrest'].unique() # get NumPy array """ Explanation: <H1>Multivariate regression</H1> End of explanation """ x = xls[['InputR', 'SagRatio','mbTau']] y = xls[['Vrest']] # impor...
stinebuu/nest-simulator
doc/userdoc/model_details/noise_generator.ipynb
gpl-2.0
import sympy sympy.init_printing() x = sympy.Symbol('x') sympy.series((1-sympy.exp(-x))/(1+sympy.exp(-x)), x) """ Explanation: The NEST noise_generator Hans Ekkehard Plesser, 2015-06-25 This notebook describes how the NEST noise_generator model works and what effect it has on model neurons. NEST needs to be in your PY...
ozorich/phys202-2015-work
assignments/assignment10/ODEsEx03.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.integrate import odeint from IPython.html.widgets import interact, fixed """ Explanation: Ordinary Differential Equations Exercise 3 Imports End of explanation """ g = 9.81 # m/s^2 l = 0.5 # length of pendulum...
ES-DOC/esdoc-jupyterhub
notebooks/pcmdi/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'pcmdi', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: PCMDI Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Con...
google/applied-machine-learning-intensive
content/03_regression/08_regression_with_tensorflow/colab.ipynb
apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
bkimo/discrete-math-with-python
lab1-truth_table.ipynb
mit
for p in (True, False): for q in (True, False): print("%10s %10s %10s" %(p, q, (p and q))) """ Explanation: Content provided under a Creative Commons Attribution license, CC-BY 4.0. Bong-Sik Kim. (25 September, 2016) Fundamentals of Logic The connection between logic, proofs and programming is a very rich ...
ES-DOC/esdoc-jupyterhub
notebooks/cams/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', 'cams', 'sandbox-1', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: CAMS Source ID: SANDBOX-1 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
ddemidov/mba
python/layered.ipynb
mit
def foo(c): return sin(c[0]/100) + sin(c[1]*3) cmin = [0.0, 0.0] cmax = [1000.0, 10.0] C = mgrid[0:cmax[0]:1e-1,0:cmax[1]:1e-1] F = foo(C) coo = uniform(cmin, cmax, (128,2)) val = foo(coo.transpose()) figure(figsize=(13,4)) pcolormesh(C[0], C[1], F) scatter(coo[:,0], coo[:,1], c='k', s=1) xlim([cmin[0], cmax[0]...
Amarchuk/2FInstability
notebooks/2f/photometry_tests.ipynb
gpl-3.0
mu_eff = 18.37 r_eff = 8.8 n = 2.3 MyTest.test2 = lambda self: self.assertAlmostEqual(mu_bulge(10., mu_eff=mu_eff, r_eff=r_eff, n=n), mu_bulge2(10., mu_eff=mu_eff, r_eff=r_eff, n=n), places=3) """ Explanation: <div class="alert alert-success"> <h5>TEST:</h5>Тест ...
rajuniit/udacity
my_first_neural_network_project.ipynb
mit
%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...
h-mayorquin/time_series_basic
presentations/2016-03-11(Nexa Wall Street Columns High Resolution - Visualizing Receptive Fields and Data Clusters).ipynb
bsd-3-clause
import h5py import sys sys.path.append("../") import matplotlib.pyplot as plt %matplotlib inline from visualization.data_clustering import visualize_data_cluster_text_to_image_columns """ Explanation: Nexa Well Street Columns High Resolution (30 x 30). Visualizing Receptive Fields and Data Clusters. In this notebook...
jpallas/beakerx
doc/python/TableAPI.ipynb
apache-2.0
import pandas as pd from beakerx import * pd.read_csv('../resources/data/interest-rates.csv') table = TableDisplay(pd.read_csv('../resources/data/interest-rates.csv')) table.setAlignmentProviderForColumn('m3', TableDisplayAlignmentProvider.CENTER_ALIGNMENT) table.setRendererForColumn("y10", TableDisplayCellRenderer.g...
shreyas111/Multimedia_CS523_Project1
Style_Transfer_Without_Calculating_Denoising_Loss.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import PIL.Image """ Explanation: Style Transfer Our Changes: We have modified the code such that the denoise_loss for the mixed image is not calculated. The total loss does not include the denoise loss. The gradient is reduc...
fonnesbeck/scientific-python-workshop
notebooks/Statistical Data Modeling.ipynb
cc0-1.0
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set() """ Explanation: Statistical Data Modeling Pandas, NumPy and SciPy provide the core functionality for building statistical models of our data. We use models to: Concisely describe the components o...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/ukesm1-0-mmh/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-mmh', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: MOHC Source ID: UKESM1-0-MMH Topic: Atmos Sub-Topics: Dynamical Core, Radiation, ...
clauwag/WikipediaGenderInequality
notebooks/Notability - 02 - Generate Person Data.ipynb
mit
from __future__ import print_function, unicode_literals import pandas as pd import gzip import csv import regex as re import json import time import datetime import requests import os import json import dbpedia_config from collections import Counter, defaultdict from cytoolz import partition_all from dbpedia_utils im...
tensorflow/hub
examples/colab/text_to_video_retrieval_with_s3d_milnce.ipynb
apache-2.0
!pip install -q opencv-python import os import tensorflow.compat.v2 as tf import tensorflow_hub as hub import numpy as np import cv2 from IPython import display import math """ Explanation: Text-to-Video retrieval with S3D MIL-NCE <table class="tfo-notebook-buttons" align="left"> <td> <a target="_blank" href=...
Britefury/deep-learning-tutorial-pydata2016
TUTORIAL 05 - Dogs vs cats with standard learning.ipynb
mit
%matplotlib inline """ Explanation: Dogs vs Cats with Standard Learning In this Notebook we're going to use standard learning to attempt to crack the Dogs vs Cats Kaggle competition. We are going to downsample the images to 64x64; that's pretty small, but should be enough (I hope). Furthermore, large images means long...
pdamodaran/yellowbrick
examples/pdamodaran/feature_visualizer.ipynb
apache-2.0
import os import sys # Modify the path sys.path.append("..") import pandas as pd import yellowbrick as yb import matplotlib.pyplot as plt g = yb.anscombe() """ Explanation: Feature Visualizer This notebook provides examples of visualizations done in other data studies and modifies them using the Yellowbrick libr...
teuben/pitp2016
yt-demo/example3.ipynb
gpl-3.0
ds = yt.load("../data/virgo_novisc.0054.gdf") """ Explanation: <p>1. Load the `"virgo_novisc.0054.gdf"` dataset from the `"data"` directory.</p> End of explanation """ slc = yt.SlicePlot(ds, "y", ["temperature"], width=(0.4, "Mpc")) slc.set_cmap("temperature", "algae") slc.annotate_magnetic_field() """ Explanation:...
eblur/AstroHackWeek2015
day3-machine-learning/05 - Cross-validation.ipynb
gpl-2.0
from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target from sklearn.cross_validation import cross_val_score from sklearn.svm import LinearSVC cross_val_score(LinearSVC(), X, y, cv=5) cross_val_score(LinearSVC(), X, y, cv=5, scoring="f1_macro") """ Explanation: Cross-Validation <img...
jegibbs/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...
AllenDowney/ModSimPy
soln/chap14soln.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...
mne-tools/mne-tools.github.io
stable/_downloads/6965b7b1a563cc32b2b5388d95203d43/60_cluster_rmANOVA_spatiotemporal.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Eric Larson <larson.eric.d@gmail.com> # Denis Engemannn <denis.engemann@gmail.com> # # License: BSD-3-Clause import os.path as op import numpy as np from numpy.random import randn import matplotlib.pyplot as plt import mne from mne.stats ...
bjshaw/phys202-2015-work
assignments/assignment05/InteractEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 3 Imports End of explanation """ def soliton(x, t, c, a): """Return phi(x, t) for a soliton wave with co...
mirjalil/DataScience
python-stuff/regular-expression.ipynb
gpl-2.0
import re emaildata = open('enron-email-dataset.txt') for line in emaildata: line = line.rstrip() if re.search('^From:', line): print(line) x = 'Team A beat team B 38-7. That was the greatest record for team A since 1987.' y = re.findall('[0-9]+', x) y """ Explanation: Regular Expression | ...
ecabreragranado/OpticaFisicaII
Interferencia Múltiples Ondas/.ipynb_checkpoints/InterferenciaMultiplesOndas-checkpoint.ipynb
gpl-3.0
from IPython.core.display import Image Image("http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Multiple_beam_interference.png/580px-Multiple_beam_interference.png") """ Explanation: Interferencia por haces múltiples. Filtros interferenciales. El siguiente notebook explica la irradiancia obtenida en transmisión...
GoogleCloudPlatform/tf-estimator-tutorials
03_Clustering/03.0 - TF k-means - Experiment API.ipynb
apache-2.0
train_data_files = ['data/train-data.csv'] test_data_files = ['data/test-data.csv'] model_name = 'clust-model-02' resume = False train = True preprocess_features = False extend_feature_colums = False """ Explanation: Steps to use the TF Experiment API Define dataset metadata Define data input function to read the d...
google-research/google-research
group_agnostic_fairness/data_utils/CreateLawSchoolDatasetFiles.ipynb
apache-2.0
from __future__ import division import pandas as pd import numpy as np import json import os,sys import seaborn as sns import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import numpy as np """ Explanation: Copyright 2020 Google LLC. Licensed under the Apache License, Version 2.0 (the ...
SylvainCorlay/ipywidgets
docs/source/examples/Widget List.ipynb
bsd-3-clause
import ipywidgets as widgets """ Explanation: Index - Back - Next Widget List End of explanation """ widgets.IntSlider( value=7, min=0, max=10, step=1, description='Test:', disabled=False, continuous_update=False, orientation='horizontal', readout=True, readout_format='d' ) "...
JoaoFelipe/snowballing
snowballing/example/Progress.ipynb
mit
import database from datetime import datetime from snowballing.operations import load_work, reload from snowballing.jupyter_utils import work_button, idisplay reload() """ Explanation: Index Work WorkOk WorkSnowball Forward Snowballing Other WorkUnrelated WorkNoFile WorkLang End of explanation """ reload() query = ...
AEW2015/PYNQ_PR_Overlay
Pynq-Z1/notebooks/examples/pmod_grove_pir.ipynb
bsd-3-clause
from time import sleep from pynq import Overlay from pynq.board import LED from pynq.iop import Grove_PIR from pynq.iop import PMODA from pynq.iop import PMOD_GROVE_G1 ol1 = Overlay("base.bit") ol1.download() pir = Grove_PIR(PMODA,PMOD_GROVE_G1) """ Explanation: PMOD Grove PIR Motion Sensor This examples shows how t...
netodeolino/TCC
TCC 02/Resultados/Abril/Abril.ipynb
mit
all_crime_tipos.head(10) all_crime_tipos_top10 = all_crime_tipos.head(10) all_crime_tipos_top10.plot(kind='barh', figsize=(12,6), color='#3f3fff') plt.title('Top 10 crimes por tipo (Abr 2017)') plt.xlabel('Número de crimes') plt.ylabel('Crime') plt.tight_layout() ax = plt.gca() ax.xaxis.set_major_formatter(ticker.StrM...
fonnesbeck/scientific-python-workshop
notebooks/Scikit Learn.ipynb
cc0-1.0
from sklearn.datasets import load_iris iris = load_iris() iris.keys() n_samples, n_features = iris.data.shape n_samples, n_features iris.data[0] """ Explanation: Introduction to Scikit-learn The scikit-learn package is an open-source library that provides a robust set of machine learning algorithms for Python. It i...
bourneli/deep-learning-notes
DAT236x Deep Learning Explained/Lab2_LogisticRegression.ipynb
mit
# Figure 1 Image(url= "http://3.bp.blogspot.com/_UpN7DfJA0j4/TJtUBWPk0SI/AAAAAAAAABY/oWPMtmqJn3k/s1600/mnist_originals.png", width=200, height=200) """ Explanation: Lab 2 - Logistic Regression (LR) with MNIST This lab corresponds to Module 2 of the "Deep Learning Explained" course. We assume that you have successfully...
kadrlica/skymap
tutorial/chapter2_skymap_subclasses.ipynb
mit
# Basic notebook imports %matplotlib inline import matplotlib import pylab as plt import numpy as np import healpy as hp """ Explanation: <center> Go back to the Index </center> Chapter 2: Skymap Subclasses In this chapter we introduce the subclasses of skymap.Skymap and explore some of their features for astronom...
BiG-CZ/notebook_data_demo
notebooks/2017-06-24-odm2api_sample_fromsqlite.ipynb
bsd-3-clause
import os from odm2api.ODMconnection import dbconnection odm2db_fpth = os.path.join('data', 'ODM2.sqlite') session_factory = dbconnection.createConnection('sqlite', odm2db_fpth, 2.0) """ Explanation: odm2api demo with Little Bear SQLite sample DB Largely from https://github.com/ODM2/ODM2PythonAPI/blob/master/Example...
dataventures/workshops
0/Pandas Intro.ipynb
mit
# General syntax to import specific functions in a library: ##from (library) import (specific library function) from pandas import DataFrame, read_csv # General syntax to import a library but no functions: ##import (library) as (give the library a nickname/alias) import matplotlib.pyplot as plt import pandas as pd #...
awhite40/pymks
notebooks/Ising model.ipynb
mit
from pymks_share import DataManager import numpy as np manager = DataManager('pymks.me.gatech.edu') X = manager.fetch_data('2 phase ising model') Y = manager.fetch_data('Ising 30%') Z = manager.fetch_data('ising 10%') R1 = manager.fetch_data('Ising 40%_Run#1') R2 = manager.fetch_data('Ising 40%_Run#3') X.shape, R1.sha...
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/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', 'fio-ronm', 'sandbox-2', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-2 Topic: Landice Sub-Topics: Glaciers, Ice. Pro...
science-of-imagination/nengo-buffer
Project/trained_mental_scaling_ens.ipynb
gpl-3.0
import nengo import numpy as np import cPickle from nengo_extras.data import load_mnist from nengo_extras.vision import Gabor, Mask from matplotlib import pylab import matplotlib.pyplot as plt import matplotlib.animation as animation """ Explanation: Using the trained weights in an ensemble of neurons On the function...
tensorflow/docs-l10n
site/en-snapshot/lite/performance/post_training_quant.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...
google/earthengine-api
python/examples/ipynb/ee-api-colab-setup.ipynb
apache-2.0
import ee """ Explanation: <table class="ee-notebook-buttons" align="left"><td> <a target="_blank" href="http://colab.research.google.com/github/google/earthengine-api/blob/master/python/examples/ipynb/ee-api-colab-setup.ipynb"> <img src="https://www.tensorflow.org/images/colab_logo_32px.png" /> Run in Google Col...
quantumlib/ReCirq
docs/quantum_chess/quantum_chess_client.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...
infilect/ml-course1
keras-notebooks/RNN/7.2 LSTM for Sentence Generation.ipynb
mit
from keras.optimizers import SGD from keras.preprocessing.text import one_hot, text_to_word_sequence from keras.utils import np_utils from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.layers.embeddings import Embedding from keras.layers.recurrent import LSTM, GRU fr...
datactive/bigbang
examples/experimental_notebooks/Testing Power Law Response Time Hypothesis.ipynb
mit
from bigbang.archive import Archive import pandas as pd arx = Archive("ipython-dev",archive_dir="../archives") print(arx.data.shape) arx.data.drop_duplicates(subset=('From','Date'),inplace=True) """ Explanation: An early result in the study of human dynamic systems is the claim that response times to email follow a ...
peterwittek/ipython-notebooks
Multipartite_entanglement.ipynb
gpl-3.0
import warnings from numpy import array, cos, dot, equal, kron, mod, pi, random, real, \ reshape, sin, sqrt, zeros from qutip import expect, basis, qeye, sigmax, sigmay, sigmaz, tensor from scipy.optimize import minimize from ncpol2sdpa import SdpRelaxation, generate_variables, flatten, \ generate_measurements,...
facaiy/book_notes
Mining_of_Massive_Datasets/Mining_Social_Network_Graphs/note.ipynb
cc0-1.0
plt.imshow(plt.imread('./res/fig10_1.png')) """ Explanation: 10 Mining Social-Network Graphs how to identify "communities"? communities: strong connections, usually overlap. explore efficient algorithms for discovering other properities of graphs. 10.1 Social Networks as Graphs 10.1.1 What is a Social Netw...
mrcslws/nupic.research
projects/archive/dynamic_sparse/notebooks/ExperimentAnalysis-MNISTSparser.ipynb
agpl-3.0
%load_ext autoreload %autoreload 2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands import * from nupic.research.frameworks.dynamic...
CINPLA/exdir
tests/benchmarks/benchmarks.ipynb
mit
import exdir import os import shutil import h5py def setup_exdir(): testpath = "test.exdir" if os.path.exists(testpath): shutil.rmtree(testpath) f = exdir.File(testpath) return f, testpath def setup_exdir_no_validation(): testpath = "test.exdir" if os.path.exists(testpath): shu...
phoebe-project/phoebe2-docs
2.2/examples/minimal_contact_binary.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Minimal Contact Binary System 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 """ %matplotli...
topologicalbudapest/topins2
HgTe_edge_proximity.ipynb
gpl-2.0
#here we define sympy symbols to be used in the analytic calculations g,mu,b,D,k=sympy.symbols('gamma mu B Delta k',real=True) """ Explanation: HgTe edge in proximity to an s-wave superconductor End of explanation """ # onsite and hopping terms U=sympy.Matrix([[-mu+b,g,0,D], [g,-mu-b,-D,0], ...
fmeynadier/allantools
examples/gradev-demo.ipynb
lgpl-3.0
%matplotlib inline import pylab as plt import numpy as np import allantools """ Explanation: GRADEV: gap robust allan deviation Notebook setup & package imports End of explanation """ def example1(): """ Compute the GRADEV of a white phase noise. Compares two different scenarios. 1) The original data a...
mne-tools/mne-tools.github.io
0.23/_downloads/066ec12646ce0d0818ad9b78bc602218/fdr_stats_evoked.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import numpy as np from scipy import stats import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import sample from mne.stats import bonferroni_correction, fdr_correction print(__doc__) """ Explanation:...
mjones01/NEON-Data-Skills
code/Python/remote-sensing/hyperspectral-data/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...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/machine_learning_in_the_enterprise/labs/sdk_custom_tabular_regression_online_explain.ipynb
apache-2.0
import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex SDK: Custom Training Tabular Regression Models for Online Prediction and Explainability ...
goodwordalchemy/thinkstats_notes_and_exercises
code/.ipynb_checkpoints/chap05soln-checkpoint.ipynb
gpl-3.0
from __future__ import print_function, division """ Explanation: Exercise from Think Stats, 2nd Edition (thinkstats2.com)<br> Allen Downey End of explanation """ import scipy.stats %matplotlib inline """ Explanation: Exercise 5.1 <tt>scipy.stats</tt> contains objects that represent analytic distributions End of ex...
tpin3694/tpin3694.github.io
python/cartesian_product.ipynb
mit
# import pandas as pd import pandas as pd """ Explanation: Title: Cartesian Product Slug: cartesian_product Summary: Cartesian Product Date: 2016-05-01 12:00 Category: Python Tags: Basics Authors: Chris Albon Preliminaries End of explanation """ # Create two lists i = [1,2,3,4,5] j = [1,2,3,4,5] """ Explanation: ...
Krastanov/cutiepy
examples/Schroedinger_Equation_Solver_Examples.ipynb
bsd-3-clause
from cutiepy import * %matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Table of Contents Rabi Oscillations Simulating the Full Hamiltonian With Rotating Wave Approximation Coherent State in a Harmonic Oscillator Jaynes-Cummings Revival Definite Photon State Coherent State End o...
ibm-cds-labs/pixiedust
notebook/PixieDust 3 - Scala and Python.ipynb
apache-2.0
pythonString = "Hello From Python" pythonInt = 20 """ Explanation: Mixing Scala and Python on the same Notebook Python has a rich ecosystem of modules including plotting with Matplotlib, data structure and analysis with Pandas, Machine Learning or Natural Language Processing. However, data scientists working with Spar...
mne-tools/mne-tools.github.io
0.19/_downloads/4a27e3735cff9a10082eb2938ef41c34/plot_sensor_permutation_test.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import numpy as np import mne from mne import io from mne.stats import permutation_t_test from mne.datasets import sample print(__doc__) """ Explanation: Permutation T-test on sensor data One tests if the signal significantly de...