repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
MTG/essentia
src/examples/python/tutorial_io_audio.ipynb
agpl-3.0
import essentia.standard as es filename = 'audio/dubstep.flac' # Load the whole file in mono audio = es.MonoLoader(filename=filename)() print(audio.shape) # Load the whole file in stereo audio, _, _, _, _, _ = es.AudioLoader(filename=filename)() print(audio.shape) # Load and resample to 16000 Hz audio = es.MonoLoad...
DigNeurosurgeon/seeg
notebooks/3 seeg_predict_implantation_accuracy-turicreate.ipynb
gpl-3.0
# import libraries import turicreate as tc import h5py import numpy as np import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt import seaborn as sns; sns.set() plt.style.use('ggplot') %matplotlib inline import warnings; warnings.simplefilter('ignore') #%xmode plain; # shorter error messages p...
root-mirror/training
OldSummerStudentsCourse/2017/examples/notebooks/TTreeAccess_Example_py.ipynb
gpl-2.0
import ROOT """ Explanation: Access TTree in Python using PyROOT <hr style="border-top-width: 4px; border-top-color: #34609b;"> End of explanation """ f = ROOT.TFile.Open("https://root.cern.ch/files/summer_student_tutorial_tracks.root") """ Explanation: Open a file which is located on the web. No type is to be spec...
tpin3694/tpin3694.github.io
machine-learning/break_up_dates_and_times_into_multiple_features.ipynb
mit
# Load library import pandas as pd """ Explanation: Title: Break Up Dates And Times Into Multiple Features Slug: break_up_dates_and_times_into_multiple_features Summary: How to break up dates and times into multiple features for machine learning in Python. Date: 2017-09-11 12:00 Category: Machine Learning Tags: Pre...
sylvchev/coursIntroPython
cours/4-ApprendrePython-Modules.ipynb
gpl-3.0
# Module nombres de Fibonacci def fib(n): # écrit la série de Fibonacci jusqu’à n a, b = 0, 1 while b < n: print (b, end=' ') a, b = b, a+b def fib2(n): # retourne la série de Fibonacci jusqu’à n result = [] a, b = 0, 1 while b < n: result.append(b) a...
GoogleCloudPlatform/python-docs-samples
notebooks/tutorials/bigquery/Visualizing BigQuery public data.ipynb
apache-2.0
%%bigquery SELECT source_year AS year, COUNT(is_male) AS birth_count FROM `bigquery-public-data.samples.natality` GROUP BY year ORDER BY year DESC LIMIT 15 """ Explanation: Vizualizing BigQuery data in a Jupyter notebook BigQuery is a petabyte-scale analytics data warehouse that you can use to run SQL queries ...
tpin3694/tpin3694.github.io
machine-learning/discretize_features.ipynb
mit
# Load libraries from sklearn.preprocessing import Binarizer import numpy as np """ Explanation: Title: Discretize Features Slug: discretize_features Summary: How to discretize features for machine learning in Python. Date: 2016-09-06 12:00 Category: Machine Learning Tags: Preprocessing Structured Data Authors: Ch...
mne-tools/mne-tools.github.io
0.18/_downloads/82dd66e6bdf7150b8691eaa46b63bcf9/plot_read_events.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Chris Holdgraf <choldgraf@berkeley.edu> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname = data_path + '/MEG/sample/sample_audvi...
NEONScience/NEON-Data-Skills
tutorials/Python/NEON-API-python/neon_api_01_introduction_requests_py/neon_api_01_introduction_requests_py.ipynb
agpl-3.0
import requests import json #Every request begins with the server's URL SERVER = 'http://data.neonscience.org/api/v0/' """ Explanation: syncID: f059914f7cf74327908228e63e204d60 title: "Introduction to NEON API in Python" description: "Use the NEON API in Python, via requests package and json package." dateCreated: 20...
domijin/ml-fit
gcpg_test.ipynb
mit
%pylab inline import numpy as np from datetime import datetime import random import pandas as pd import os """ Explanation: Outline GC per Galaxy Harris Data Inspection clean data add iMType exclude 0: Milky Way Galaxy & 356: A1689-BCG with NaN VMag remove duplicate NGC4417(228=NaN), select better result for VCC-1386...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_eco/td2a_eco_exercices_de_manipulation_de_donnees_correction_b.ipynb
mit
%matplotlib inline from jyquickhelper import add_notebook_menu add_notebook_menu() from pyensae.datasource import download_data files = download_data("td2a_eco_exercices_de_manipulation_de_donnees.zip", url="https://github.com/sdpython/ensae_teaching_cs/raw/master/_doc/notebooks/td2a_eco/data/")...
flothesof/SongCreator
IPython notebooks/Explore XML file names in wikifonia dump.ipynb
mit
import glob fnames = glob.glob("../MusicXML_files/wikifonia20100503/*.xml") fnames[:10] """ Explanation: Let's explore the song names in the files that are in the Wikifonia dump from 2010. The folder wikifonia20100503 comes from a dump of the wikifonia database found here: https://github.com/jganseman/musq First, let...
Honestpuck/charming
Notebooks/Importing Notebooks.ipynb
artistic-2.0
import io, os, sys, types from IPython import get_ipython from IPython.nbformat import current from IPython.core.interactiveshell import InteractiveShell """ Explanation: Importing IPython Notebooks as Modules It is a common problem that people want to import code from IPython Notebooks. This is made difficult by the...
briennakh/BIOF509
Wk12/Wk12-machine-learning-workflow.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pandas as pd %matplotlib inline """ Explanation: Week 12 - The Machine Learning Workflow End of explanation """ # http://scikit-learn.org/stable/auto_examples/plot_digits_pipe.html#example-plot-digits-pipe-py import numpy as np import matplotlib.pyplot as p...
NREL/bifacial_radiance
docs/tutorials/6 - Advanced topics - Understanding trackerdict structure.ipynb
bsd-3-clause
import bifacial_radiance from pathlib import Path import os testfolder = str(Path().resolve().parent.parent / 'bifacial_radiance' / 'Tutorial_06') if not os.path.exists(testfolder): os.makedirs(testfolder) simulationName = 'tutorial_6' moduletype = 'test-module' albedo = "litesoil" # this is...
jepegit/cellpy
dev_utils/lookup/cellpy_check_hdf5_queries.ipynb
mit
my_data.make_step_table() filename2 = Path("/Users/jepe/Arbeid/Data/celldata/20171120_nb034_11_cc.nh5") my_data.save(filename2) print(f"size: {filename2.stat().st_size/1_048_576} MB") my_data2 = cellreader.CellpyData() my_data2.load(filename2) dataset2 = my_data2.dataset print(dataset2.steps.columns) del my_data2 de...
eford/rebound
ipython_examples/Units.ipynb
gpl-3.0
import rebound import math sim = rebound.Simulation() sim.G = 6.674e-11 """ Explanation: Unit convenience functions For convenience, REBOUND offers simple functionality for converting units. One implicitly sets the units for the simulation through the values used for the initial conditions, but one has to set the app...
PyLCARS/PythonUberHDL
myHDL_ComputerFundamentals/Counters/CountersInMyHDL.ipynb
bsd-3-clause
from myhdl import * from myhdlpeek import Peeker import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from sympy import * init_printing() import random #https://github.com/jrjohansson/version_information %load_ext version_information %version_information myhdl, myhdlpeek, numpy, ...
malogrisard/NTDScourse
toolkit/02_ex_exploitation.ipynb
mit
import pandas as pd import numpy as np from IPython.display import display import os.path folder = os.path.join('..', 'data', 'social_media') # Your code here. fb = pd.read_sql('facebook', 'sqlite:///' + os.path.join(folder, 'facebook.sqlite')) tw = pd.read_sql('twitter', 'sqlite:///' + os.path.join(folder, 'twitter....
ML4DS/ML4all
R1.Intro_Regression/.ipynb_checkpoints/regression_intro_student-checkpoint.ipynb
mit
# Import some libraries that will be necessary for working with data and displaying plots # To visualize plots in the notebook %matplotlib inline import numpy as np import scipy.io # To read matlab files import pandas as pd # To read data tables from csv files # For plots and graphical results import matplo...
wheeler-microfluidics/teensy-minimal-rpc
teensy_minimal_rpc/notebooks/dma-examples/Example - [BROKEN] Periodic multi-channel ADC multiple samples using DMA and PIT.ipynb
gpl-3.0
import pandas as pd def get_pdb_divide_params(frequency, F_BUS=int(48e6)): mult_factor = np.array([1, 10, 20, 40]) prescaler = np.arange(8) clock_divide = (pd.DataFrame([[i, m, p, m * (1 << p)] for i, m in enumerate(mult_factor) for p in prescaler], ...
bearing/dosenet-analysis
Programming Lesson Modules/Module 4- Example Plot of Weather Data.ipynb
mit
%matplotlib inline import csv import io import urllib.request import matplotlib.pyplot as plt import matplotlib.dates as mdates # another matplotlib convention; this extension facilitates dates as # axes labels. from datetime import datetime # we will use the datetime extension so we ca...
phoebe-project/phoebe2-docs
2.2/tutorials/ltte.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: Rømer and Light Travel Time Effects (ltte) 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 """...
woobe/h2o_tutorials
introduction_to_machine_learning/py_03a_regression_basics.ipynb
mit
# Start and connect to a local H2O cluster import h2o h2o.init(nthreads = -1) """ Explanation: Machine Learning with H2O - Tutorial 3a: Regression Models (Basics) <hr> Objective: This tutorial explains how to build regression models with four different H2O algorithms. <hr> Wine Quality Dataset: Source: https://ar...
ES-DOC/esdoc-jupyterhub
notebooks/cccr-iitm/cmip6/models/iitm-esm/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cccr-iitm', 'iitm-esm', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: CCCR-IITM Source ID: IITM-ESM Topic: Atmos Sub-Topics: Dynamical Core, Radiation...
widdowquinn/Notebooks-Bioinformatics
Biopython_NCBI_Entrez_downloads.ipynb
mit
# This line imports the Bio.Entrez module, and makes it available # as 'Entrez'. from Bio import Entrez # The line below imports the Bio.SeqIO module, which allows reading # and writing of common bioinformatics sequence formats. from Bio import SeqIO # Create a new directory (if needed) for output/downloads import os...
iRipVanWinkle/ml
mlcourse_open[solutions]/homeworks/hw3_session2_decision_trees.ipynb
mit
import numpy as np import pandas as pd from matplotlib import pyplot as plt %matplotlib inline from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score from sklearn.metrics import accuracy_score from sklearn.tree import DecisionTreeClassifier, export_graphviz """ Explanation: <center> <img s...
widdowquinn/notebooks
sampling_fnr_fpr.ipynb
mit
%pylab inline from scipy import stats from ipywidgets import interact, fixed def sample_distributions(mu_neg, mu_pos, sd_neg, sd_pos, n_neg, n_pos, fnr, fpr, clip_low, clip_high): """Returns subsamples and observations from two normal distributions. -...
ES-DOC/esdoc-jupyterhub
notebooks/hammoz-consortium/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', 'hammoz-consortium', 'sandbox-2', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: HAMMOZ-CONSORTIUM Source ID: SANDBOX-2 Topic: Landice Sub-Topics: G...
ljwolf/pysal
pysal/contrib/viz/mapping_guide.ipynb
bsd-3-clause
shp_link = ps.examples.get_path('columbus.shp') shp = ps.open(shp_link) some = [bool(random.getrandbits(1)) for i in ps.open(shp_link)] fig = plt.figure() base = maps.map_poly_shp(shp) base.set_facecolor('none') base.set_linewidth(0.75) base.set_edgecolor('0.8') some = maps.map_poly_shp(shp, which=some) some.set_alph...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/19_Autoencoders/notebooks/autoencoder/Simple_Autoencoder_Solution.ipynb
mit
%matplotlib inline 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', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
GoogleCloudPlatform/ai-platform-samples
notebooks/samples/tables/census_income_prediction/getting_started_notebook.ipynb
apache-2.0
# Use the latest major GA version of the framework. ! pip install --upgrade --quiet --user --user google-cloud-automl """ Explanation: Getting Started with AutoML Tables <table align="left"> <td> <a href="https://colab.sandbox.google.com/github/GoogleCloudPlatform/ai-platform-samples/blob/main/notebooks/samples/...
rvuduc/cse6040-ipynbs
14--pagerank-partial-solns2.ipynb
bsd-3-clause
import sqlite3 as db import pandas as pd def get_table_names (conn): assert type (conn) == db.Connection # Only works for sqlite3 DBs query = "SELECT name FROM sqlite_master WHERE type='table'" return pd.read_sql_query (query, conn) def print_schemas (conn, table_names=None, limit=0): assert type (con...
jacobdein/alpine-soundscapes
utilities/Set weather data datetime.ipynb
mit
weather_filepath = "" """ Explanation: Set weather data datetime This notebook formats a date and a time column for weather data measurements with a unix timestamp. Each measurement is then inserted into a pumilio database. Required packages <a href="https://github.com/pydata/pandas">pandas</a> <br /> <a href="https:/...
CQuIC/pysme
notebooks/mollow-triplets/mollow-triplets-2.ipynb
mit
from functools import partial import pdb import pickle import numpy as np from scipy.optimize import minimize from scipy.fftpack import fft, fftshift, fftfreq from scipy.integrate import quad from scipy.special import factorial, sinc import matplotlib.pyplot as plt import pysme.integrate as integ import pysme.hierarc...
phoebe-project/phoebe2-docs
development/tutorials/distance.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Distance Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as np import matplo...
GoogleCloudPlatform/cloudml-samples
notebooks/scikit-learn/TrainingWithScikitLearnInCMLE.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...
gaufung/ISL
training-materials/Stasmodels-training/OLS.ipynb
mit
import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std %matplotlib inline """ Explanation: Ordinary Least Squares End of explanation """ # artificial data nsample = 100 x = np.linspace(0, 10, nsample) X = np.column_stack((...
iurilarosa/thesis
codici/Archiviati/numpy/.ipynb_checkpoints/Hough Numpy-checkpoint.ipynb
gpl-3.0
import scipy.io import pandas import numpy import os from matplotlib import pyplot from scipy import sparse import multiprocessing %matplotlib inline #carico file dati percorsoFile = "/home/protoss/Documenti/TESI/DATI/peakmap1.mat.mat" #print(picchi.shape) #picchi[0] #nb: picchi ha 0-tempi # 1-frequenz...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-gris/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-gris', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-GRIS Topic: Ocean Sub-T...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_home/2020_covid.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: Algo - simulation COVID Ou comment utiliser les mathématiques pour comprendre la propagation de l'épidémie. End of explanation """ from pandas import read_csv, to_datetime url = "https://www.data.gouv.fr/en/datasets/...
rashikaranpuria/Machine-Learning-Specialization
Clustering_&_Retrieval/Week4/Assignment1/.ipynb_checkpoints/3_em-for-gmm_blank-checkpoint.ipynb
mit
import graphlab as gl import numpy as np import matplotlib.pyplot as plt import copy from scipy.stats import multivariate_normal %matplotlib inline """ Explanation: Fitting Gaussian Mixture Models with EM In this assignment you will * implement the EM algorithm for a Gaussian mixture model * apply your implementatio...
guiquanz/msaf
examples/Run MSAF.ipynb
mit
from __future__ import print_function import msaf import librosa import seaborn as sns # and IPython.display for audio output import IPython.display # Setup nice plots sns.set(style="dark") %matplotlib inline """ Explanation: Running MSAF The main MSAF functionality is demonstrated here. End of explanation """ # C...
edosedgar/xs-pkg
machine_learning/hw3/HW3/ML2019HW03-part1.ipynb
gpl-2.0
import numpy as np import pandas as pd import torch %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Home Assignment No. 3: Part 1 In this part of the homework you are to solve several problems related to machine learning algorithms. * For every separate problem you can get only 0 points or maxima...
sailuh/perceive
Notebooks/Dataset_Comparision/dataset_comparision.ipynb
gpl-2.0
#import packages import pandas as pd import glob import csv from xml.etree.ElementTree import ElementTree import re """ Explanation: Dataset Comparision End of explanation """ #function to load a csv file #accepts folderpath and headerlist as parameter to load the data files def file_csv(folderpath,addheader,headerl...
roatienza/Deep-Learning-Experiments
versions/2022/mlp/python/mlp_pytorch_demo.ipynb
mit
import torch import torchvision import wandb import math from torch import nn from einops import rearrange from argparse import ArgumentParser from pytorch_lightning import LightningModule, Trainer, Callback from pytorch_lightning.loggers import WandbLogger from torchmetrics.functional import accuracy from torch.optim ...
mne-tools/mne-tools.github.io
stable/_downloads/48e14d460d6470997b890b156746a671/30_strf.ipynb
bsd-3-clause
# Authors: Chris Holdgraf <choldgraf@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as plt import mne from mne.decoding import ReceptiveField, TimeDelayingRidge from scipy.stats import multivariate_normal from scipy.io import loadmat ...
Capepy/scipy_2015_sklearn_tutorial
notebooks/03.6 Case Study - Titanic Survival.ipynb
cc0-1.0
from sklearn.datasets import load_iris iris = load_iris() print(iris.data.shape) """ Explanation: Feature Extraction Here we will talk about an important piece of machine learning: the extraction of quantitative features from data. By the end of this section you will Know how features are extracted from real-world d...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/building_production_ml_systems/solutions/3_kubeflow_pipelines.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst pip freeze | grep kfp || pip install kfp from os import path import kfp import kfp.compiler as compiler import kfp.components as comp import kfp.dsl as dsl import kfp.gcp as gcp import kfp.notebook """ Explanation: Kubeflow pipelines Learning Object...
garth-wells/IA-maths-Jupyter
Lecture02.ipynb
mit
from sympy import * # This initialises pretty printing init_printing() from IPython.display import display # This command makes plots appear inside the browser window %matplotlib inline """ Explanation: Lecture 2: second-order ordinary differential equations We now look at solving second-order ordinary differential ...
linamnt/studyGroup
lessons/misc/quantum-computing/grovers-algorthim-2-qubits.ipynb
apache-2.0
import numpy as np from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Simulating Grover's Search Algorithm with 2 Qubits End of explanation """ zero = np.matrix([[1],[0]]); one = np.matrix([[0],[1]]); psi = np.kron(zero,zero); print(psi) """ Explanation: Define the zero and one vectors Define...
alshedivat/tensorflow
tensorflow/contrib/autograph/examples/notebooks/dev_summit_2018_demo.ipynb
apache-2.0
# Install TensorFlow; note that Colab notebooks run remotely, on virtual # instances provided by Google. !pip install -U -q tf-nightly import os import time import tensorflow as tf from tensorflow.contrib import autograph import matplotlib.pyplot as plt import numpy as np import six from google.colab import widgets...
benwaugh/NuffieldProject2016
notebooks/ROOTDataAccessExample.ipynb
mit
import pylab import matplotlib.pyplot as plt %matplotlib inline pylab.rcParams['figure.figsize'] = 12,8 """ Explanation: Simple test of using ROOT in a Python notebook Trying to read and process some data from a ROOT file over the network. Using material from * Example of a Z Analysis ROOT C++ kernel * ROOT reference ...
tensorflow/docs-l10n
site/ja/guide/keras/custom_callback.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...
jjehl/poppy_education
poppy-4dof-arm-mini/poppy_4dof_arm_mini_test.ipynb
gpl-2.0
import pypot.dynamixel import time """ Explanation: Some tests to check if your setup is running correctly - Using dynamixel XL320 motor End of explanation """ print(pypot.dynamixel.get_available_ports()) """ Explanation: Low level test Find the available usb port. The port where USB2AX or USBDynamixel is plug. End...
CristinaFoltea/pythonD3
IPythonD3.ipynb
bsd-2-clause
# import requirments from IPython.display import Image from IPython.display import display from IPython.display import HTML from datetime import * import json from copy import * from pprint import * import pandas as pd import numpy as np import matplotlib.pyplot as plt import json from ggplot import * import networkx ...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Introduction_to_Python/notebook.ipynb
unlicense
# This is a comment # These lines of code will not change any values # Anything following the first # is not run as code """ Explanation: Introduction to Python by Maxwell Margenot Part of the Quantopian Lecture Series: www.quantopian.com/lectures github.com/quantopian/research_public Notebook released under the Cre...
jrg365/gpytorch
examples/04_Variational_and_Approximate_GPs/Modifying_the_variational_strategy_and_distribution.ipynb
mit
import urllib.request import os from scipy.io import loadmat from math import floor # this is for running the notebook in our testing framework smoke_test = ('CI' in os.environ) if not smoke_test and not os.path.isfile('../elevators.mat'): print('Downloading \'elevators\' UCI dataset...') urllib.request.url...
jseabold/statsmodels
examples/notebooks/statespace_structural_harvey_jaeger.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from IPython.display import display, Latex """ Explanation: Detrending, Stylized Facts and the Business Cycle In an influential article, Harvey and Jaeger (1993) described the use of unobserved comp...
empet/Math
hypocycloid-online.ipynb
bsd-3-clause
from IPython.display import Image Image(filename='generate-hypocycloid.png') """ Explanation: Hypocycloid definition and animation Deriving the parametric equations of a hypocycloid On May 11 @fermatslibrary posted a gif file, https://twitter.com/fermatslibrary/status/862659602776805379, illustrating the motion of eig...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session14/Day2/BuildingPerceptronsForClassification.ipynb
mit
def walk_dog( # complete '''Perceptron to calculate whether we should walk the dog Parameters ---------- questions : array-like, size = 3 weights : array-lik, optional (default = np.array([-2, -1, 5])) threshold : float, optional (default = 2.5) decision threshold for whether to wal...
dinrker/PredictiveModeling
Session 3 - Classification.ipynb
mit
from IPython.display import Image import matplotlib.pyplot as plt import numpy as np import pandas as pd import time %matplotlib inline """ Explanation: Goals of this Lesson Extend the regression framework to support classification Logistic Regression Training with Gradient Descent Training with Newton's Method ...
transcranial/keras-js
notebooks/layers/pooling/GlobalAveragePooling2D.ipynb
mit
data_in_shape = (6, 6, 3) L = GlobalAveragePooling2D(data_format='channels_last') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(270) data_in = 2 * np.random.random(data_in_shape) - 1 result...
jmhsi/justin_tinker
data_science/courses/temp/courses/dl1/embedding_refactoring_unit_tests.ipynb
apache-2.0
embed = torch.nn.Embedding(10,3) words = torch.autograd.Variable(torch.LongTensor([[1,2,4,5] ,[4,3,2,9]])) """ Explanation: Test 1 Initialize embedding matrix and input End of explanation """ torch.manual_seed(88123) dropout_out_old = embedded_dropout(embed, words, dropout=0.40) dropout_out_old """ Explanation: pro...
martinjrobins/hobo
examples/toy/distribution-neals-funnel.ipynb
bsd-3-clause
import pints import pints.toy import numpy as np import matplotlib.pyplot as plt # Create log pdf log_pdf = pints.toy.NealsFunnelLogPDF() # Plot marginal density levels = np.linspace(-7, -1, 20) x = np.linspace(-10, 10, 100) y = np.linspace(-10, 10, 100) X, Y = np.meshgrid(x, y) Z = [[log_pdf.marginal_log_pdf(i, j) f...
ampl/amplpy
notebooks/colab_bash.ipynb
bsd-3-clause
!pip install -q amplpy """ Explanation: AMPLPY: Google Colab Template Documentation: http://amplpy.readthedocs.io GitHub Repository: https://github.com/ampl/amplpy PyPI Repository: https://pypi.python.org/pypi/amplpy Jupyter Notebooks: https://github.com/ampl/amplpy/tree/master/notebooks Setup End of explanation """ ...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-2/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbul...
YeEmrick/learning
cs231/assignment/assignment1/two_layer_net.ipynb
apache-2.0
# A bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.neural_net import TwoLayerNet from __future__ import print_function %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['im...
bjshaw/phys202-2015-work
days/day11/Interpolation.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns """ Explanation: Interpolation Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy. End of explanation """ x = np.linspace(0,4*np.pi,10) x """ Explanation: Overview W...
mattmcd/PyBayes
scripts/amm_math_20210308.ipynb
apache-2.0
from IPython.display import HTML # Hide code cells https://gist.github.com/uolter/970adfedf44962b47d32347d262fe9be def hide_code(): return HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $("div.input").hide(); } else { $("div.input").show(); ...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/deep-learning/tensor-flow-exercises/2_fullyconnected.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. import cPickle as pickle import numpy as np import tensorflow as tf """ Explanation: Deep Learning with TensorFlow Credits: Forked from TensorFlow by Google Setup Refer to the setup instructions. Exercise 2 Pre...
gdsfactory/gdsfactory
docs/notebooks/04_components_hierarchy.ipynb
mit
import gdsfactory as gf # gf.CONF.plotter = 'holoviews' @gf.cell def bend_with_straight( bend=gf.components.bend_euler, straight=gf.components.straight, ) -> gf.Component: c = gf.Component() b = bend() s = straight() bref = c << b sref = c << s sref.connect("o2", bref.ports["o2"]) ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/image_classification/labs/1_mnist_linear.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst import os import shutil import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.callbacks import ModelCheckpoint, TensorBoard from tensorflow.keras.layers import Dense, F...
noammor/coursera-machinelearning-python
ex4/ml-ex4.ipynb
mit
import numpy as np import scipy.io import scipy.optimize import matplotlib.pyplot as plt %matplotlib inline # uncomment for console - useful for debugging # %qtconsole ex3data1 = scipy.io.loadmat("./ex4data1.mat") X = ex3data1['X'] y = ex3data1['y'][:,0] m, n = X.shape m, n input_layer_size = n # 20x20 Input Image...
flutter/codelabs
tfrs-flutter/step5/backend/ranking/ranking.ipynb
bsd-3-clause
#@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...
quantumlib/OpenFermion-Cirq
openfermioncirq/experiments/hfvqe/quickstart.ipynb
apache-2.0
# Import library functions and define a helper function import numpy as np import cirq from openfermioncirq.experiments.hfvqe.gradient_hf import rhf_func_generator from openfermioncirq.experiments.hfvqe.opdm_functionals import OpdmFunctional from openfermioncirq.experiments.hfvqe.analysis import (compute_opdm, ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/labs/samples/core/ai_platform/ai_platform.ipynb
apache-2.0
%%capture # Install the SDK (Uncomment the code if the SDK is not installed before) !python3 -m pip install 'kfp>=0.1.31' --quiet !python3 -m pip install pandas --upgrade -q """ Explanation: Chicago Crime Prediction Pipeline An example notebook that demonstrates how to: * Download data from BigQuery * Create a Kubef...
ScottFreeLLC/AlphaPy
alphapy/examples/Trading Model/A Trading Model.ipynb
apache-2.0
%matplotlib inline import numpy as np import pandas as pd pwd cd output ls """ Explanation: This notebook analyzes the predictions of the trading model. <br/>At different thresholds, how effective is the model at predicting<br/> larger-than-average range days? End of explanation """ ranking_frame = pd.read_csv('...
rochefort-lab/fissa
examples/Basic usage.ipynb
gpl-3.0
# Import the FISSA toolbox import fissa """ Explanation: Object-oriented FISSA interface This notebook contains a step-by-step example of how to use the object-oriented (class-based) interface to the FISSA toolbox. The object-oriented interface, which involves creating a fissa.Experiment instance, allows more flexibli...
javierfdr/credit-scoring-analysis
src/credit_notebook.ipynb
mit
%matplotlib inline from classifiers import * from dim_red import * """ Explanation: Fitting Linear and Non-Linear Models to solve the German credit risk scoring classification problem Let's import the support libraries developed manually for this project and load the original dataset End of explanation """ [X,y] = ...
makcedward/nlpaug
example/flow.ipynb
mit
import os os.environ["MODEL_DIR"] = '../model' """ Explanation: Example of Flow Usage<a class="anchor" id="home"></a>: Flow Sequential Sometimes End of explanation """ import nlpaug.augmenter.char as nac import nlpaug.augmenter.word as naw import nlpaug.augmenter.sentence as nas import nlpaug.flow as naf from nlpa...
ozak/geopandas
examples/choropleths.ipynb
bsd-3-clause
%matplotlib inline import geopandas as gpd import matplotlib.pyplot as plt # We use a PySAL example shapefile import pysal as ps pth = ps.examples.get_path("columbus.shp") tracts = gpd.GeoDataFrame.from_file(pth) print('Observations, Attributes:',tracts.shape) tracts.head() """ Explanation: Choropleth classification...
mohsinhaider/pythonbootcampacm
Objects and Data Structures/List Comprehensions.ipynb
mit
# Store even numbers from 0 to 20 even_lst = [num for num in range(21) if num % 2 == 0] print(even_lst) """ Explanation: List Comprehensions and Generators Python comes with more than just a programming language, it also includes a way to write elegant code. Pythonic code is syntax that wishes to emulate natural const...
DavidDobr/icef_thesis
data/.ipynb_checkpoints/dobrinskiy_thesis_v2_october-Copy1-checkpoint.ipynb
gpl-3.0
# You should be running python3 import sys print(sys.version) import pandas as pd # http://pandas.pydata.org/ import numpy as np # http://numpy.org/ import statsmodels.api as sm # http://statsmodels.sourceforge.net/stable/index.html import statsmodels.formula.api as smf import statsmodels print("Pandas Version:...
dmolina/es_intro_python
02-Basic-Python-Syntax.ipynb
gpl-3.0
# set the midpoint midpoint = 5 # make two empty lists lower = []; upper = [] # split the numbers into lower and upper for i in range(10): if (i < midpoint): lower.append(i) else: upper.append(i) print("lower:", lower) print("upper:", upper) """ Explanation: <!--BOOK_INFORMATION--> <...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-2/cmip6/models/sandbox-2/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-2', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: TEST-INSTITUTE-2 Source ID: SANDBOX-2 Topic: Atmos Sub-Topics: Dynamical...
sz2472/foundations-homework
data and database/2016-06-21 NOTES.ipynb
mit
x= ["duck","aardvark","crocodile", "emu", "bee"] x.sort() x ### sorted by descending order sorted(x,reverse=True) ### sorted by second letter: #sorted(x, key=??) def get_second_letter(s): return s[1] get_second_letter("cheese") sorted(x,key=get_second_letter) #key is a parameter, value is a function:get_seco...
cwhanse/pvlib-python
docs/tutorials/forecast.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt # built in python modules import datetime import os # python add-ons import numpy as np import pandas as pd # for accessing UNIDATA THREDD servers from siphon.catalog import TDSCatalog from siphon.ncss import NCSS import pvlib from pvlib.forecast import GFS, HRRR_E...
calebmadrigal/radio-hacking-scripts
audio_signal_generation.ipynb
mit
# Imports and boilerplate to make graphs look better %matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy import wave import random from IPython.display import Audio def setup_graph(title='', x_label='', y_label='', fig_size=None): fig = plt.figure() if fig_size != None: f...
the-deep-learners/nyc-ds-academy
notebooks/intro_to_tensorflow_times_a_million.ipynb
mit
import numpy as np np.random.seed(42) import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import tensorflow as tf tf.set_random_seed(42) xs = np.linspace(0., 8., 8000000) # eight million points spaced evenly over the interval zero to eight ys = 0.3*xs-0.8+np.random.normal(scale=0.25, size=len(xs)) #...
scruwys/and-the-award-goes-to
notebooks/prepare_data.ipynb
mit
import re import pandas as pd import numpy as np pd.set_option('display.float_format', lambda x: '%.3f' % x) nominations = pd.read_csv('../data/nominations.csv') # clean out some obvious mistakes... nominations = nominations[~nominations['film'].isin(['2001: A Space Odyssey', 'Oliver!', 'Closely Observed Train'])] n...
svdwulp/da-programming-1
week_01_oefeningen_uitwerkingen.ipynb
gpl-2.0
## Opgave 1 - uitwerking for A in [False, True]: for B in [False, True]: print(A, B, not(A or B)) """ Explanation: Data Analysis - Programming Week 1 Oefeningen met uitwerkingen Opageve 1. Schrijf een Python programma dat de waarheidstabel van de volgende expressie produceert: $\neg{(A \lor B)}$ (Quine's D...
jinzishuai/learn2deeplearn
deeplearning.ai/C5.SequenceModel/Week1_RNN/assignment/Dinosaur Island -- Character-level language model/Dinosaurus Island -- Character level language model final - v1.ipynb
gpl-3.0
import numpy as np from utils import * import random from random import shuffle """ Explanation: Character level language model - Dinosaurus land Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers...
SylvainCorlay/bqplot
examples/Tutorials/Object Model.ipynb
apache-2.0
from bqplot import (LinearScale, Axis, Figure, OrdinalScale, LinearScale, Bars, Lines, Scatter) # first, let's create two vectors x and y to plot using a Lines mark import numpy as np x = np.linspace(-10, 10, 100) y = np.sin(x) # 1. Create the scales xs = LinearScale() ys = LinearScale() # 2. Cr...
eneskemalergin/OldBlog
_oldnotebooks/Inferential_Statistics.ipynb
mit
# Calling the binom module from scipy stats package from scipy.stats import binom # Plotting Function import matplotlib.pyplot as plt %matplotlib inline x = list(range(7)) n, p = 6, 0.5 rv = binom(n, p) plt.vlines(x, 0, rv.pmf(x), colors='r', linestyles='-', lw=1, label='Probability') plt.legend(loc='best', frameon=...
gaoshuming/udacity
image-classification/dlnd_image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' # Use Floyd's cifar-10 dataset if present floyd_cifar10...
suryaavala/stockprediction
Crypto/btc/PrepareData - Technical Indicators.ipynb
mit
def MACD(df,period1,period2,periodSignal): EMA1 = pd.DataFrame.ewm(df,span=period1).mean() EMA2 = pd.DataFrame.ewm(df,span=period2).mean() MACD = EMA1-EMA2 Signal = pd.DataFrame.ewm(MACD,periodSignal).mean() Histogram = MACD-Signal return Histogram def stochastics_oscillator(df,p...
danresende/deep-learning
sentiment_network/.ipynb_checkpoints/Sentiment Classification - Mini Project 5-checkpoint.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
vvishwa/deep-learning
batch-norm/Batch_Normalization_Lesson.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) "...
MartyWeissman/Python-for-number-theory
PwNT Notebook 1.ipynb
gpl-3.0
2 + 3 2 * 3 5 - 11 5 / 11 """ Explanation: Part 1. Computing with Python. What is the difference between Python and a calculator? We begin this first lesson by showing how Python can be used as a calculator, and we move into some of the basic programming language constructs: data types, variables, lists, and loo...