repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
PYPIT/PYPIT
doc/nb/FluxSpec.ipynb
gpl-3.0
%matplotlib inline # import from importlib import reload import os from matplotlib import pyplot as plt import glob import numpy as np from astropy.table import Table from pypeit import fluxspec from pypeit.spectrographs.util import load_spectrograph """ Explanation: Fluxing with PYPIT [v2] End of explanation """ ...
gevero/py_gmm
examples/Chirality.ipynb
gpl-3.0
#------Library loading------ # numpy for matrix computations import numpy as np; import numpy.ma as ma # system libraries import sys # plotting libraries %matplotlib inline import matplotlib.pylab as plt # Generalized Multiparticle Mie import sys.path.append('../') import py_gmm """ Explanation: # Circular dichroi...
mbakker7/ttim
pumpingtest_benchmarks/2_test_of_dalem.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd from ttim import * """ Explanation: Leaky Aquifer Test This example is taken from Kruseman and de Ridder (1970) End of explanation """ H = 37 #aquifer thickness [m] zt = - 8 #top boundary of aquifer zb = zt - H Q = 761 #constan...
fluffy-hamster/A-Beginners-Guide-to-Python
A Beginners Guide to Python/20. Functions & Namespaces.ipynb
mit
def zero_args(): # code goes here pass def one_arg(a): # code goes here pass def two_args(a, b): # code goes here pass def optional_arg(a, b=0): # <--- please note, optional arguments are listed LAST # code goes here pass def two_options(a=True, b=False): # code goes here ...
stereoboy/Study
Issues/algorithms/Arrays and Strings.ipynb
mit
import random #STR = random.uniform(('a').encode('ascii'), int('Z')) #print(ord('A')) #print(ord('z')) #lowercase = [ chr(char) for char in range(ord('a'), ord('z') + 1)] #uppercase = [ chr(char) for char in range(ord('A'), ord('Z') + 1)] #string_seed = lowercase + uppercase #print(string_seed) def gen_randstr(): ...
beyondvalence/biof509_wtl
Wk03-OOP/Wk03-Paradigms_wl.ipynb
mit
primes = [] i = 2 while len(primes) < 25: for p in primes: if i % p == 0: break else: primes.append(i) i += 1 print(primes) """ Explanation: Week 3 - Programming Paradigms Learning Objectives List popular programming paradigms Demonstrate object oriented programming Compare pr...
hainm/mdtraj
examples/centroids.ipynb
lgpl-2.1
from __future__ import print_function %matplotlib inline import mdtraj as md import numpy as np """ Explanation: Finding centroids In this example, we're going to find a "centroid" (representitive structure) for a group of conformations. This group might potentially come from clustering, using method like Ward hierarc...
MIT-LCP/mimic-code-sharing
notebooks/vancomycin-dosing.ipynb
mit
# Import libraries from __future__ import print_function import numpy as np import pandas as pd import psycopg2 import socket import sys import os import getpass from collections import OrderedDict import matplotlib import matplotlib.pyplot as plt # colours for prettier plots import colorsys def gg_color_hue(n): ...
sdpython/ensae_teaching_cs
_doc/notebooks/td2a_ml/td2a_cenonce_session_4A.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: 2A.ml - Machine Learning et Marketting Prédire la souscription d'un contrat sur le jeu de données Bank Marketing Data Set . End of explanation """ url = "https://archive.ics.uci.edu/m...
phoebe-project/phoebe2-docs
2.3/tutorials/LC_estimators.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" import phoebe from phoebe import u # units import numpy as np logger = phoebe.logger() """ Explanation: Advanced: LC estimators Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as cola...
mne-tools/mne-tools.github.io
0.18/_downloads/d9e7f23ac267ddfa6023c7da2df2a984/plot_stats_cluster_time_frequency_repeated_measures_anova.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.sta...
mne-tools/mne-tools.github.io
0.17/_downloads/d876d0aad8948c7dc203ef1e5037106a/plot_decoding_xdawn_eeg.ipynb
bsd-3-clause
# Authors: Alexandre Barachant <alexandre.barachant@gmail.com> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import StratifiedKFold from sklearn.pipeline import make_pipeline from sklearn.linear_model import LogisticRegression from sklearn.metrics import c...
WNoxchi/Kaukasos
pytorch/practice-mnist.ipynb
mit
# %reload_ext autoreload # %autoreload 2 %matplotlib inline import torch import torchvision import numpy as np # import mnist_loader # train, valid, test = mnist_loader.load_data(path='data/mnist/') """ Explanation: PyTorch practice with MNIST data WNixalo - 2018/2/27 0. Imports End of explanation """ # torchvi...
jorisvandenbossche/geopandas
doc/source/gallery/create_geopandas_from_pandas.ipynb
bsd-3-clause
import pandas as pd import geopandas import matplotlib.pyplot as plt """ Explanation: Creating a GeoDataFrame from a DataFrame with coordinates This example shows how to create a GeoDataFrame when starting from a regular DataFrame that has coordinates either WKT (well-known text) format, or in two columns. End of expl...
bomboradata/bombora-tutorials
notebooks/topic-interest-score/topic-interest-result-data-schema.ipynb
mit
!ls -lh ../../data/topic-interest-score/ """ Explanation: Bombora Topic Interest Datasets Explaining Bombora topic interest score datasets. 0. Surge vs Interest? As a matter of clarification, topic surge as a product is generated from topic interest models. In technical discussions, we'll refer to both the product and...
dshean/iceflow
VisualizingDEMData.ipynb
mit
#do not run import sys #update path until georaster is installed with the make file sys.path.insert(0,'/Users/jessica/Classes/Geohackweek2016/iceflow/georaster') #do not run import geoutils import gdal import pandas from matplotlib import pyplot as plt import mpl_toolkits.basemap from ipyleaflet import (Map, Mark...
PhonologicalCorpusTools/PyAnnotationGraph
examples/tutorial/tutorial_3_query.ipynb
mit
from polyglotdb import CorpusContext """ Explanation: Tutorial 3: Getting information out First we begin with the standard import: End of explanation """ with CorpusContext('pg_tutorial') as c: q = c.query_graph(c.syllable) q = q.filter(c.syllable.stress == '1') q = q.filter(c.syllable.begin == c.syllab...
OpenWeavers/openanalysis
doc/OpenAnalysis/06 - Tree Growth Based Graph Algorithms.ipynb
gpl-3.0
import openanalysis.tree_growth as TreeGrowth """ Explanation: Tree Growth based Graph Algorithms These class of algorithms takes a Graph as input, and generates Tree, which consists of some of edges of input Graph, which are selected according to particular criteria. Some examples are DFS BFS Minimum Spanning Tree...
adammenges/ml-muse
numpy-cnn/numpy-cnn.ipynb
mit
import keras from keras.datasets import mnist from keras.models import Model from keras.layers import Dense, Dropout, Flatten, Input, Conv2D, MaxPooling2D from keras import backend as K (x_train, y_train), (x_test, y_test) = mnist.load_data() from PIL import Image Image.fromarray(x_train[0]).resize((256,256)) y_trai...
tensorflow/docs-l10n
site/zh-cn/tutorials/keras/text_classification_with_hub.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...
csaladenes/csaladenes.github.io
present/bi2/2020/ubb/az_en_jupyter2_mappam/sklearn_tutorial/04.1-Dimensionality-PCA.ipynb
mit
from __future__ import print_function, division %matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import stats plt.style.use('seaborn') """ Explanation: <small><i>This notebook was put together by Jake Vanderplas. Source and license info is on GitHub.</i></small> Dimensionality Reducti...
Jackporter415/phys202-2015-work
assignments/assignment05/MatplotlibEx03.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 3 Imports End of explanation """ def well2d(x, y, nx, ny, L=1.0): """Compute the 2d quantum well wave function.""" answer = np.array(2/L * np.sin(nx*np.pi*x/L)*np.sin(ny*np.pi*y/L)) return answer p...
aukintux/business_binomial_analysis
business_analysis.ipynb
mit
# Numpy import numpy as np # Scipy from scipy import stats from scipy import linspace # Plotly from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import plotly.graph_objs as go init_notebook_mode(connected=True) # Offline plotting """ Explanation: Business Feasibility Overview The purpose of...
wzxiong/DAVIS-Machine-Learning
labs/lab4.ipynb
mit
# %load ../standard_import.txt import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import sklearn.linear_model as skl_lm from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.discriminant_analysis import QuadraticDiscriminant...
heyengel/kaggle-titanic
code/kaggle-titanic.ipynb
mit
test.info() train.describe() # train.Cabin.str.split().str.get(-1).str[0] # train.Cabin.str.split(expand=True) # train.Ticket.str.split().str.get(0).str.extract train.Ticket.str.split()[0:].str[0].head() print train[train['Survived']==1]["Age"].mean(), print train[train['Survived']==0]["Age"].mean(), print test.Age...
sysid/nbs
cnn/tw_fromScratch.ipynb
mit
%matplotlib inline """ Explanation: Using Convolutional Neural Networks This is running on theano! Basic setup End of explanation """ #path = "data/dogscats/" path = "data/dogscats/sample/" """ Explanation: Define path to data: (It's a good idea to put it in a subdirectory of your notebooks folder, and then exclude...
mwickert/SP-Comm-Tutorial-using-scikit-dsp-comm
hardware_configure/RTL_SDR_Test.ipynb
bsd-2-clause
# Code for performing the capture import rtlsdr import numpy as np def capture(Tc,fo=88.7e6,fs=2.4e6,gain=40,device_index=0): # Setup SDR sdr = rtlsdr.RtlSdr(device_index) #create a RtlSdr object #sdr.get_tuner_type() sdr.sample_rate = fs sdr.center_freq = fo #sdr.gain = 'auto' sdr.gain = g...
km-Poonacha/python4phd
Session 2/ipython/.ipynb_checkpoints/Lesson 4 - Web API -checkpoint.ipynb
gpl-3.0
import requests url = 'http://www.github.com/ibm' response = requests.get(url) print(response.status_code) """ Explanation: Lesson 4 - Web API Requesting information from the web Python 'requests' module. This module provides functions to send a HTTP request and get the response from the server Requests is a third...
moble/PostNewtonian
Waveforms/SphericalHarmonicTensors.ipynb
mit
from __future__ import division, print_function import sympy from sympy import * from sympy import Rational as frac import simpletensors from simpletensors import Vector, xHat, yHat, zHat from simpletensors import TensorProduct, SymmetricTensorProduct, Tensor init_printing() var('vartheta, varphi') var('nu, m, delta,...
quasars100/Resonance_testing_scripts
python_tutorials/FourierSpectrum.ipynb
gpl-3.0
import rebound rebound.add("Sun") rebound.add("Jupiter") rebound.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 from scipy and other python libraries. Here we will do a simple F...
jinzishuai/learn2deeplearn
deeplearning.ai/C1.NN_DL/week2/Logistic+Regression+with+a+Neural+Network+mindset+v4.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage from lr_utils import load_dataset %matplotlib inline """ Explanation: Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a ...
JoaoRodrigues/pypdb
demos/demos.ipynb
mit
%pylab inline from IPython.display import HTML from pypdb.pypdb import * import pprint """ Explanation: pypdb demos This is a set of basic examples of the usage and outputs of the various individual functions included in. There are generally two types of functions: Functions that perform searches and return lists o...
gaufung/Data_Analytics_Learning_Note
python-statatics-tutorial/basic-theme/scipy_basic/details.ipynb
mit
import numpy as np from scipy import io as spio a = np.ones((3,3)) spio.savemat('file.mat',{'a':a}) data = spio.loadmat('file.mat',struct_as_record=True) data['a'] """ Explanation: 模块使用 1 scipy.io 读取矩阵数据 End of explanation """ from scipy import misc misc.imread('fname.png') import matplotlib.pyplot as plt plt.imrea...
astarostin/MachineLearningSpecializationCoursera
course4/week2 - Двухвыборочные непараметрические критерии (независимые выборки) - demo.ipynb
apache-2.0
import numpy as np import pandas as pd import itertools from scipy import stats from statsmodels.stats.descriptivestats import sign_test from statsmodels.stats.weightstats import zconfint from statsmodels.stats.weightstats import * %pylab inline """ Explanation: Непараметрические критерии Критерий | Одновыборочный |...
vanheck/blog-notes
QuantTrading/time-series-analyze_2-visualisation.ipynb
mit
MY_VERSION = 1,0 import sys import datetime import numpy as np import pandas as pd import pandas_datareader as pdr import pandas_datareader.data as pdr_web import quandl as ql from matplotlib import __version__ as matplotlib_version from seaborn import __version__ as seaborn_version # Load Quandl API key import json ...
esa-as/2016-ml-contest
EvgenyS/Facies_classification_ES.ipynb
apache-2.0
%matplotlib inline import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable from pandas import set_option set_option("display.max_rows", 20) pd.options.mode.chained_assignment = None filen...
madsenmj/ml-introduction-course
Class13/Class13.ipynb
apache-2.0
import numpy as np # fix random seed for reproducibility np.random.seed(23) # load data def load_data(path='Class13_mnist.pkl.gz'): import gzip from six.moves import cPickle import sys #path = get_file(path, origin='https://s3.amazonaws.com/img-datasets/mnist.pkl.gz') if path.endswith('.gz'): ...
bongsoos/pythontools
examples/Principal Component Analysis.ipynb
mit
import numpy as np import arraytools as arry import statstools as stats import plottools as pt %matplotlib inline """ Explanation: Demo of pythontools library and Principal Component Analysis Load libraries Import pythontools libraries. End of explanation """ tempA = arry.concate([2*np.random.randn(100,1)-3, 1*np.ra...
tuanavu/coursera-university-of-washington
machine_learning/1_machine_learning_foundations/assignment/week2/ipynb_checkpoints/Predicting house prices-checkpoint.ipynb
mit
import graphlab """ Explanation: Fire up graphlab create End of explanation """ sales = graphlab.SFrame('home_data.gl/') sales """ Explanation: Load some house sales data Dataset is from house sales in King County, the region where the city of Seattle, WA is located. End of explanation """ graphlab.canvas.set_ta...
ES-DOC/esdoc-jupyterhub
notebooks/thu/cmip6/models/sandbox-2/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'thu', 'sandbox-2', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: THU Source ID: SANDBOX-2 Topic: Ocean Sub-Topics: Timestepping Framework, Advection, ...
GoogleCloudPlatform/mlops-on-gcp
immersion/guided_projects/guided_project_3_nlp_starter/reusable_embeddings.ipynb
apache-2.0
import os from google.cloud import bigquery import pandas as pd %load_ext google.cloud.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. Lea...
vadim-ivlev/STUDY
handson-data-science-python/DataScience-Python3/KFoldCrossValidation.ipynb
mit
import numpy as np from sklearn.model_selection import cross_val_score, train_test_split from sklearn import datasets from sklearn import svm iris = datasets.load_iris() """ Explanation: K-Fold Cross Validation End of explanation """ # Split the iris data into train/test data sets with 40% reserved for testing X_t...
phievo/phievo
Examples/AnalyzeNetwork.ipynb
lgpl-3.0
%matplotlib notebook import matplotlib.pyplot as plt import numpy as np from ipywidgets import widgets from ipywidgets import interact, interactive, fixed from IPython.display import display,HTML,clear_output import os HTML('''<script>code_show=true;function code_toggle() {if (code_show){$('div.input').hide();} else ...
antoniomezzacapo/qiskit-tutorial
community/terra/qis_adv/two-qubit_state_quantum_random_access_coding.ipynb
apache-2.0
# useful math functions from math import pi, cos, acos, sqrt # importing the QISKit from qiskit import Aer, IBMQ from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute # import basic plot tools from qiskit.tools.visualization import plot_histogram # useful additional packages from qiskit.wra...
jinzishuai/learn2deeplearn
deeplearning.ai/C4.CNN/week4_SpecialApps/hw/Neural Style Transfer/Art Generation with Neural Style Transfer - v1.ipynb
gpl-3.0
import os import sys import scipy.io import scipy.misc import matplotlib.pyplot as plt from matplotlib.pyplot import imshow from PIL import Image from nst_utils import * import numpy as np import tensorflow as tf %matplotlib inline """ Explanation: Deep Learning & Art: Neural Style Transfer Welcome to the second assi...
wmorning/StatisticalMethods
examples/XrayImage/Inference.ipynb
gpl-2.0
# import cluster_pgm # cluster_pgm.inverse() from IPython.display import Image Image(filename="cluster_pgm_inverse.png") """ Explanation: Inferring Cluster Model Parameters from an X-ray Image Forward modeling is always instructive: we got a good sense of the parameters of our cluster + background model simply by g...
ethen8181/machine-learning
dim_reduct/PCA.ipynb
mit
from jupyterthemes import get_themes from jupyterthemes.stylefx import set_nb_theme themes = get_themes() set_nb_theme(themes[1]) # 1. magic for inline plot # 2. magic to print version # 3. magic so that the notebook will reload external python modules # 4. magic to enable retina (high resolution) plots # https://gist...
samsammurphy/ee-atmcorr-timeseries
ee-atmcorr-timeseries.ipynb
apache-2.0
# standard modules import os import sys import ee import colorsys from IPython.display import display, Image %matplotlib inline ee.Initialize() # custom modules # base_dir = os.path.dirname(os.getcwd()) # sys.path.append(os.path.join(base_dir,'atmcorr')) from atmcorr.timeSeries import timeSeries from atmcorr.postProce...
nicolas998/wmf
Examples/Simula_Salgar_Celdas.ipynb
gpl-3.0
%matplotlib inline from wmf import wmf from fwm import utils import numpy as np import pylab as pl """ Explanation: Simulador de la Cuenca de Salgar El siguiente codigo se encarga de simular la cuenca de salgar a partir de la informacion de radar obtenida por Julian, para el evento de Mayo 20. La siguiente celda in...
risantos/schoolwork
Física Computacional/Ficha 4.ipynb
mit
import numpy as np """ Explanation: Departamento de Física - Faculdade de Ciências e Tecnologia da Universidade de Coimbra Física Computacional - Ficha 4 - Sistemas de equações Lineares Rafael Isaque Santos - 2012144694 - Licenciatura em Física 1 - Resolução de um sistema de equações lineares $Ax = b$ pelo método de e...
antoniomezzacapo/qiskit-tutorial
community/aqua/optimization/maxcut.ipynb
apache-2.0
from qiskit_aqua import Operator, run_algorithm, get_algorithm_instance from qiskit_aqua.input import get_input_instance from qiskit_aqua.translators.ising import maxcut import numpy as np """ Explanation: Using Qiskit Aqua for maxcut problems This Qiskit Aqua Optimization notebook demonstrates how to use the VQE quan...
frankbearzou/Data-analysis
White House/White House.ipynb
mit
position_title = white_house["Position Title"] title_length = position_title.apply(len) salary = white_house["Salary"] from scipy.stats.stats import pearsonr pearsonr(title_length, salary) plt.scatter(title_length, salary) plt.xlabel("title length") plt.ylabel("salary") plt.title("Title length - Salary Scatter Plot"...
Aniruddha-Tapas/Applied-Machine-Learning
Miscellaneous/Plants Clustering.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from sklearn.cross_validation import train_test_split from sklearn import cross_validation, metrics from sklearn import preprocessing import matplotlib import matplotlib.pyplot as plt cols = ['Class'] for i in range(64): str = 'f{}'.format(i) cols.appen...
TiKeil/Master-thesis-LOD
notebooks/Figure_7.1_Refinement.ipynb
apache-2.0
import os import sys import numpy as np %matplotlib notebook import matplotlib.pyplot as plt from matplotlib import cm #coarse World NWorldCoarse = np.array([11,11]) NpCoarse = np.prod(NWorldCoarse+1) A = np.zeros(NWorldCoarse) ABase = A.flatten() aCube = ABase.reshape(NWorldCoarse) """ Explanation: Visualizati...
danielfrg/pelican-ipynb
pelican_jupyter/tests/pelican/markup-incell/content/md-info-in-cell.ipynb
apache-2.0
a = 1 a b = 'pew' b %matplotlib inline import matplotlib.pyplot as plt from pylab import * x = linspace(0, 5, 10) y = x ** 2 figure() plot(x, y, 'r') xlabel('x') ylabel('y') title('title') show() import numpy as np num_points = 130 y = np.random.random(num_points) plt.plot(y) """ Explanation: Title: Notebook...
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/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', 'fio-ronm', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation...
qinwf-nuan/keras-js
notebooks/layers/recurrent/SimpleRNN.ipynb
mit
data_in_shape = (3, 6) rnn = SimpleRNN(4, activation='tanh') layer_0 = Input(shape=data_in_shape) layer_1 = rnn(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) weights = [] for i, w in enumerate(model.get_weights()): np.random.seed(3400 + i) weigh...
wtbarnes/aia_response
notebooks/sunpy_aia_response_tutorial.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import sunpy.instr.aia %matplotlib inline """ Explanation: Tutorial: Calculating the SDO/AIA Response Functions in SunPy This notebook gives examples of how to calculate the SDO/AIA wavelength and temperature response functions using SunPy and ChiantiPy. The provided ...
nick-youngblut/SIPSim
ipynb/bac_genome/n1210/.ipynb_checkpoints/perc_incorp_unif_rep-checkpoint.ipynb
mit
workDir = '/home/nick/notebook/SIPSim/dev/bac_genome1210/' buildDir = os.path.join(workDir, 'percIncorpUnifRep') genomeDir = '/home/nick/notebook/SIPSim/dev/bac_genome1210/genomes/' R_dir = '/home/nick/notebook/SIPSim/lib/R/' """ Explanation: Goal Questions How is incorporator identification accuracy affected by the ...
ChadFulton/statsmodels
examples/notebooks/generic_mle.ipynb
bsd-3-clause
from __future__ import print_function import numpy as np from scipy import stats import statsmodels.api as sm from statsmodels.base.model import GenericLikelihoodModel """ Explanation: Maximum Likelihood Estimation (Generic models) This tutorial explains how to quickly implement new maximum likelihood models in statsm...
ODM2/ODM2PythonAPI
Examples/WaterQualityMeasurements_RetrieveVisualize.ipynb
bsd-3-clause
import os import datetime import matplotlib.pyplot as plt %matplotlib inline from shapely.geometry import Point import pandas as pd import geopandas as gpd import folium from folium.plugins import MarkerCluster import odm2api from odm2api.ODMconnection import dbconnection import odm2api.services.readService as odm2r...
NekuSakuraba/my_capstone_research
subjects/em/multivariate t - draft04 - Mixtures.ipynb
mit
actual_mu01 = [0,0] actual_cov01 = [[1,0], [0,1]] actual_df01 = 15 actual_mu02 = [1,1] actual_cov02 = [[.5, 0], [0, 1.5]] actual_df02 = 15 size = 300 x01 = multivariate_t_rvs(m=actual_mu01, S=actual_cov01, df=actual_df01, n=size) x02 = multivariate_t_rvs(m=actual_mu02, S=actual_cov02, df=actual_df02, n=size) X ...
Danghor/Formal-Languages
Ply/Compiler.ipynb
gpl-2.0
import ply.lex as lex tokens = [ 'NUMBER', 'ID', 'EQ', 'NE', 'LE', 'GE', 'AND', 'OR', 'INT', 'IF', 'ELSE', 'WHILE', 'RETURN' ] """ Explanation: A Simple Compiler for a Fragment of C This file shows how a simple compiler for a fragment of the programming language C can be implemented using Ply. Spe...
lcharleux/numerical_analysis
doc/Python.ipynb
gpl-2.0
print 'Hello World !' a = 5. b = 7. a + b """ Explanation: Python Python présente plusieurs avantage à l'origine de son choix pour ce cours: C'est un langage généraliste présent dans de nombreuses domaines: calcul scientifique, web, bases de données, jeu vidéo, graphisme, etc. C'est un outil polyvalent qu'un ingénieu...
rochefort-lab/fissa
examples/SIMA example.ipynb
gpl-3.0
# FISSA toolbox import fissa # SIMA toolbox import sima import sima.segment # File operations import glob # For plotting our results, use numpy and matplotlib import matplotlib.pyplot as plt import numpy as np """ Explanation: Using FISSA with SIMA SIMA is a toolbox for motion correction and cell detection. Here we...
Kaggle/learntools
notebooks/pandas/raw/ex_5.ipynb
apache-2.0
import pandas as pd reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0) from learntools.core import binder; binder.bind(globals()) from learntools.pandas.renaming_and_combining import * print("Setup complete.") """ Explanation: Introduction Run the following cell to load your data an...
jpn--/larch
book/example/000_mtc_data.ipynb
gpl-3.0
import os, gzip import numpy as np, pandas as pd, xarray as xr import larch.numba as lx """ Explanation: MTC Work Mode Choice Data End of explanation """ with gzip.open(lx.example_file("MTCwork.csv.gz"), 'rt') as previewfile: print(*(next(previewfile) for x in range(10))) """ Explanation: The MTC sample dataset...
mdiaz236/DeepLearningFoundations
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that takes in a sequence of letters, an...
hcchengithub/project-k
Play with the FORTH kernel on jupyter notebook.ipynb
mit
import projectk as vm # vm means 'Virtual Machine'. """ Explanation: A rewritten of: https://github.com/hcchengithub/project-k/wiki/Play-with-the-forth-kernel-on-python<br> You can play with this article online directly through the jupyter notebook binder: https://mybinder.org/v2/gh/hcchengithub/project-k/master Pla...
samuxiii/notebooks
stock/Ethereum_Stock.ipynb
apache-2.0
import os import io import math import random import requests from tqdm import tqdm import numpy as np import pandas as pd import sklearn import matplotlib.dates as mdates import datetime as dt from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn.metrics imp...
florianwittkamp/FD_ACOUSTIC
JupyterNotebook/1D/FD_1D_DX4_DT4_ABS_fast.ipynb
gpl-3.0
%matplotlib inline import numpy as np import time as tm import matplotlib.pyplot as plt """ Explanation: FD_1D_DX4_DT4_ABS_fast 1-D acoustic Finite-Difference modelling GNU General Public License v3.0 Author: Florian Wittkamp Finite-Difference acoustic seismic wave simulation Discretization of the first-order acoustic...
cgpotts/cs224u
tutorial_jupyter_notebooks.ipynb
apache-2.0
__author__ = "Lucy Li" __version__ = "CS224u, Stanford, Spring 2022" """ Explanation: Tutorial: Jupyter notebooks End of explanation """ import time import pandas as pd import matplotlib.pyplot as plt import numpy as np print("cats") # run this cell and notice how both strings appear as outputs "cheese" # cut/copy...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/image_classification/solutions/2_mnist_models.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # Here we'll show the currently installed version of TensorFlow import tensorflow as tf print(tf.__version__) from datetime import datetime import os PROJECT = "your-project-id-here" # REPLACE WITH YOUR PROJECT ID BUCKET = "your-bucket-id-here" # R...
scottprahl/miepython
docs/11_performance.ipynb
mit
#!pip install --user miepython import numpy as np import matplotlib.pyplot as plt try: import miepython.miepython as miepython_jit import miepython.miepython_nojit as miepython except ModuleNotFoundError: print('miepython not installed. To install, uncomment and run the cell above.') print('Once inst...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_compute_mne_inverse_raw_in_label.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.minimum_norm import apply_inverse_raw, read_inverse_operator print(__doc__) data_path = sample.data_path() fname_inv = data_path + '/...
CloverHealth/pycon2017
bayesian_analysis/data/generate_data.ipynb
bsd-3-clause
def create_patients(): """Creating a table of patient and ids""" ids = list(range(1, 11)) doctor_ids = ['dr' + str((i % 2) + 1) for i in ids] names = ['john', 'jeremy', 'mark', 'leslie', 'sam', 'matt', 'judy', 'parth', 'kevin', 'joshua'] patients = { 'patient_id': ids, 'doctor_id': ...
unpingco/Python-for-Probability-Statistics-and-Machine-Learning
chapters/statistics/notebooks/Confidence_Intervals.ipynb
mit
from __future__ import division %pylab inline """ Explanation: Python for Probability, Statistics, and Machine Learning End of explanation """ from scipy import stats import numpy as np b= stats.bernoulli(.5) # fair coin distribution nsamples = 100 # flip it nsamples times for 200 estimates xs = b.rvs(nsamples*200)...
mne-tools/mne-tools.github.io
0.18/_downloads/e759d6d5e3879a95fca2c0cf44006e74/plot_stats_cluster_spatio_temporal_2samp.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import os.path as op import numpy as np from scipy import stats as stats import mne from mne import spatial_src_connectivity from mne.stats import spatio_temporal_cluster...
batfish/pybatfish
jupyter_notebooks/Analyzing public and hybrid cloud networks.ipynb
apache-2.0
# Import packages %run startup.py bf = Session(host="localhost") def show_first_trace(trace_answer_frame): """ Prints the first trace in the answer frame. In the presence of multipath routing, Batfish outputs all traces from the source to destination. This function picks the first one. """ ...
HazyResearch/snorkel
tutorials/intro/Intro_Tutorial_3.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 %matplotlib inline import os # TO USE A DATABASE OTHER THAN SQLITE, USE THIS LINE # Note that this is necessary for parallel execution amongst other things... # os.environ['SNORKELDB'] = 'postgres:///snorkel-intro' from snorkel import SnorkelSession session = SnorkelSession() """ E...
jldinh/multicell
examples/01 - Creating a simple tissue.ipynb
mit
%matplotlib notebook """ Explanation: In this example, we will show how to create a very simple tissue structure comprised of cubic cells and visualize it using Multicell. Preparation Visualizations rely on the matplotlib module. In order for visualizations to work interactively in this Jupyter notebook, we need to ru...
krondor/nlp-dsx-pot
Operationalizing Models with WML and Scikit-Learn.ipynb
gpl-3.0
!pip install wget --user """ Explanation: <table style="border: none" align="left"> <tr style="border: none"> <th style="text-align: left;border: none"><font face="verdana" size="5" color="black"><b>Train and deploy a heart disease prediction model using XGBoost and IBM Watson Machine Learning APIs</b></th> ...
agmarrugo/sensors-actuators
notebooks/Ex2-10-errors-in-sensing.ipynb
mit
span = 80-(-30) #input span or input full scale (IFS) e_input = 0.5 # error as input e = (e_input/span) *100 ## Error as % IFS print('The error as percentange of the input span is e = %2.3f %%' % (e)) """ Explanation: Errors in Sensing Andrés Marrugo, PhD A thermistor is used to measure temperatures between $-30^{\c...
postBG/DL_project
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
y2ee201/Deep-Learning-Nanodegree
intro-to-rnns/Anna KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
hannorein/rebound
ipython_examples/Forces.ipynb
gpl-3.0
import rebound sim = rebound.Simulation() sim.integrator = "whfast" sim.add(m=1.) sim.add(m=1e-6,a=1.) sim.move_to_com() # Moves to the center of momentum frame """ Explanation: Additional forces REBOUND is a gravitational N-body integrator. But you can also use it to integrate systems with additional, non-gravitatio...
afeiguin/comp-phys
14_02_multilayer-networks.ipynb
mit
%matplotlib inline from matplotlib import pyplot pyplot.rcParams['image.cmap'] = 'jet' import numpy as np x0 = -1.4 y0 = 0.5 x = [x0] # The algorithm starts at x0, y0 y = [y0] eta = 0.1 # step size multiplier precision = 0.00001 def f(x,y): f1 = x**2/2-y**2/4+3 f2 = 2*x+1-np.exp(y) return np.sin(f1)*np....
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/5b_deploy_keras_ai_platform_babyweight.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst import os """ Explanation: LAB 5b: Deploy and predict with Keras model on Cloud AI Platform. Learning Objectives Setup up the environment Deploy trained Keras model to Cloud AI Platform Online predict from model on Cloud AI Platform Batch predict fr...
LogicWang/ml
train/titanic.ipynb
apache-2.0
# data analysis and wrangling import pandas as pd import numpy as np import random as rnd # visualization import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline # machine learning from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC, LinearSVC from sklearn.ensemble import ...
bbengfort/cloudscope
notebooks/traces.ipynb
mit
%matplotlib inline import os import re import csv import glob import json import numpy as np import pandas as pd import seaborn as sns ## Load Data PROPRE = re.compile(r'^trace-(\d+)ms-(\d+)user.tsv$') TRACES = os.path.join("..", "fixtures", "traces", "trace-*") def load_trace_data(traces=TRACES, pattern=PROPRE): ...
aboSamoor/compsocial
Word_Tracker/3rd_Yr_Paper/Google_NYT.ipynb
gpl-3.0
plot_both(['bicultural', 'biracial', 'biethnic', 'interracial']) plt.xlim(1910, 2015) """ Explanation: monoracial has no data from NYT. 1865, 1905, 1915 (monocultural) NYT End of explanation """ plot_both(['multicultural', 'multiracial', 'multiethnic', 'polycultural', 'polyracial', 'polyethnic']) plt.xlim(1950, 201...
mne-tools/mne-tools.github.io
0.20/_downloads/ecc61038e0082bd1c13f6a49dd4cd752/plot_70_fnirs_processing.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt from itertools import compress import mne fnirs_data_folder = mne.datasets.fnirs_motor.data_path() fnirs_raw_dir = os.path.join(fnirs_data_folder, 'Participant-1') raw_intensity = mne.io.read_raw_nirx(fnirs_raw_dir, verbose=True).load_data() """ Explanati...
GoogleCloudPlatform/asl-ml-immersion
notebooks/time_series_prediction/labs/1_optional_data_exploration.ipynb
apache-2.0
import os PROJECT = !(gcloud config get-value core/project) PROJECT = PROJECT[0] BUCKET = PROJECT os.environ["PROJECT"] = PROJECT os.environ["BUCKET"] = BUCKET import numpy as np import pandas as pd import seaborn as sns from google.cloud import bigquery from IPython import get_ipython from IPython.core.magic import...
mommermi/Introduction-to-Python-for-Scientists
notebooks/.ipynb_checkpoints/Functions_Modules_StandardLibrary-checkpoint.ipynb
mit
def area_circle(radius, pi=3.14): """determine area of a circle, given its radius""" # documentation! return pi*radius*radius print area_circle(3) # uses the default value of 'pi' print area_circle(3, pi=3) # uses your own value of 'pi' print area_circle.__doc__ """ Explanation: Functions, Modules, and th...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_python_intro.ipynb
bsd-3-clause
a = 3 print(type(a)) b = [1, 2.5, 'This is a string'] print(type(b)) c = 'Hello world!' print(type(c)) """ Explanation: .. _tut_intro_pyton: Introduction to Python Python is a modern, general-purpose, object-oriented, high-level programming language. First make sure you have a working python environment and dependenci...
NeuPhysics/aNN
ipynb/test.ipynb
mit
# This line configures matplotlib to show figures embedded in the notebook, # instead of opening a new window for each figure. More about that later. # If you are using an old version of IPython, try using '%pylab inline' instead. %matplotlib inline %load_ext snakeviz import numpy as np from scipy.optimize import mi...
google-research/recsim
recsim/colab/RecSim_Developing_an_Agent.ipynb
apache-2.0
# @title Install !pip install --upgrade --no-cache-dir recsim # @title Imports # Generic imports import functools from gym import spaces import numpy as np import matplotlib.pyplot as plt from scipy import stats # RecSim imports from recsim import agent from recsim import document from recsim import user from recsim.c...
miltonsarria/dsp-python
images/2_fullyconnected.ipynb
mit
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import numpy as np import tensorflow as tf from six.moves import cPickle as pickle from six.moves import range """ Explanation: Deep Learning Assignment 2 Previously in 1_n...
pymanopt/pymanopt
examples/notebooks/mixture_of_gaussians.ipynb
bsd-3-clause
import autograd.numpy as np np.set_printoptions(precision=2) import matplotlib.pyplot as plt %matplotlib inline # Number of data points N = 1000 # Dimension of each data point D = 2 # Number of clusters K = 3 pi = [0.1, 0.6, 0.3] mu = [np.array([-4, 1]), np.array([0, 0]), np.array([2, -1])] Sigma = [ np.arr...
chetan51/nupic.research
projects/dynamic_sparse/notebooks/ToyProblem-NewOrganization.ipynb
gpl-3.0
%load_ext autoreload %autoreload 2 import sys sys.path.append(os.path.expanduser("~/nta/nupic.research/projects/")) # general imports import os import numpy as np # torch imports import torch import torch.optim as optim import torch.optim.lr_scheduler as schedulers import torch.nn as nn from torch.utils.data import ...