repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
beangoben/HistoriaDatos_Higgs
Dia1/.ipynb_checkpoints/Intro a Matplotlib-checkpoint.ipynb
gpl-2.0
import numpy as np # modulo de computo numerico import matplotlib.pyplot as plt # modulo de graficas import pandas as pd # modulo de datos # esta linea hace que las graficas salgan en el notebook %matplotlib inline """ Explanation: Intro a Matplotlib Matplotlib = Libreria para graficas cosas matematicas Que es Matplot...
google/starthinker
colabs/smartsheet_to_bigquery.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: SmartSheet Sheet To BigQuery Move sheet data into a BigQuery table. License Copyright 2020 Google LLC, 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...
andrewzwicky/puzzles
FiveThirtyEightRiddler/2018-04-06/vandal_dates.ipynb
mit
import datetime from collections import Counter start = datetime.date(2001, 1, 1) end = datetime.date(2100, 1, 1) - datetime.timedelta(days=1) d = start anarchy_dates = [] delta = datetime.timedelta(days=1) while d <= end: if d.day * d.month == d.year % 100: anarchy_dates.append(d) d += delta ana...
zambzamb/zpic
python/R-L Waves.ipynb
agpl-3.0
import em1ds as zpic electrons = zpic.Species( "electrons", -1.0, ppc = 64, uth=[0.005,0.005,0.005]) sim = zpic.Simulation( nx = 1000, box = 100.0, dt = 0.0999, species = electrons ) sim.emf.solver_type = 'PSATD' #Bx0 = 0.5 #Bx0 = 1.0 Bx0 = 2.0 sim.emf.set_ext_fld('uniform', B0= [Bx0, 0.0, 0.0]) """ Explanation: ...
tyler-abbot/PyShop
session2/PyShop_session2_notes.ipynb
agpl-3.0
import numpy as np #This is the traditional way to import NumPy a = np.array([[1.,0],[0,1]]) #Create an identity matrix by hand NOTE: What are the data types of entries? b = np.eye(2) # Creat an identity matrix using built in funciton print(a) print(b) """ Explanation: PyShop Session 2 This session focuses on so...
Benedicto/ML-Learning
Clustering_5_lda_blank.ipynb
gpl-3.0
import graphlab as gl import numpy as np import matplotlib.pyplot as plt %matplotlib inline '''Check GraphLab Create version''' from distutils.version import StrictVersion assert (StrictVersion(gl.version) >= StrictVersion('1.8.5')), 'GraphLab Create must be version 1.8.5 or later.' # import wiki data wiki = gl.SFr...
fja05680/pinkfish
examples/245.double-7s-ave-portfolio/strategy.ipynb
mit
import datetime import matplotlib.pyplot as plt import pandas as pd import pinkfish as pf import strategy # Format price data. pd.options.display.float_format = '{:0.2f}'.format %matplotlib inline # Set size of inline plots '''note: rcParams can't be in same cell as import matplotlib or %matplotlib inline ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/migration/UJ5 AutoML for vision with Vertex AI Video Classification.ipynb
apache-2.0
! pip3 install -U google-cloud-aiplatform --user """ Explanation: Vertex AI AutoML Image Object Detection Installation Install the latest (preview) version of Vertex SDK. End of explanation """ ! pip3 install google-cloud-storage """ Explanation: Install the Google cloud-storage library as well. End of explanation ...
Hyperparticle/graph-nlu
notebooks/dynamic_memory_3.ipynb
mit
import pandas as pd import numpy as np import nltk from sklearn.metrics import accuracy_score from neo4j.v1 import GraphDatabase, basic_auth from collections import defaultdict refs_utts = pd.read_pickle('resources/utts_refs.pkl') props = pd.read_pickle('resources/restaurants_props.pkl') len(refs_utts), len(props) re...
xdnian/pyml
assignments/ex06_ch1113_xdnian.ipynb
mit
%load_ext watermark %watermark -a '' -u -d -v -p numpy,pandas,matplotlib,scipy,sklearn %matplotlib inline # Added version check for recent scikit-learn 0.18 checks from distutils.version import LooseVersion as Version from sklearn import __version__ as sklearn_version """ Explanation: Assignment 6 This assignment has...
mintcloud/deep-learning
sentiment-rnn/.ipynb_checkpoints/Sentiment RNN Solution-checkpoint.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment_network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment_network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
dtamayo/rebound
ipython_examples/EscapingParticles.ipynb
gpl-3.0
import rebound import numpy as np def setupSimulation(): sim = rebound.Simulation() sim.add(m=1., hash="Sun") sim.add(x=0.4,vx=5., hash="Mercury") sim.add(a=0.7, hash="Venus") sim.add(a=1., hash="Earth") sim.move_to_com() return sim sim = setupSimulation() sim.status() """ Explanation: Esc...
laurajchang/NPTFit
examples/Example6_Manual_nonPoissonian_Likelihood.ipynb
mit
# Import relevant modules %matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import healpy as hp import matplotlib.pyplot as plt from NPTFit import nptfit # module for performing scan from NPTFit import create_mask as cm # module for creating the mask from NPTFit import psf_correction as pc # m...
UWashington-Astro300/Astro300-A17
Python_Introduction.ipynb
mit
print("Hello World!") # lines that begin with a # are treated as comment lines and not executed # print("This line is not printed") print("This line is printed") """ Explanation: A jupyter notebook is a browser-based environment that integrates: A Kernel (python) Text Executable code Plots and images Rendered math...
deot95/Tesis
Proyecto de Grado Ingeniería Electrónica/Workspace/RL/TowardsRL/.ipynb_checkpoints/reinforcement_q_learning-checkpoint.ipynb
mit
import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import namedtuple from itertools import count from copy import deepcopy from PIL import Image from __future__ import print_function, division import torch import torch.nn as nn import torch.optim ...
phobson/statsmodels
examples/notebooks/pca_fertility_factors.ipynb
bsd-3-clause
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels as sm from statsmodels.multivariate.pca import PCA """ Explanation: Statsmodels Principal Component Analysis Key ideas: Principal component analysis, world bank data, fertility In this notebook, we use princip...
josef-pkt/statsmodels
examples/notebooks/markov_regression.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt # NBER recessions from pandas_datareader.data import DataReader from datetime import datetime usrec = DataReader('USREC', 'fred', start=datetime(1947, 1, 1), end=datetime(2013, 4, 1)) """ Explanatio...
metpy/MetPy
v0.9/_downloads/7dd7941230ab04d65d899c66ed400ef4/xarray_tutorial.ipynb
bsd-3-clause
import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt import xarray as xr # Any import of metpy will activate the accessors import metpy.calc as mpcalc from metpy.testing import get_test_data """ Explanation: xarray with MetPy Tutorial xarray &lt;http://xarray.pydata.org/&gt;_ ...
mne-tools/mne-tools.github.io
0.18/_downloads/012b7ba30b03ebda4c3419b2e4f5161a/plot_ssp_projs_sensitivity_map.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt from mne import read_forward_solution, read_proj, sensitivity_map from mne.datasets import sample print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' ...
csc-training/python-introduction
notebooks/examples/3 - Functions.ipynb
mit
def my_function(arg_one, arg_two, optional_1=6, optional_2="seven"): return " ".join([str(arg_one), str(arg_two), str(optional_1), str(optional_2)]) print(my_function("a", "b")) print(my_function("a", "b", optional_2="eight")) #go ahead and try out different components """ Explanation: Functions Functions and fu...
M-R-Houghton/euroscipy_2015
scikit_image/lectures/3_morphological_operations.ipynb
mit
import numpy as np from matplotlib import pyplot as plt, cm import skdemo plt.rcParams['image.cmap'] = 'cubehelix' plt.rcParams['image.interpolation'] = 'none' image = np.array([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0,...
GoogleCloudPlatform/asl-ml-immersion
notebooks/end-to-end-structured/labs/3b_bqml_linear_transform_babyweight.ipynb
apache-2.0
%%bigquery -- LIMIT 0 is a free query; this allows us to check that the table exists. SELECT * FROM babyweight.babyweight_data_train LIMIT 0 %%bigquery -- LIMIT 0 is a free query; this allows us to check that the table exists. SELECT * FROM babyweight.babyweight_data_eval LIMIT 0 """ Explanation: LAB 3b: BigQuery ML...
adrn/GaiaPairsFollowup
notebooks/Full reduction.ipynb
mit
# Standard library from os.path import join import sys if '/Users/adrian/projects/longslit/' not in sys.path: sys.path.append('/Users/adrian/projects/longslit/') # Third-party from astropy.constants import c import numpy as np import matplotlib.pyplot as plt import astropy.units as u from astropy.io import fits im...
lcharleux/numerical_analysis
doc/ODE/.ipynb_checkpoints/ODE-checkpoint.ipynb
gpl-2.0
tmax = .2 t = np.linspace(0., tmax, 1000) x0, y0 = 0., 0. vx0, vy0 = 1., 1. g = 10. x = vx0 * t y = -g * t**2/2. + vy0 * t fig = plt.figure() ax.set_aspect("equal") plt.plot(x, y, label = "Exact solution") plt.grid() plt.xlabel("x") plt.ylabel("y") plt.legend() plt.show() """ Explanation: Ordinary differential ...
ES-DOC/esdoc-jupyterhub
notebooks/mri/cmip6/models/mri-esm2-0/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mri', 'mri-esm2-0', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: MRI Source ID: MRI-ESM2-0 Topic: Ocean Sub-Topics: Timestepping Framework, Advection...
csaladenes/csaladenes.github.io
present/mcc2/PythonDataScienceHandbook/05.13-Kernel-Density-Estimation.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns; sns.set() import numpy as np """ Explanation: <!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; t...
Chipe1/aima-python
notebooks/chapter19/Learners.ipynb
mit
import os, sys sys.path = [os.path.abspath("../../")] + sys.path from deep_learning4e import * from notebook4e import * from learning4e import * """ Explanation: Learners In this section, we will introduce several pre-defined learners to learning the datasets by updating their weights to minimize the loss function. wh...
MTgeophysics/mtpy
examples/workshop/Workshop Exercises Core.ipynb
gpl-3.0
# import required modules from mtpy.core.mt import MT # Define the path to your edi file edi_file = "C:/mtpywin/mtpy/examples/data/edi_files_2/Synth00.edi" # Create an MT object mt_obj = MT(edi_file) """ Explanation: Introduction This workbook contains some examples for reading, analysing and plotting processed MT d...
graphistry/pygraphistry
demos/demos_by_use_case/logs/malware-hypergraph/Malware Hypergraph.ipynb
bsd-3-clause
import pandas as pd import graphistry as g # To specify Graphistry account & server, use: # graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com') # For more options, see https://github.com/graphistry/pygraphistry#configure df = pd.read_csv('./barncat.1k.csv', encod...
quantopian/research_public
notebooks/lectures/CAPM_and_Arbitrage_Pricing_Theory/notebook.ipynb
apache-2.0
import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels import regression import matplotlib.pyplot as plt """ Explanation: The Capital Asset Pricing Model and Arbitrage Pricing Theory by Beha Abasi, Maxwell Margenot, and Delaney Granizo-Mackenzie Part of the Quantopian Lecture Series: www...
reidmcy/MACS30200proj
ProblemSets/PS3/PS3.ipynb
gpl-2.0
import numpy as np import pandas import statsmodels import statsmodels.formula.api import statsmodels.stats.api import statsmodels.stats import statsmodels.stats.outliers_influence import statsmodels.graphics.regressionplots import sklearn.preprocessing import matplotlib.pyplot as plt import seaborn %matplotlib inline...
cosmostatschool/MACSS2017
pre-school/NumCompTools/Seb_MACSS2017_python.ipynb
mit
a = 1 b = 2.67 c = "Vamos PSG" d = True print type(a), type(b), type(c), type(d) """ Explanation: Generalities Author : Sebastien Fromenteau context : Mexican AstroCosmology Statistics School 2017 This notebook is partially based on the notebook wrote by Iván Rodríguez Montoya for MACSS 2016 I will not focus on list ...
benfred/implicit
examples/tutorial_lastfm.ipynb
mit
from implicit.datasets.lastfm import get_lastfm artists, users, artist_user_plays = get_lastfm() """ Explanation: Tutorial - Recommending Music with the last.fm 360K dataset. This tutorial shows the major functionality of the implicit library by building a music recommender system using the the last.fm 360K dataset. ...
gwsb-istm-6212-fall-2016/syllabus-and-schedule
scripts/20161129-exporting-csv-from-datanotebook.ipynb
cc0-1.0
!echo 'redspot' | sudo -S service postgresql restart %load_ext sql !createdb -U dbuser test %sql postgresql://dbuser@localhost:5432/test """ Explanation: Exporting CSV data from the server This process is slightly cumbersome because of Unix permissions. Remember - nine times out of ten, on Unix, it's probably a pe...
marioberges/F16-12-752
projects/gvizcain/ApplianceClassifier_v3.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import pickle, time, seaborn, random, json, os %matplotlib inline from sklearn import tree from sklearn.model_selection import cross_val_score, train_test_split from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier, RandomForestClassifier f...
mjlong/openmc
docs/source/pythonapi/examples/tally-arithmetic.ipynb
mit
%load_ext autoreload %autoreload 2 import glob from IPython.display import Image import numpy as np import openmc from openmc.statepoint import StatePoint from openmc.summary import Summary %matplotlib inline """ Explanation: This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) ...
philmui/datascience2016fall
lecture03.numpy.pandas/lecture03.web.scaping.ipynb
mit
import requests from lxml import html """ Explanation: Import needed libraries End of explanation """ response = requests.get('http://news.ycombinator.com/') response response.content """ Explanation: We used the library "request" last time in getting Twitter data (REST-ful). We are introducing the new "lxml" lib...
ulf1/overgang
examples/internal data format of ctmc_fit.ipynb
mit
data = [([0, 1, 2, 1], [2.2, 3.35, 9.4, 1.3]), ([1, 0, 1], [4.0, 1.25, 1.7])] """ Explanation: The Internal Data Format for ctmc_fit The function ctmc_fit expect the data to be structured as follows End of explanation """ import numpy as np numstates = 3 statetime = np.zeros(numstates, dtype=float) transcou...
gigjozsa/HI_analysis_course
chapter_01_somename/01_01_somename2.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Content Glossary 1. Somename Next: 1.2 Somename 3 Import standard modules: End of explanation """ pass """ Explanation: Import section specifi...
jseabold/statsmodels
examples/notebooks/gee_score_test_simulation.ipynb
bsd-3-clause
import pandas as pd import numpy as np from scipy.stats.distributions import norm, poisson import statsmodels.api as sm import matplotlib.pyplot as plt """ Explanation: GEE score tests This notebook uses simulation to demonstrate robust GEE score tests. These tests can be used in a GEE analysis to compare nested hypo...
landlab/landlab
notebooks/tutorials/network_sediment_transporter/network_sediment_transporter.ipynb
mit
import warnings warnings.filterwarnings("ignore") import matplotlib.pyplot as plt import numpy as np from landlab.components import FlowDirectorSteepest, NetworkSedimentTransporter from landlab.data_record import DataRecord from landlab.grid.network import NetworkModelGrid from landlab.plot import graph from landlab....
maniacalbrain/Cluster-vinb-tweets
#vinb - Cluster Tweets.ipynb
mit
from sklearn.feature_extraction.text import TfidfVectorizer vectorizer = TfidfVectorizer(use_idf=True, ngram_range =(1,3)) train_data_features = vectorizer.fit_transform(clean_tweets) terms = vectorizer.get_feature_names() from sklearn.cluster import KMeans num_clusters = 15 km = KMeans(n_clusters=num_clusters) k...
nbokulich/short-read-tax-assignment
ipynb/mock-community/taxonomy-assignment-trimmed-dbs.ipynb
bsd-3-clause
from os.path import join, expandvars from joblib import Parallel, delayed from glob import glob from os import system from tax_credit.framework_functions import (parameter_sweep, generate_per_method_biom_tables, move_results_to_rep...
wuafeing/Python3-Tutorial
01 data structures and algorithms/01.12 determine most freqently items in seq.ipynb
gpl-3.0
words = [ 'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes', 'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the', 'eyes', "don't", 'look', 'around', 'the', 'eyes', 'look', 'into', 'my', 'eyes', "you're", 'under' ] from collections import Counter word_counts = Counter(words) # ...
lukin155/skola-programiranja
02-Fajlovi-komentari-racun.ipynb
mit
print("This is the first line.") print("This is the second line.") print("This is the third line.") """ Explanation: Komande u konzoli Funkcija <i>print</i> služi za prikaz sadržaja na ekranu.<br /> Pokrenite Pajton iz konzole (kao u lekciji Uvod). U konzoli otkucajte sledeće komande (ovde možete videti i komande i ...
ledeprogram/algorithms
class7/homework/benzaquen_mercy_assignment_7_1.ipynb
gpl-3.0
!pip install pydotplus import pandas as pd %matplotlib inline import pydotplus from pandas.tools.plotting import scatter_matrix import matplotlib.pyplot as plt from sklearn import datasets from sklearn import tree from sklearn.externals.six import StringIO from sklearn.cross_validation import train_test_split from...
gaufung/PythonStandardLibrary
FileSystem/tempfile.ipynb
mit
import os import tempfile print('Building a filename with PID:') filename = '/tmp/guess_my_name.{}.txt'.format(os.getpid()) with open(filename, 'w+b') as temp: print('temp:') print(' {!r}'.format(temp)) print('temp.name:') print(' {!r}'.format(temp.name)) # Clean up the temporary file yourself. os.r...
arasdar/DL
uri-dl/uri-dl-hw-2/assignment2/Dropout.ipynb
unlicense
# As usual, a bit of setup from __future__ import print_function import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solv...
turbomanage/training-data-analyst
courses/ai-for-finance/solution/aapl_regression_scikit_learn.ipynb
apache-2.0
%%bash bq mk -d ai4f bq load --autodetect --source_format=CSV ai4f.AAPL10Y gs://cloud-training/ai4f/AAPL10Y.csv %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import numpy as np from sklearn import linear_model from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_scor...
snowicecat/umich-eecs445-f16
lecture10_bias-variance-tradeoff/lecture10_bias-variance-tradeoff.ipynb
mit
%pylab inline import numpy as np import seaborn as sns import pandas as pd from Lec08 import * """ Explanation: $$ \LaTeX \text{ command declarations here.} \newcommand{\R}{\mathbb{R}} \renewcommand{\vec}[1]{\mathbf{#1}} \newcommand{\X}{\mathcal{X}} \newcommand{\D}{\mathcal{D}} \newcommand{\vx}{\mathbf{x}} \newcommand...
OceanPARCELS/parcels
parcels/examples/tutorial_sampling.ipynb
mit
# Modules needed for the Parcels simulation from parcels import Variable, FieldSet, ParticleSet, JITParticle, AdvectionRK4 import numpy as np from datetime import timedelta as delta # To open and look at the temperature data import xarray as xr import matplotlib as mpl import matplotlib.pyplot as plt """ Explanation...
datamicroscopes/release
examples/gamma_poisson.ipynb
bsd-3-clause
import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt sns.set_context('talk') import csv import urllib2 import StringIO %matplotlib inline """ Explanation: Count Data and Ordinal Data with the Gamma-Poisson Distribution Typically, we model count data, or integer valued data, wit...
bje-/NEMO
doc/guide.ipynb
gpl-3.0
import nemo from nemo import scenarios c = nemo.Context() scenarios._one_ccgt(c) print(c.generators) """ Explanation: NEMO User's Guide: a Jupyter notebook Note that this is a Jupyter notebook that uses some magic IPython commands (starting with %). It may not work in other notebooks like the one included with Pycharm...
dchandan/rebound
ipython_examples/FourierSpectrum.ipynb
gpl-3.0
import rebound import numpy as np sim = rebound.Simulation() sim.units = ('AU', 'yr', 'Msun') sim.add("Sun") sim.add("Jupiter") sim.add("Saturn") """ Explanation: Fourier analysis & resonances A great benefit of being able to call rebound from within python is the ability to directly apply sophisticated analysis tools...
byronknoll/tensorflow-compress
nncp-splitter.ipynb
unlicense
batch_size = 96 #@param {type:"integer"} #@markdown >_Set this to the same value that will be used in tensorflow-compress._ mode = 'split' #@param ["split", "join"] num_parts = 4 #@param {type:"integer"} #@markdown >_This is the number of parts the file should be split to._ http_path = '' #@param {type:"string"} #@mark...
morganics/bayesianpy
examples/notebook/iris_cluster_count.ipynb
apache-2.0
import pandas as pd import logging import sys sys.path.append("../../../bayesianpy") import bayesianpy import matplotlib.pyplot as plt import os logger = logging.getLogger() bayesianpy.jni.attach(logger) db_folder = bayesianpy.utils.get_path_to_parent_dir('') iris = pd.read_csv(os.path.join(db_folder, "data/iris...
Lasagne/Recipes
examples/spatial_transformer_network.ipynb
mit
!wget -N https://s3.amazonaws.com/lasagne/recipes/datasets/mnist_cluttered_60x60_6distortions.npz def load_data(): data = np.load(mnist_cluttered) X_train, y_train = data['x_train'], np.argmax(data['y_train'], axis=-1) X_valid, y_valid = data['x_valid'], np.argmax(data['y_valid'], axis=-1) X_test, y_te...
metpy/MetPy
v1.0/_downloads/4211928bfede6cdca0afdb2d06bea2d1/Find_Natural_Neighbors_Verification.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np from scipy.spatial import Delaunay from metpy.interpolate.geometry import circumcircle_radius, find_natural_neighbors # Create test observations, test points, and plot the triangulation and points. gx, gy = np.meshgrid(np.arange(0, 20, 4), np.arange(0, 20, 4)) pts = ...
BinRoot/TensorFlow-Book
ch08_rl/Concept01_rl.ipynb
mit
%matplotlib inline from yahoo_finance import Share from matplotlib import pyplot as plt import numpy as np import random import tensorflow as tf import random """ Explanation: Ch 08: Concept 01 Reinforcement learning The states are previous history of stock prices, current budget, and current number of shares of a sto...
tensorflow/docs-l10n
site/ko/tutorials/reinforcement_learning/actor_critic.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...
iktakahiro/ipython-notebook-sample
pymook/pymook_reading_20150723.ipynb
mit
import pandas as pd import numpy as np """ Explanation: このNotebookについて 2015年07月23日(木)に開催された、「Pythonエンジニア養成読本」読書会 03 - connpassの登壇時、追加資料として利用したものです。 Author: Takahiro Ikeuchi - @iktakahiro End of explanation """ # 商品データと購買ログの2つのデータを読み込みます。 master = pd.read_csv('./data/master.csv') log = pd.read_csv('./data/log.csv') ...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_sensor_noise_level.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os.path as op import mne data_path = mne.datasets.sample.data_path() raw_erm = mne.io.read_raw_fif(op.join(data_path, 'MEG', 'sample', 'ernoise_raw.fif'), preload=True) """ Explanation: Show nois...
google-research/google-research
ged_tts/toy_example/toy_ged.ipynb
apache-2.0
import numpy as np from scipy.optimize import minimize import functools import matplotlib.pyplot as plt import palettable """ Explanation: Toy example to demonstrate the importance of the repulsive term in the energy distance This notebook reproduces Figure 1 from A Spectral Energy Distance for Parallel Speech Synthes...
planet-os/notebooks
api-examples/CFSv2_usage_example.ipynb
mit
%matplotlib notebook import numpy as np import pandas as pd import matplotlib.pyplot as plt from API_client.python import datahub from API_client.python.lib import dataset from API_client.python.lib import variables """ Explanation: Using a CFSv2 forecast CFSv2 is a seasonal forecast system, used for analysing past ...
squishbug/DataScienceProgramming
08-Machine-Learning-I/HW08/README.ipynb
cc0-1.0
# Loading python packages and APD data file (this step does not have to be included in hw6_answers.py) import pandas as pd import numpy as np df = pd.read_csv('/home/data/APD/COBRA-YTD2017.csv.gz') """ Explanation: Homework 6 Use this notebook to work on your answers and check solutions. You can then submit your fun...
wzbozon/statsmodels
examples/notebooks/statespace_sarimax_stata.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd from scipy.stats import norm import statsmodels.api as sm import matplotlib.pyplot as plt from datetime import datetime import requests from io import BytesIO """ Explanation: SARIMAX: Introduction This notebook replicates examples from the Stata ARIMA time se...
lukauskas/bernoulli-mixture-model
notebooks/Proof of Concept (digits dataset).ipynb
gpl-3.0
import sklearn.datasets digits_dataset = sklearn.datasets.load_digits() digits = pd.DataFrame(digits_dataset.data) labels = pd.Series(digits_dataset.target, index=digits.index, name='label') THRESHOLD = np.mean(digits.values.reshape(-1)) binary_digits = digits >= THRESHOLD from sklearn.utils import shuffle binary_dig...
scottquiring/Udacity_Deeplearning
intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
gerbaudo/fbu
tutorial.ipynb
gpl-2.0
import fbu myfbu = fbu.PyFBU() """ Explanation: Basic usage Create an instance of PyFBU End of explanation """ myfbu.data = [100,150] """ Explanation: Supply the input distribution to be unfolded as a 1-dimensional list for N bins, with each entry corresponding to the bin content. End of explanation """ myfbu.res...
ypeleg/Deep-Learning-Keras-Tensorflow-PyCon-Israel-2017
2.4 Transfer Learning & Fine-Tuning.ipynb
mit
import numpy as np import datetime np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D from keras.utils import np_utils from keras import backe...
jeiros/Jupyter_notebooks
python/markov_analysis/msmbuilder-API.ipynb
mit
from msmbuilder.dataset import dataset import numpy as np import os from mdtraj.utils import timing from msmbuilder.featurizer import DihedralFeaturizer import seaborn as sns; sns.set_style("white"); sns.set_palette("Blues") with timing("Loading data as dataset object"): wt_xyz = dataset("/Users/je714/wt_data/*/05...
elsuizo/Control_de_robots_py
tp3.ipynb
gpl-3.0
from IPython.core.display import Image Image(filename='Imagenes/copy_left.png') Image(filename='Imagenes/dibujo_robot2_tp2.png') #imports from sympy import * import numpy as np #Con esto las salidas van a ser en LaTeX init_printing(use_latex=True) """ Explanation: Martín Noblía Tp3 <img src="files/copy_left.png...
corochann/chainer-hands-on-tutorial
src/01_chainer_intro/dataset_introduction.ipynb
mit
# Initial setup following http://docs.chainer.org/en/stable/tutorial/basic.html import numpy as np import chainer from chainer import cuda, Function, gradient_check, report, training, utils, Variable from chainer import datasets, iterators, optimizers, serializers from chainer import Link, Chain, ChainList import chain...
giacomov/astromodels
examples/Additional_features_for_scripts_and_applications.ipynb
bsd-3-clause
from astromodels import * my_model = load_model("my_model.yml") """ Explanation: Additional features for scripts and applications In this document we describe some features of the astromodels package which are useful for non-interactive environment such as scripts or applications First let's import astromodels and le...
maxalbert/tohu
notebooks/v4/Custom_generators.ipynb
mit
import tohu from tohu.v4.primitive_generators import * from tohu.v4.derived_generators import * from tohu.v4.dispatch_generators import * from tohu.v4.custom_generator import * from tohu.v4.utils import print_generated_sequence, make_dummy_tuples print(f'Tohu version: {tohu.__version__}') """ Explanation: Custom gene...
basp/notes
single_value_calculus.ipynb
mit
c1 = lambda x: x + 1 c2 = lambda x: -x + 2 x1 = np.linspace(0.01, 2, 10) x2 = np.linspace(-2, -0.01, 10) plt.plot(x1, c1(x1), label=r"$y = x + 1$") plt.plot(x2, c2(x2), label=r"$y = -x + 2$") plt.plot(0, 2, 'wo', markersize=7) plt.plot(0, 1, 'wo', markersize=7) ax = plt.axes() ax.set_ylim(0, 4) plt.legend(loc=3) """ E...
darkomen/TFG
medidas/0107150/.ipynb_checkpoints/Analisis-checkpoint.ipynb
cc0-1.0
%pylab inline #Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Abrimos el fichero csv...
cmmorrow/sci-analysis
docs/using_sci_analysis.ipynb
mit
import warnings warnings.filterwarnings("ignore") import numpy as np import scipy.stats as st from sci_analysis import analyze """ Explanation: Using sci-analysis From the python interpreter or in the first cell of a Jupyter notebook, type: End of explanation """ %matplotlib inline import numpy as np import scipy.st...
marksibrahim/musings
notebooks/.ipynb_checkpoints/A Neural Network Classifier using Keras-checkpoint.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd from sklearn.cross_validation import train_test_split from sklearn.linear_model import LogisticRegressionCV from sklearn import datasets from keras.models import Sequential from keras.layers.core import De...
regardscitoyens/consultation_an
exploitation/analyse_quanti.ipynb
agpl-3.0
#contributions = pd.read_json(path_or_buf='../data/EGALITE4.brut.json', orient="columns") def loadContributions(file, withsexe=False): contributions = pd.read_json(path_or_buf=file, orient="columns") rows = []; rindex = []; for i in range(0, contributions.shape[0]): row = {}; row['id'] ...
TimothyHelton/k2datascience
notebooks/HR_Exercise.ipynb
bsd-3-clause
from k2datascience import hr_analytics from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" %matplotlib inline """ Explanation: HR Dataset - Statistics Review Timothy Helton <br> <font color="red"> NOTE: <br> This notebook uses code found in the ...
mne-tools/mne-tools.github.io
0.16/_downloads/make_report.ipynb
bsd-3-clause
# Authors: Teon Brooks <teon.brooks@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from mne.report import Report from mne.datasets import sample from mne import read_evokeds from matplotlib import pyplot as plt data_path = sample.data_path() meg_path = data_path + '/MEG/sampl...
google/trax
trax/examples/NER_using_Reformer.ipynb
apache-2.0
#@title # Copyright 2020 Google LLC. # 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...
SheffieldML/notebook
GPy/sparse_gp_regression.ipynb
bsd-3-clause
%matplotlib inline %config InlineBackend.figure_format = 'svg' import GPy import numpy as np np.random.seed(101) """ Explanation: Sparse GP Regression 14th January 2014 James Hensman 29th September 2014 Neil Lawrence (added sub-titles, notes and some references). This example shows the variational compression effect o...
Kaggle/learntools
notebooks/pandas/raw/tut_2.ipynb
apache-2.0
#$HIDE_INPUT$ import pandas as pd pd.set_option('max_rows', 5) import numpy as np reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0) reviews """ Explanation: Introduction In the last tutorial, we learned how to select relevant data out of a DataFrame or Series. Plucking the right dat...
materialsvirtuallab/matgenb
notebooks/2018-09-25-Structure Prediction using Pymatgen and the Materials API.ipynb
bsd-3-clause
# Imports we need for running structure prediction from pymatgen.analysis.structure_prediction.substitutor import Substitutor from pymatgen.analysis.structure_prediction.substitution_probability import SubstitutionPredictor from pymatgen.analysis.structure_matcher import StructureMatcher, ElementComparator from pymat...
jon-young/medicalimage
Liver Interactive.ipynb
mit
import collections import matplotlib matplotlib.use('Agg') %matplotlib inline import matplotlib.pyplot as plt import numpy as np import os import pickle import scipy.stats import SimpleITK as sitk from os.path import expanduser, join from scipy.spatial.distance import euclidean """ Explanation: Liver Segmen...
PyladiesMx/Pyladies_ifc
4. Lops/.ipynb_checkpoints/For Loops-checkpoint.ipynb
mit
#Obtén el cuadrado de 1 #Obtén el cuadrado de 2 #Obtén el cuadrado de 3 #Obtén el cuadrado de 4 #Obtén el cuadrado de 5 #Obtén el cuadrado de 6 #Obtén el cuadrado de 7 #Obtén el cuadrado de 8 #Obtén el cuadrado de 9 #Obtén el cuadrado de 10 """ Explanation: Bienvenid@ a otra reunión de pyladies!! Sólo para as...
mne-tools/mne-tools.github.io
0.17/_downloads/4365eab31ed2fa347de7f294ac9500c3/plot_label_from_stc.ipynb
bsd-3-clause
# Author: Luke Bloy <luke.bloy@gmail.com> # Alex Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.datasets import sample print(__doc__) data_pa...
jonasluz/mia-cg
Exercises/Exercícios#1.ipynb
unlicense
from typing import List Vector = List[float] import numpy as np import matplotlib.pyplot as plt def dcos(v: Vector, verbose=False): """ Calcula os cosenos diretores do vetor a. Para cada componente c1, c2, ... cn do vetor v, o cosseno diretor é dado por: dcosk = ck / ||v|| """ result = [] ...
Chipe1/aima-python
notebooks/chapter24/Image Segmentation.ipynb
mit
import os, sys sys.path = [os.path.abspath("../../")] + sys.path from perception4e import * from notebook4e import * import matplotlib.pyplot as plt """ Explanation: Segmentation Image segmentation is another early as well as an important image processing task. Segmentation is the process of breaking an image into gro...
DwangoMediaVillage/pqkmeans
tutorial/3_billion_scale_clustering.ipynb
mit
import numpy import pqkmeans import tqdm import os import six import gzip import texmex_python """ Explanation: Chapter 3: Billion-scale clustering This chapter contains the followings: Download the SIFT1B dataset Encode billion-scale data iteratively Run clustering Requisites: - numpy - pqkmeans - tqdm - six - os ...
kingb12/languagemodelRNN
report_notebooks/encdec_noing23_200_512_04drb.ipynb
mit
report_file = '/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing23_200_512_04drb/encdec_noing23_200_512_04drb.json' log_file = '/Users/bking/IdeaProjects/LanguageModelRNN/experiment_results/encdec_noing23_200_512_04drb/encdec_noing23_200_512_04drb_logs.json' import json import matplotlib.pyplo...
t-vi/pytorch-tvmisc
wasserstein-distance/sn_projection_cgan_64x64_143c.ipynb
mit
import matplotlib try: %matplotlib inline except: # if we are not in Jupyter, use the headless frontend matplotlib.use('Agg') from matplotlib import pyplot import IPython import numpy import time import torch import torchvision import torch.utils.data """ Explanation: Spectral normalization GAN with c...
tensorflow/examples
courses/udacity_intro_to_tensorflow_lite/tflite_c03_exercise_convert_model_to_tflite.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...
mjuric/LSSTC-DSFP-Sessions
Session4/Day1/LSSTC-DSFP4-Juric-FrequentistAndBayes-02-Nuisance.ipynb
mit
p_hat = 5. / 8. freq_prob = (1 - p_hat) ** 3 print("Naïve Frequentist Probability of Bob Winning: {0:.2f}".format(freq_prob)) """ Explanation: Frequentism and Bayesianism II: When Results Differ Mario Juric & Jake VanderPlas, University of Washington e-mail: &#109;&#106;&#117;&#114;&#105;&#99;&#64;&#97;&#115;&#116;&#1...
mdda/pycon.sg-2015_deep-learning
ipynb/6-RNN-as-Author.ipynb
mit
import numpy import theano from theano import tensor from blocks.bricks import Tanh from blocks.bricks.recurrent import GatedRecurrent from blocks.bricks.sequence_generators import (SequenceGenerator, Readout, SoftmaxEmitter, LookupFeedback) from blocks.graph import ComputationGraph import blocks.algorithms from bloc...
fluffy-hamster/A-Beginners-Guide-to-Python
A Beginners Guide to Python/Homework Solutions/10. Strings (HW).ipynb
mit
# Solution One: Triple Quotes!! cool_story_bro = """"Ahhh!!!! spiders!", cried the monster."Don't worry" said our hero, "I have a sharp spoon".""" print(cool_story_bro) """ Explanation: Homework: Name a variable "cool_story_bro" and then assign the the following text as a string: "Ahhh!!!! spiders!", cried the monst...
alexweav/Learny-McLearnface
Example1.ipynb
mit
import numpy as np import LearnyMcLearnface as lml """ Explanation: Example 1 - Overfitting Sample Data Here, we will use a simple model to overfit a set of randomly generated data points. First, we import Numpy to hold the data, and we import Learny McLearnface. End of explanation """ test_data = np.random.randn(10...
NewKnowledge/punk
examples/Novelty Detection.ipynb
mit
import punk help(punk) """ Explanation: The goal os punk is to make available sime wrappers for a variety of machine learning pipelines. The pipelines are termed primitves and each primitive is designed with a functional programming approach in mind. At the time of this writing, punk is being periodically updated. Any...