repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
tomchor/pymicra
publications/agu2017/pprog/.ipynb_checkpoints/simple_case-checkpoint.ipynb
gpl-3.0
pm.util.qc_replace(fnames, fconfig, file_lines=36000, lower_limits=dict(theta_v=10, mrho_h2o=0, mrho_co2=0), upper_limits=dict(theta_v=45), spikes_test=True, max_replacement_count=360, # replacement count test chunk_size=1200, outdir='out1', replaced_report='rrep.txt') fnames2 = sorted(...
htygithub/bokeh
examples/charts/notebook/scatter.ipynb
bsd-3-clause
df2 = df_from_json(data) df2 = df2.sort('medals.total', ascending=False) df2 = df2.head(10) df2 = pd.melt(df2, id_vars=['abbr', 'name']) scatter5 = Scatter( df2, x='value', y='name', color='variable', title="x='value', y='name', color='variable'", xlabel="Medals", ylabel="Top 10 Countries", legend='bottom_righ...
openfisca/openfisca-france-indirect-taxation
openfisca_france_indirect_taxation/examples/notebooks/quantites_agregats_transports.ipynb
agpl-3.0
%matplotlib inline from ipp_macro_series_parser.agregats_transports.transports_cleaner import a6_b, g2_1, g_3a from openfisca_france_indirect_taxation.examples.utils_example import graph_builder_carburants, \ graph_builder_carburants_no_color """ Explanation: Ce script réalise des graphiques à partir des données...
google/svcca
tutorials/001_Introduction.ipynb
apache-2.0
import os, sys from matplotlib import pyplot as plt %matplotlib inline import numpy as np import pickle import pandas import gzip sys.path.append("..") import cca_core def _plot_helper(arr, xlabel, ylabel): plt.plot(arr, lw=2.0) plt.xlabel(xlabel) plt.ylabel(ylabel) plt.grid() """ Explanation: <h1>Ta...
Heroes-Academy/OOP_Spring_2016
notebooks/giordani/Python_3_OOP_Part_1__Objects_and_types.ipynb
mit
# This is some data data = (13, 63, 5, 378, 58, 40) # This is a procedure that computes the average def avg(d): return sum(d)/len(d) avg(data) """ Explanation: About this series Object-oriented programming (OOP) has been the leading programming paradigm for several decades now, starting from the initial atte...
jgrizou/explauto
notebook/learning_with_environment_context.ipynb
gpl-3.0
%load_ext autoreload %autoreload 2 """ Explanation: Learning a sensorimotor model with a context provided by environment In this notebook, we will see how to use the Explauto libarary to allow the learning and control of actions that depend on a context provided by the environment. We suppose that the reader is famili...
aakashsinha19/Aspectus
Image Segmentation/tensorflow_notes-master/fully_convolutional_networks.ipynb
apache-2.0
%matplotlib inline from __future__ import division import os import sys import tensorflow as tf import skimage.io as io import numpy as np sys.path.append("/home/aakash-sinha/Documents/Tensorflow/tf-image-segmentation/") sys.path.append("/home/aakash-sinha/Documents/Tensorflow/models/slim/") fcn_16s_checkpoint_path...
softEcon/course
lectures/economic_models/career_choices/lecture.ipynb
mit
%matplotlib inline """ Explanation: Modelling Carrer Choices The model is based on the following research paper: Derek Neal (1999). The Complexity of Job Mobility among Young Men, Journal of Labor Economics, 17(2), 237-261. The implementation draws heavily from the material provided on the Quantitative Economics webs...
ramseylab/networkscompbio
class12_pagerank_python3.ipynb
apache-2.0
import pandas import igraph import numpy import matplotlib.pyplot import random """ Explanation: CS446/546 - Class Session 12 - Pagerank/Katz/Eigenvector centrality In this class session we are going to compute the outgoing-edge PageRank centrality of each gene (vertex) in a human gene regulatory network (a directed g...
eneskemalergin/OldBlog
_oldnotebooks/MemoryManagement_Assignment.ipynb
mit
def bestFit(number): # Function Header """ bestFit function takes a number from the job list and find its best fit from pre-defined partitions we have 3 different partition sizes: 16 32 64 Then bestFit returns the integer number of the partition size ...
NuGrid/NuPyCEE
DOC/Teaching/ExtraSources.ipynb
bsd-3-clause
%matplotlib nbagg import matplotlib.pyplot as plt import sys import matplotlib import numpy as np from NuPyCEE import sygma as s from NuPyCEE import omega as o from NuPyCEE import read_yields as ry """ Explanation: How to use different extra sources such as CCSN neutrino-driven winds Prepared by Christian Ritter End ...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch2-Problem_2-17.ipynb
unlicense
%pylab notebook """ Explanation: Excercises Electric Machinery Fundamentals Chapter 2 Problem 2-17 End of explanation """ Vp = 600 # [V] Vl = 120 # [V] which is also the load voltage Vh = 480 # [V] Sw = 10e3 # [VA] """ Explanation: Description A 10-kVA 480/120-V conventional transformer is to be used to supply ...
ledeprogram/algorithms
class6/donow/Skinner_Barnaby_DoNow_6.ipynb
gpl-3.0
import pandas as pd %matplotlib inline import matplotlib.pyplot as plt import statsmodels.formula.api as smf """ Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model End of explanation """ df = pd.read_csv("data/hanford.csv") df """ Explanation: 2. Read in t...
riceda195/kernel_gateway_demos
scotch_demo/notebooks/scotch_api_python.ipynb
bsd-3-clause
import pandas as pd import pickle import requests import json """ Explanation: Got Scotch API? This notebook is meant to demonstrate the transformation of an annotated notebook into a HTTP API using the Jupyter kernel gateway. The result is a simple scotch recommendation engine. The original scotch data is from https:...
denglert/manuals
python/modules/numpy/notebooks/meshgrid.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline x = np.linspace(1.0, 6.0, 5) y = np.linspace(12.0, 15.0, 3) X,Y = np.meshgrid(x,y, indexing='xy') """ Explanation: np.meshgrid() Return coordinate matrices from coordinate vectors. Make N-D coordinate arrays for vectorized evaluations of N-D scala...
AI-Innovation/cs231n_ass1
.ipynb_checkpoints/knn-checkpoint.ipynb
mit
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inline plt.rcParams['figure.figsize'] = (10....
aymeric-spiga/eduplanet
TOOLS/atlas.ipynb
gpl-2.0
filename = 'resultat.nc' import numpy as np import matplotlib.pyplot as plt from pylab import * import cartopy.crs as ccrs from netCDF4 import Dataset %matplotlib inline data = Dataset(filename) """ Explanation: Atlas de l'expérience keyexp Rappel : pour enregistrer une figure, placer cette ligne après la figure en...
dtamayo/MachineLearning
Day1/04_model_training.ipynb
gpl-3.0
# import load_iris function from datasets module from sklearn.datasets import load_iris # save "bunch" object containing iris dataset and its attributes iris = load_iris() # store feature matrix in "X" X = iris.data # store response vector in "y" y = iris.target # print the shapes of X and y print X.shape print y.s...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Beta_Hedging/notebook.ipynb
unlicense
# Import libraries import numpy as np from statsmodels import regression import statsmodels.api as sm import matplotlib.pyplot as plt import math # Get data for the specified period and stocks start = '2014-01-01' end = '2015-01-01' asset = get_pricing('TSLA', fields='price', start_date=start, end_date=end) benchmark ...
albireox/marvin
docs/sphinx/jupyter/my-first-query.ipynb
bsd-3-clause
# Python 2/3 compatibility from __future__ import print_function, division, absolute_import from marvin import config config.setRelease('MPL-4') from marvin.tools.query import Query """ Explanation: My First Query One of the most powerful features of Marvin 2.0 is ability to query the newly created DRP and DAP datab...
leriomaggio/code-coherence-analysis
JFreeChart Versions - Diving Differences.ipynb
bsd-3-clause
# %load preamble_directives.py """Some imports and path settings to make notebook code running smoothly. """ # Author: Valerio Maggio <valeriomaggio@gmail.com> # Copyright (c) 2015 Valerio Maggio <valeriomaggio@gmail.com> # License: BSD 3 clause import sys, os # Extending PYTHONPATH to allow relative import! sys.path....
dcavar/python-tutorial-for-ipython
notebooks/Word2Vec.ipynb
apache-2.0
import numpy as np """ Explanation: Word2Vec Example (C) 2018 by Damir Cavar Version: 1.1, November 2018 License: Creative Commons Attribution-ShareAlike 4.0 International License (CA BY-SA 4.0) This is a tutorial related to the L665 course on Machine Learning for NLP focusing on Deep Learning, Spring and Fall 2018 at...
BrentDorsey/pipeline
gpu.ml/notebooks/05a_Train_Model_Distributed_GPU.ipynb
apache-2.0
import tensorflow as tf cluster = tf.train.ClusterSpec({"local": ["localhost:2222", "localhost:2223"]}) """ Explanation: Train Model on Distributed Cluster IMPORTANT: You Must STOP All Kernels and Terminal Session The GPU is wedged at this point. We need to set it free!! Define ClusterSpec End of explanation """ ...
unpingco/python_for_prob_stats_ml
chapters/probability/notebooks/moment_generating.ipynb
mit
import sympy as S from sympy import stats p,t = S.symbols('p t',positive=True) x=stats.Binomial('x',10,p) mgf = stats.E(S.exp(t*x)) """ Explanation: Python for Probability, Statistics, and Machine Learning Moment Generating Functions Generating moments usually involves integrals that are extremely difficult to compute...
pombredanne/gensim
docs/notebooks/word2vec.ipynb
lgpl-2.1
# import modules & set up logging import gensim, logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) sentences = [['first', 'sentence'], ['second', 'sentence']] # train word2vec on the two sentences model = gensim.models.Word2Vec(sentences, min_count=1) """ Explanation:...
axt/cfg-explorer
examples/demo.ipynb
bsd-2-clause
import os import sys from pathlib import Path sys.path.insert(0,str(Path().resolve().parent)) """ Explanation: Demo for functional usage of CFG-explorer Now, cfg-explorer can not only be used as a command line tool. We can also call it within a Python program. Download Spec CPU Benchmark 2006 Save the suite outside o...
samuxiii/notebooks
houses/House Prices Attempts.ipynb
apache-2.0
import numpy as np import pandas as pd #load the files train = pd.read_csv('input/train.csv') test = pd.read_csv('input/test.csv') data = pd.concat([train, test]) #size of training dataset train_samples = train.shape[0] test_samples = test.shape[0] # remove the Id feature data.drop(['Id'],1, inplace=True); #data.de...
osamoylenko/YSDA_deeplearning17
Seminar2/Homework2.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import random from IPython import display from sklearn import datasets, preprocessing (X, y) = datasets.make_circles(n_samples=1024, shuffle=True, noise=0.2, factor=0.4) ind = np.logical_or(y==1, X[:,1] > X[:,0] - 0.5) X = X[ind,:] X = preprocessing...
CELMA-project/CELMA
MES/singleOperators/5-D2DZ2Cylinder/calculations/exactSolutions.ipynb
lgpl-3.0
%matplotlib notebook from sympy import init_printing from sympy import S from sympy import sin, cos, tanh, exp, pi, sqrt from boutdata.mms import x, y, z, t from boutdata.mms import DDZ import os, sys # If we add to sys.path, then it must be an absolute path common_dir = os.path.abspath('./../../../../common') # Sys...
yingchi/fastai-notes
deeplearning1/rnn/tf-rnn-modu.ipynb
apache-2.0
import pickle import os import re def load_text(path): input_file = os.path.join(path) with open(input_file, 'r') as f: text_data = f.read() return text_data def preprocess_and_save_data(text, token_lookup, create_lookup_tables): token_dict = token_lookup() for key, token in token_dict.ite...
RittmanResearch/maybrain
docs/02 - The utils Package.ipynb
apache-2.0
from maybrain import utils from maybrain import resources as rr from maybrain import brain as mbt a = mbt.Brain() a.import_adj_file(rr.DUMMY_ADJ_FILE_500) a.import_spatial_info(rr.MNI_SPACE_COORDINATES_500) a.apply_threshold() """ Explanation: The utils Package As the name says, this package brings some extra functio...
johnpfay/environ859
03_Python/Notebooks/Session2.ipynb
gpl-3.0
#ForLoopExample.py # This example uses a for loop to iterate through each item in # the "fruit" list, updating the value of the "fruit" variable and # executing whatever lines are indented under the for statement #Create a list of fruit fruitList = ("apples","oranges","kiwi","grapes","blueberries") # Loop through...
geography-munich/sciprog
material/sub/koldunov/07 - Other modules for geoscientists.ipynb
apache-2.0
import iris import iris.quickplot as qplt temperature = iris.load_cube('air.sig995.2012.nc') qplt.contourf(temperature[0,:,:]) gca().coastlines() """ Explanation: Other modules for geoscientists Nikolay Koldunov koldunovn@gmail.com This is part of Python for Geosciences notes. ============= Some of the things will n...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_ems_filtering.ipynb
bsd-3-clause
# Author: Denis Engemann <denis.engemann@gmail.com> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io, EvokedArray from mne.datasets import sample from mne.decoding import EMS, compute_ems from sklearn.cross_...
rigetticomputing/pyquil
docs/source/quilt_waveforms.ipynb
apache-2.0
from pyquil.quilatom import TemplateWaveform def plot_waveform(wf: TemplateWaveform, sample_rate: float): """ Plot a template waveform by sampling at the specified sample rate. """ samples = wf.samples(sample_rate) times = np.arange(len(samples))/sample_rate print(wf) plt.plot(times, samples.real)...
nwfpug/meetings
2017-04-10/numpy_4_matlab_users.ipynb
gpl-3.0
import numpy as np import scipy.linalg as la """ Explanation: NumPy for Matlab users Introduction MATLAB® and NumPy/SciPy have a lot in common. But there are many differences. NumPy and SciPy were created to do numerical and scientific computing in the most natural way with Python, not to be MATLAB® clones. This page ...
scotthuang1989/Python-3-Module-of-the-Week
concurrency/threading - Manage Concurrent Operations within a process.ipynb
apache-2.0
import threading def worker(): """"thread worker function""" print("Worker\n") threads = [] for i in range(5): t = threading.Thread(target=worker) threads.append(t) t.start() """ Explanation: Using threads allows a program to run multiple operations concurrently in the same process space Thread ...
folivetti/PIPYTHON
Aula02.ipynb
mit
import math x = float(input("Entre com um valor: ")) y = math.log(x) print(y) """ Explanation: Introdução à Programação em Python Funções Na aula anterior utilizamos algumas funções para realizar certas operações além das fundamentais. End of explanation """ x = float(input("Entre com um valor: ")) print(math.cos( x...
binh-vu/python-tutorial
3.0_Data_structures.ipynb
mit
pets = ['dog', 'cat', 'pig'] print pets.index('cat') pets.insert(0, 'rabbit') print pets pets.pop(1) print pets """ Explanation: Lists Some methods of list: <code>list.append(x)</code>: add <code>x</code> to the end <code>list.insert(i, x)</code>: insert <code>x</code> at position <code>i</code> <code>list.index(x)...
GoogleCloudPlatform/training-data-analyst
quests/serverlessml/07_caip/solution/export_data.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst !pip install tensorflow==2.1 --user """ Explanation: Exporting data from BigQuery to Google Cloud Storage In this notebook, we export BigQuery data to GCS so that we can reuse our Keras model that was developed on CSV data. End of explanation """ %%...
quantopian/research_public
notebooks/lectures/Random_Variables/questions/notebook.ipynb
apache-2.0
# Useful Functions class DiscreteRandomVariable: def __init__(self, a=0, b=1): self.variableType = "" self.low = a self.high = b return def draw(self, numberOfSamples): samples = np.random.randint(self.low, self.high, numberOfSamples) return samples class Bin...
tsarouch/data_science_references_python
regression/address_business_questions.ipynb
gpl-2.0
from sklearn.datasets import load_boston boston = load_boston() # features df = pd.DataFrame(boston.data) df.columns = boston.feature_names # dependent variable df['PRICE'] = boston.target df.head(3) """ Explanation: Get Data End of explanation """ # Lets use only one feature df1 = df[['LSTAT', 'PRICE']] X = df1['L...
sassoftware/sas_kernel
notebook/loadSASExtensions.ipynb
apache-2.0
import notebook from __future__ import print_function from jupyter_core.paths import jupyter_data_dir, jupyter_path print(jupyter_data_dir()) print(jupyter_path()) """ Explanation: This notebook will help you install the SAS NBExtensions The process includes a mix of command line and python code and can be done either...
changhoonhahn/centralMS
centralms/notebooks/notes_SFRmpajhu_uncertainty.ipynb
mit
import numpy as np import scipy as sp import env import util as UT from ChangTools.fitstables import mrdfits from pydl.pydlutils.spheregroup import spherematch import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['text.usetex'] = True mpl.rcParams['font.family'] = 'serif' mpl.rcParams['axes.line...
ivannz/study_notes
year_14_15/spring_2015/netwrok_analysis/notebooks/labs/epidemics_ntwrks.ipynb
mit
import numpy as np import networkx as nx import matplotlib.pyplot as plt from numpy.linalg import eig from scipy.integrate import odeint %matplotlib inline # Let's start from a complete graph n = 100 G = nx.complete_graph(n) # G = nx.barabasi_albert_graph(n, 3) # Get adj. matrix A = np.array( nx.adjacency_matrix(G).t...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/gapic/automl/showcase_automl_tabular_classification_batch_explain.ipynb
apache-2.0
import os import sys # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install -U google-cloud-aiplatform $USER_FLAG """ Explanation: Vertex client library: AutoML tabular classification model for batch prediction with explan...
ElMejorEquipoDeLaSerena/VariableStarsClassification
Final.ipynb
mit
import os.path import sys import urllib import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import pylab as pl from sklearn import svm, cross_validation, metrics from sklearn.grid_search import GridSearchCV from sklearn.naive_bayes import GaussianNB import sc...
Elucidation/Ngram-Tutorial
NgramTutorial.ipynb
mit
# Find the number links by looking on Project Gutenberg in the address bar for a book. books = {'Pride and Prejudice': '1342', 'Huckleberry Fin': '76', 'Sherlock Holmes': '1661'} book = books['Pride and Prejudice'] # Load text from Project Gutenberg URL import urllib2 url_template = 'https://www.gut...
GoogleCloudPlatform/asl-ml-immersion
notebooks/text_models/labs/reusable_embeddings.ipynb
apache-2.0
import os import pandas as pd from google.cloud import bigquery """ Explanation: Reusable Embeddings Learning Objectives 1. Learn how to use a pre-trained TF Hub text modules to generate sentence vectors 1. Learn how to incorporate a pre-trained TF-Hub module into a Keras model 1. Learn how to deploy and use a text m...
balarsen/pymc_learning
Inversion/Inversion2.ipynb
bsd-3-clause
def get_data(x, mag=100, pl=-2.5, xmin=50.0): C = (-pl - 1)*xmin**(-pl-1) return mag/0.03*C*x**(pl) get_data(50) 50**-2.5 100**(-1/2.5) * 50**-2.5 pl = -2.5 xmin = 50 C = (-pl - 1)*xmin**(-pl-1) get_data(50) plt.loglog(tb.logspace(50, 5000, 10), get_data(tb.logspace(50, 5000, 10))) """ Explanation: ...
kastnerkyle/kastnerkyle.github.io-nikola
blogsite/posts/polyphase-signal-processing.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt %matplotlib inline def gen_complex_chirp(fs=44100, pad_frac=.01, time_s=1): f0= -fs / (2. * (1 + pad_frac)) f1= fs / (2. *(1 + pad_frac)) t1 = time_s beta = (f1 - f0) / float(t1) t = np.arange(0, t1, t1/ float(fs)) return np.exp(2j * np.pi * (....
tensorflow/docs-l10n
site/ko/tensorboard/dataframe_api.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...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: AWI Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
fsalmoir/PyGeM
tutorials/tutorial-2-iges.ipynb
mit
import pygem as pg params = pg.params.FFDParameters() params.read_parameters(filename='../tests/test_datasets/parameters_test_ffd_iges.prm') """ Explanation: PyGeM Tutorial 2: Free Form Deformation on a cylinder in iges file format In this tutorial we will show the typical workflow. In particular we are going to pars...
tpin3694/tpin3694.github.io
neural-networks/.ipynb_checkpoints/mnist_nn-checkpoint.ipynb
mit
%matplotlib inline from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense from keras.utils import to_categorical import numpy as np import matplotlib.pyplot as plt # Load data (X_train, y_train), (X_test, y_test) = mnist.load_data() print(X_train.shape) print(y_train.shape)...
JasonSanchez/w261
week11/MIDS-W261-HW-11-TEMPLATE.ipynb
mit
## Code goes here ## Drivers & Runners ## Run Scripts, S3 Sync """ Explanation: MIDS - w261 Machine Learning At Scale Course Lead: Dr James G. Shanahan (email Jimi via James.Shanahan AT gmail.com) Assignment - HW11 Name: Your Name Goes Here Class: MIDS w261 (Section Your Section Goes Here, e.g., Summer 2016 Grou...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/09_sequence_keras/labs/reusable-embeddings.ipynb
apache-2.0
# change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' """ Explanation: <h1>Using pre-trained embeddings with TensorFlow Hub</h1> This notebook illustrates: <ol> <li>How to instantiate a TensorFlow Hub module</li> <li>How to find pre...
jmschrei/pomegranate
tutorials/A_Overview.ipynb
mit
%matplotlib inline import time import pandas import random import numpy import matplotlib.pyplot as plt import seaborn; seaborn.set_style('whitegrid') import itertools from pomegranate import * random.seed(0) numpy.random.seed(0) numpy.set_printoptions(suppress=True) %load_ext watermark %watermark -m -n -p numpy,sci...
G-Node/nix-demo
NWB pvc-6 use-case.ipynb
bsd-3-clause
from nixio import * from utils.notebook import print_stats from utils.plotting import Plotter %matplotlib inline """ Explanation: NWB use-case pvc-6 --- Data courtesy of Jim Berg, Allen Institute for Brain Sciences --- Here we demonstrate how data from the NWB pvc-6 use-case can be stored in a NIX file. Context: Who...
ergosimulation/mpslib
scikit-mps/examples/ex01_mpslib_getting_started.ipynb
lgpl-3.0
import numpy as np import matplotlib.pyplot as plt import mpslib as mps """ Explanation: MPSlib: Getting started with MPSlib/scikit-mps in Python This a small example getting started with MPSlib through an iPython notebook End of explanation """ # Initialize MPSlib using default algortihm, and seetings O = mps.mpsl...
synthicity/activitysim
activitysim/examples/example_estimation/notebooks/16_nonmand_tour_scheduling.ipynb
agpl-3.0
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating Non-Mandatory Tour Scheduling This notebook illustrates how to re-estimate the non-mandatory tour scheduling component for ActivitySim. This process includes running ActivitySim in estimatio...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/feature_engineering/labs/7_get_started_with_feature_store.ipynb
apache-2.0
ONCE_ONLY = False if ONCE_ONLY: ! pip3 install -U tensorflow==2.5 $USER_FLAG ! pip3 install -U tensorflow-data-validation==1.2 $USER_FLAG ! pip3 install -U tensorflow-transform==1.2 $USER_FLAG ! pip3 install -U tensorflow-io==0.18 $USER_FLAG ! pip3 install --upgrade google-cloud-aiplatform[tensorboa...
navaro1/deep-learning
dcgan-svhn/DCGAN.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
sequana/resources
coverage/10-comparison_cnvnator_virus/compare_cnvnator_virus.ipynb
bsd-3-clause
%pylab inline matplotlib.rcParams['figure.figsize'] = [10,7] """ Explanation: Sequana_coverage versus CNVnator (viral genome) This notebook compares CNVnator, CNOGpro and sequana_coverage behaviour on a viral genome instance (same as in the virus notebook). Versions used: - sequana 0.7.0 End of explanation """ !wget...
goodwordalchemy/thinkstats_notes_and_exercises
code/chap13_survival_analysis_notes.ipynb
gpl-3.0
preg = nsfg.ReadFemPreg() complete = preg.query('outcome in [1,3,4]').prglngth cdf = thinkstats2.Cdf(complete, label='cdf') ##note: property is a method that can be invoked as if ##it were a variable. class SurvivalFunction(object): def __init__(self, cdf, label=''): self.cdf = cdf self.label ...
eds-uga/csci1360-fa16
lectures/QA1.ipynb
mit
lloyd = { "name": "Lloyd", "homework": [90.0,97.0,75.0,92.0], "quizzes": [88.0,40.0,94.0], "tests": [75.0,90.0] } alice = { "name": "Alice", "homework": [100.0, 92.0, 98.0, 100.0], "quizzes": [82.0, 83.0, 91.0], "tests": [89.0, 97.0] } tyler = { "name": "Tyler", "homework": [0.0, 87.0, 75.0, 22.0], ...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/statespace_forecasting.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt macrodata = sm.datasets.macrodata.load_pandas().data macrodata.index = pd.period_range('1959Q1', '2009Q3', freq='Q') """ Explanation: Forecasting in statsmodels This notebook describes forecasting u...
gear/HPSC
hw/assign1_worksheet.ipynb
gpl-3.0
x,y,exact = a.exact(128) fdm = np.zeros([100,128]) for i in range(100): fdm[i] = a.get_border(a.fdm(32,32,i*10,False)) """ Explanation: Initialization Compute exact result with 128 points and create a fdm result array with iteration ranging from 0 to 1000 by step of 10. End of explanation """ a.scatter_plot(x,...
tensorflow/docs
site/en/install/lang_c.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...
jonathanmorgan/msu_phd_work
methods/precision_recall/prelim_month-confusion_matrix.ipynb
lgpl-3.0
import datetime import math import pandas import pandas_ml import sklearn import sklearn.metrics import six import statsmodels import statsmodels.api print( "packages imported at " + str( datetime.datetime.now() ) ) %pwd """ Explanation: prelim_month - confusion matrix original title: 2017.09.20 - work log - prelim...
BrainIntensive/OnlineBrainIntensive
resources/nipype/nipype_tutorial/notebooks/example_normalize.ipynb
mit
!tree /data/antsdir/sub-0*/ """ Explanation: Example 3: Normalize data to MNI template This example covers the normalization of data. Some people prefer to normalize the data during the preprocessing, just before smoothing. I prefer to do the 1st-level analysis completely in subject space and only normalize the contra...
awadalaa/DataSciencePractice
python_tutorial/Python_Numpy_Tutorial.ipynb
mit
def quicksort(arr): if len(arr) <= 1: return arr pivot = arr[len(arr) / 2] left = [x for x in arr if x < pivot] middle = [x for x in arr if x == pivot] right = [x for x in arr if x > pivot] return quicksort(left) + middle + quicksort(right) print quicksort([3,6,8,10,1,2,1]) """ Exp...
npo-poms/pyapi
demo.ipynb
gpl-3.0
client = Media(env="test", debug=False).configured_login(create_config_file=True) """ Explanation: Talking to the NPO Frontend API with PYTHON You can instantiate a client like so End of explanation """ client.url """ Explanation: The credentials where read from a config file. If that file would not have existed, ...
mne-tools/mne-tools.github.io
dev/_downloads/b96d98f7c704193a3ede176aaf9433d2/85_brainstorm_phantom_ctf.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import os.path as op import warnings import numpy as np import matplotlib.pyplot as plt import mne from mne import fit_dipole from mne.datasets.brainstorm import bst_phantom_ctf from mne.io import read_raw_ctf print(__doc__) """ Explanation...
lukas/scikit-class
examples/notebooks/Lesson-5-Improving-Text-Classifier.ipynb
gpl-2.0
import pandas as pd import numpy as np from sklearn.model_selection import cross_val_score df = pd.read_csv('../scikit/tweets.csv') target = df['is_there_an_emotion_directed_at_a_brand_or_product'] text = df['tweet_text'] # We need to remove the empty rows from the text before we pass into CountVectorizer fixed_text ...
IS-ENES-Data/submission_forms
test/tinydb-test.ipynb
apache-2.0
from tinydb import TinyDB, Query import glob import json from pprint import pprint from dkrz_forms.config import settings db = TinyDB("/home/stephan/Forms/db.json") Form = Query() # to do: pycodestyle --show-source --show-pep8 dkrz_forms/form_handler.py json_files = glob.glob(settings.SUBMISSION_REPO+"/test/"+"*.jso...
taliamo/Final_Project
organ_pitch/Scripts/.ipynb_checkpoints/main_script-checkpoint.ipynb
mit
# I import useful libraries (with functions) so I can visualize my data # I use Pandas because this dataset has word/string column titles and I like the readability features of commands and finish visual products that Pandas offers import pandas as pd import matplotlib.pyplot as plt import re import numpy as np %matp...
pycam/python-functions-and-modules
python_fm_1.ipynb
unlicense
print('Hello from python!') # to print some text, enclose it between quotation marks - single print("I'm here today!") # or double print(34) # print an integer print(2 + 4) # print the result of an arithmetic operation print("The answer is", 42) # print multiple expressions, separat...
fotis007/python_intermediate
Python_2_7.ipynb
gpl-3.0
import matplotlib.pyplot as plt x = [10,20,30,40] y = [5, 3, 7, 4] plt.plot(x,y) plt.show() """ Explanation: Table of Contents <p><div class="lev2 toc-item"><a href="#Datenanalyse-III:-Viszualisierung-mit-Matplotlib-und-Seaborn" data-toc-modified-id="Datenanalyse-III:-Viszualisierung-mit-Matplotlib-und-Seaborn-01"><sp...
xesscorp/pygmyhdl
examples/5_fsm/fsm.ipynb
mit
from pygmyhdl import * @chunk def counter(clk_i, cnt_o): # Here's the counter state variable. cnt = Bus(len(cnt_o)) # The next state logic is just an adder that adds 1 to the current cnt state variable. @seq_logic(clk_i.posedge) def next_state_logic(): cnt.next = cnt + 1 ...
agvergara/DatatonURJC
Day3/Lab_3_regress.ipynb
gpl-3.0
#read data using pandas import pandas as pd import numpy as np data = pd.read_csv("boston.csv") #describe print np.sum(data.isnull()) #Usando isnull nos proporciona un booleano en caso de que tenga algun NaN, por lo que # si algun numero es distinto de 0 hay algun NaN data.describe() """ Explanation: Métodos de Reg...
anhaidgroup/py_entitymatching
notebooks/guides/.ipynb_checkpoints/Editing and Generate Features for Blocking Manually-checkpoint.ipynb
bsd-3-clause
# Import py_entitymatching package import py_entitymatching as em import os import pandas as pd """ Explanation: Contents Introduction Generating Features for Blocking Manually Introduction This IPython notebook illustrates how to generate features for blocking manually. First, we need to import py_entitymatching pa...
XInterns/IPL-Sparkers
src/Match Outcome Prediction with IPL Data (Soham).ipynb
mit
%matplotlib inline import numpy as np # imports a fast numerical programming library import matplotlib.pyplot as plt #sets up plotting under plt import pandas as pd #lets us handle data as dataframes #sets up pandas table display pd.set_option('display.width', 500) pd.set_option('display.max_columns', 100) pd.set_opti...
GoogleCloudPlatform/asl-ml-immersion
notebooks/feature_engineering/solutions/3_keras_basic_feat_eng.ipynb
apache-2.0
import os import matplotlib.pyplot as plt import pandas as pd import tensorflow import tensorflow as tf from sklearn.model_selection import train_test_split from tensorflow import feature_column as fc from tensorflow.keras import layers print("TensorFlow version: ", tf.version.VERSION) """ Explanation: Basic Feature...
SwissTPH/TBRU_serialTB
notebooks/1.6_ATR_Excessive_mutation.ipynb
gpl-3.0
#Python core packages from collections import Counter import string import pickle import datetime import warnings warnings.filterwarnings("ignore") #Additional Python packages import tqdm #Scientific packages from scipy import stats as ss import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt fro...
fdion/stemgraphic
notebooks/performance and usability overview.ipynb
mit
%matplotlib inline import pandas as pd import seaborn as sns from stemgraphic import stem_graphic texas = pd.read_csv('salaries.csv') texas.describe(include='all') """ Explanation: Performance Texas state salaries About 700,000 records. We'll use time to measure execution time. In the pydata video we used %timeit wh...
chagaz/ma2823_2016
lab_notebooks/Lab 7 2016-11-25 Support Vector Machines.ipynb
mit
import numpy as np %pylab inline # Load the data # Set up a stratified 10-fold cross-validation from sklearn import cross_validation folds = cross_validation.StratifiedKFold(y, 10, shuffle=True) """ Explanation: 2016-11-25: Support Vector Machines In this lab, we will apply support vector classification methods to ...
planet-os/notebooks
api-examples/cfsr_demo.ipynb
mit
%matplotlib inline import numpy as np from dh_py_access import package_api import dh_py_access.lib.datahub as datahub import xarray as xr import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from po_data_process import comparison_bar_chart, make_comparison_plot import warnings warnings.filterwarning...
spa-networks/hpa
solver/example_solver.ipynb
mit
state = np.array([0, 1]) birth_rate = 2 growth_rate = 1 for t in range(1, 10): state = solver.update_preferential_attachment(state, birth_rate, growth_rate, t) """ Explanation: Generalized PA equation This solver implements the generalized PA equation $$N_k(t+1) = N_k(t) + B\delta_{k,1} + \frac{G}{(B+G)t + K_0} [(...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/Introduction/4 - Python classes.ipynb
mit
class colour(object): rgb = (0.0,0.0,0.0) description = "Black" c = colour() d = colour() print c.description print c.rgb print d.description print d.rgb d.description = 'Blue' d.rgb = (0.0,0.0,1.0) print c.description print c.rgb print d.description print d.rgb """ Explanation: Classes and ...
chengts95/homeworkOfPowerSystem
power_system/调频计算.ipynb
gpl-2.0
Ka=100 Kb=200 Kc=200 dPla=100 dPgb=50 K=Ka+Kb+Kc df = lambda dPl,dPg,K: -(dPla-dPgb)/K df1=df(dPla,dPgb,K) trans_power=lambda Ka,Kb,Pa,Pb: (Ka*Pb-Kb*Pa)/(Ka+Kb) Pa=dPla Pb=dPgb Pc=0 #BC作为一个系统 Pab=trans_power(Ka,Kb+Kc,Pa,Pb+Pc) #AB作为一个系统 Pbc=trans_power(Kb+Ka,Kc,Pb+Pa,Pc) df1,Pab,Pbc """ Explanation: 22. 三个电力系统联合运行如图...
ethen8181/machine-learning
keras/nn_keras_hyperparameter_tuning.ipynb
mit
# code for loading the format for the notebook import os # path : store the current path to convert back to it later path = os.getcwd() os.chdir(os.path.join('..', 'notebook_format')) from formats import load_style load_style(plot_style=False) os.chdir(path) # 1. magic to print version # 2. magic so that the notebo...
guedou/scapy-appveyor
doc/notebooks/Scapy in 15 minutes.ipynb
gpl-2.0
send(IP(dst="1.2.3.4")/TCP(dport=502, options=[("MSS", 0)])) """ Explanation: Scapy in 15 minutes (or longer) Guillaume Valadon & Pierre Lalet Scapy is a powerful Python-based interactive packet manipulation program and library. It can be used to forge or decode packets for a wide number of protocols, send them on the...
Santana9937/language-translation
.ipynb_checkpoints/dlnd_language_translation-checkpoint.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
materialsvirtuallab/matgenb
notebooks/2018-11-6-Dopant suggestions using Pymatgen.ipynb
bsd-3-clause
# Imports we need for generating dopant suggestions from pymatgen.analysis.structure_prediction.dopant_predictor import \ get_dopants_from_shannon_radii, get_dopants_from_substitution_probabilities from pymatgen.analysis.local_env import CrystalNN from pymatgen import MPRester from pprint import pprint # Establi...
InsightLab/data-science-cookbook
2019/09-clustering/cl_JoãoCastelo.ipynb
mit
# import libraries # linear algebra import numpy as np # data processing import pandas as pd # data visualization from matplotlib import pyplot as plt #coolab upload from google.colab import files uploaded = files.upload() # load the data with pandas dataset = pd.read_csv('dataset.csv', header=None) dataset = np....
ES-DOC/esdoc-jupyterhub
notebooks/snu/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', 'snu', 'sandbox-1', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: SNU Source ID: SANDBOX-1 Topic: Aerosol Sub-Topics: Transport, Emissions, Concent...
sdpython/ensae_teaching_cs
_doc/notebooks/expose/BJKST.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: 2A.algo - Algorithmes de streaming : généralités Les streams (flux) de données sont aujourd'hui présents dans de nombreux domaines (réseaux sociaux, e-commerce, logs de connexion Internet, etc.). L'analyse rapide et pe...
OpenAstronomy/workshop_sunpy_astropy
02-Python1/02-Python-1-Lists_Instructor.ipynb
mit
odds = [1, 3, 5, 7] print('odds are:', odds) """ Explanation: Storing Multiple Values in Lists <br/> <section class="objectives panel panel-warning"> <div class="panel-heading"> <h2><span class="fa fa-certificate"></span> Learning Objectives </h2> </div> <ul> <li> Explain what a list is </li> <li> Create and index lis...
jaindeepali/jaindeepali.github.com
_includes/jupyter_notebooks/gym_demo.ipynb
mit
n_states = env.observation_space.n # number of states n_actions = env.action_space.n # number of actions print("This environment has %s states and %s actions." % (n_states, n_actions)) """ Explanation: What we see here is a layout of a 'frozen lake'. The agent can move in this world. Some tiles of the lake are walkabl...