repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
drcgw/bass
Single Wave- Interactive.ipynb
gpl-3.0
from bass import * """ Explanation: Welcome to BASS! Version: Single Wave- Interactive Notebook. BASS: Biomedical Analysis Software Suite for event detection and signal processing. Copyright (C) 2015 Abigail Dobyns This program is free software: you can redistribute it and/or modify it under the terms of the GNU Gen...
jsnajder/StrojnoUcenje
notebooks/SU-2015-7-LogistickaRegresija.ipynb
cc0-1.0
import scipy as sp import scipy.stats as stats import matplotlib.pyplot as plt import pandas as pd %pylab inline """ Explanation: Sveučilište u Zagrebu<br> Fakultet elektrotehnike i računarstva Strojno učenje <a href="http://www.fer.unizg.hr/predmet/su">http://www.fer.unizg.hr/predmet/su</a> Ak. god. 2015./2016. Bilje...
g-weatherill/notebooks
gmpe-smtk/ConditionalFields-Training.ipynb
agpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm, Normalize import smtk.hazard.conditional_simulation as csim import smtk.sm_database_builder as sdb from smtk.residuals.gmpe_residuals import Residuals from smtk.residuals.residual_plotter import ResidualPlot, Re...
citxx/sis-python
crash-course/if-and-logical-expressions.ipynb
mit
print("Чему равно 2 * 2?") a = int(input()) if a == 4: print("Правда") else: print("Ложь") """ Explanation: <h1>Содержание<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Условный-оператор-if" data-toc-modified-id="Условный-оператор-if-1">Условный оператор if</a></sp...
piyushbhattacharya/machine-learning
python/Consumer Complains.ipynb
gpl-3.0
ld_train, ld_test = train_test_split(cd_train, test_size=0.2, random_state=2) x80_train = ld_train.drop(['Consumer disputed?','Complaint ID'],1) y80_train = ld_train['Consumer disputed?'] x20_test = ld_test.drop(['Consumer disputed?','Complaint ID'],1) y20_test = ld_test['Consumer disputed?'] """ Explanation: Optimi...
mne-tools/mne-tools.github.io
0.22/_downloads/dfd4175ec1a2c7f21de3596573c74301/plot_multidict_reweighted_tfmxne.ipynb
bsd-3-clause
# Author: Mathurin Massias <mathurin.massias@gmail.com> # Yousra Bekhti <yousra.bekhti@gmail.com> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import os.path as op import mne from mne.datasets import somato...
ericmjl/influenza-reassortment-analysis
13 Where are human-adapted mutations found?.ipynb
mit
# Open the sequences sequences = SeqIO.to_dict(SeqIO.parse('20150312_PB2_CDS_from_Whole_Genomes.fasta', 'fasta')) # sequences data = pd.read_csv('20150312_PB2_CDS_from_Whole_Genomes.csv', parse_dates=['Collection Date']) data['Strain Name'] = data['Strain Name'].str.split('(').str[0] data['Sequence Accession'] = data[...
Chipe1/aima-python
games4e.ipynb
mit
from collections import namedtuple, Counter, defaultdict import random import math import functools cache = functools.lru_cache(10**6) class Game: """A game is similar to a problem, but it has a terminal test instead of a goal test, and a utility for each terminal state. To create a game, subclass this ...
google/trax
trax/layers/intro.ipynb
apache-2.0
# Copyright 2018 Google LLC. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, softwa...
berlemontkevin/Jupyter_Notebook
PyDSTool/PyDSTool_Introduction.ipynb
apache-2.0
from PyDSTool import * """ Explanation: PyDSTool : An introduction This Notebook is inspired by : http://www2.gsu.edu/~matrhc/FrontPage.html The description of PyDSTool is :"With PyDSTool we aim to provide a powerful suite of computational tools for the development, simulation, and analysis of dynamical systems that a...
tpin3694/tpin3694.github.io
machine-learning/imputing_missing_class_labels.ipynb
mit
# Load libraries import numpy as np from sklearn.preprocessing import Imputer """ Explanation: Title: Imputing Missing Class Labels Slug: imputing_missing_class_labels Summary: How to impute missing class labels for machine learning in Python. Date: 2016-09-06 12:00 Category: Machine Learning Tags: Preprocessing Stru...
M-R-Houghton/euroscipy_2015
scikit_image/lectures/solutions/adv3_panorama-stitching-solution.ipynb
mit
import numpy as np import matplotlib.pyplot as plt def compare(*images, **kwargs): """ Utility function to display images side by side. Parameters ---------- image0, image1, image2, ... : ndarrray Images to display. labels : list Labels for the different images. """ ...
teuben/astr288p
notebooks/wrapup.ipynb
mit
%matplotlib inline import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt from astropy.io import fits from scipy.optimize import curve_fit """ Explanation: Some final thoughts In the lectures you should have learned: Unix (Linux or Mac) terminals and how to work with directories and files basic com...
josiahdavis/python_data_analysis
.ipynb_checkpoints/python_data_analysis-checkpoint.ipynb
mit
# Import the pandas and numpy libraries import pandas as pd import numpy as np # Read a file with an absolute path ufo = pd.read_csv('/Users/josiahdavis/Documents/GitHub/python_data_analysis/ufo_sightings.csv') # Alterntively, read the the file using a relative path ufo = pd.read_csv('ufo_sightings.csv') # Alterntiv...
gojomo/gensim
docs/src/auto_examples/core/run_corpora_and_vector_spaces.ipynb
lgpl-2.1
import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) """ Explanation: Corpora and Vector Spaces Demonstrates transforming text into a vector space representation. Also introduces corpus streaming and persistence to disk in various formats. End of explanation """ ...
SJSlavin/phys202-2015-work
assignments/assignment08/InterpolationEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np sns.set_style('white') from scipy.interpolate import griddata """ Explanation: Interpolation Exercise 2 End of explanation """ # YOUR CODE HERE x = np.hstack((np.arange(-5, 6), np.full(10, 5), np.arange(-5, 5), np.full(9, -5...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_read_and_write_raw_data.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname = data_path + '/MEG/sample/sample_audvis_raw.fif' raw = mne.io.read_raw_fif(fname) # Set up pick list: MEG + STI 014 - b...
ES-DOC/esdoc-jupyterhub
notebooks/cams/cmip6/models/sandbox-3/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cams', 'sandbox-3', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: CAMS Source ID: SANDBOX-3 Sub-Topics: Radiative Forcings. Properties: 85 (42 ...
deep-learning-indaba/practicals2017
practical4.ipynb
mit
class FeedForwardModel(): # ... def act_fn(self, x): return np.tanh(x) def forward(self, x): '''One example of a FFN.''' # Compute activations on the hidden layer. hidden_layer = self.act_fn(np.dot(self.W_xh, x)) # Compute the (linear) outp...
ModestoCabrera/IS360Project_1
project_1.ipynb
gpl-2.0
import pandas as pd from pandas import DataFrame import matplotlib.pyplot as plt data = pd.read_csv('project_1.csv') """ Explanation: IS360 Project 1 - Data Analysis of Formed Flights Database <img src="stats_keyboard.jpg" align=right> <i>Before I get started I need to import the tools and data into my Environmen...
geography-munich/sciprog
material/sub/jrjohansson/Lecture-5-Sympy.ipynb
apache-2.0
%matplotlib inline import matplotlib.pyplot as plt """ Explanation: Sympy - Symbolic algebra in Python J.R. Johansson (jrjohansson at gmail.com) The latest version of this IPython notebook lecture is available at http://github.com/jrjohansson/scientific-python-lectures. The other notebooks in this lecture series are i...
eds-uga/csci1360e-su17
assignments/A6/A6_BONUS.ipynb
mit
c = count_datasets("submission_partial.json") assert c == 4 c = count_datasets("submission_full.json") assert c == 9 try: c = count_datasets("submission_nonexistent.json") except: assert False else: assert c == -1 """ Explanation: BONUS This bonus will do a very deep dive into dictionaries and lists, and...
km-Poonacha/python4phd
Session 2/ipython/Lesson 5- Crawl and scrape.ipynb
gpl-3.0
import requests url = 'http://www.tripadvisor.com/' response = requests.get(url) print(response.status_code) #print(response.headers) """ Explanation: Lesson 5 - Crawl and Scrape Making the request Using 'requests' module Use the requests module to make a HTTP request to http://www.tripadvisor.com - Check the status...
xaibeing/cn-deep-learning
tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
chrlttv/Teaching
Session5/1_MachineLearning_Regression_keys.ipynb
mit
# Write code to import required libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt # For visualzing plots in this notebook %matplotlib inline """ Explanation: Machine Learning: Regression Supervised Machine Learning algorithms consist of target / outcome variable (or dependent variabl...
calico/basenji
tutorials/archive/genes.ipynb
apache-2.0
import os, subprocess if not os.path.isfile('data/hg19.ml.fa'): subprocess.call('curl -o data/hg19.ml.fa https://storage.googleapis.com/basenji_tutorial_data/hg19.ml.fa', shell=True) subprocess.call('curl -o data/hg19.ml.fa.fai https://storage.googleapis.com/basenji_tutorial_data/hg19.ml.fa.fai', shell=True) ...
AllenDowney/ThinkBayes2
examples/beta.ipynb
mit
trials = 174 successes = 173 failures = trials-successes failures """ Explanation: Jeffreys interval Copyright 2020 Allen Downey MIT License Suppose you have run 174 trials and 173 were successful. You want to report an estimate of the probability of success and a confidence interval for the estimate. According to ou...
chinapnr/python_study
Python 基础课程/Python Basic Lesson 16 - 函数式编程.ipynb
gpl-3.0
# 将函数作为值返回 def lazy_sum(*args): def sum(): ax = 0 for n in args: ax = ax + n return ax return sum f = lazy_sum(1, 3, 5, 7, 9) print(f()) """ Explanation: Lesson 16 v1.1, 2020.5, 2020.6 edit by David Yi 本次内容 闭包:将函数作为值返回 偏函数 高阶函数 map/reduce/filte End of explanat...
ethen8181/machine-learning
python/pivot_table/pivot_table.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) import numpy as np import pandas as pd # 1. magic...
moonbury/pythonanywhere
github/MasteringMatplotlib/mmpl-interaction.ipynb
gpl-3.0
import matplotlib matplotlib.use('nbagg') """ Explanation: Event Handling and Interactive Plots In the following sections of this IPython Notebook we be looking at the following: matplotlib's event loop support Basic Event Handling List of supported events Mouse events Limitations of the IPython Notebook backend Keyb...
mattmcd/PyBayes
scripts/qfe_20220221.ipynb
apache-2.0
import sympy as sp from sympy.interactive import printing printing.init_printing(use_latex=True) from sympy.stats import Bernoulli, LogNormal, density, sample, P as Prob, E as Expected, variance """ Explanation: Utility Functions Date: 2022-02-21 Author: Matt McDonnell @mattmcd Looking at 'Quantitative Financial Econ...
ENCODE-DCC/pyencoded-tools
jupyter_notebooks/keenan/pyencoded_tools_skills_lab_2017.ipynb
mit
!encode explore """ Explanation: pyencoded-tools https://github.com/ENCODE-DCC/pyencoded-tools Skills Lab 2017 Purpose Tools for programmatically interacting with metadata on the portal Metadata includes Origin of raw data (donor, experimental conditions) Processing steps (align reads to assembly) Relation betwe...
EducationalTestingService/rsmtool
rsmtool/notebooks/evaluation.ipynb
apache-2.0
markdown_str = ("The tables in this section show the standard association metrics between " "*observed* human scores and different types of machine scores. " "These results are computed on the evaluation set. `raw_trim` scores " "are truncated to [{}, {}]. `raw_trim_round...
NekuSakuraba/my_capstone_research
subjects/em/multivariate t - draft03 - EM Unknown degrees of freedom.ipynb
mit
def log_of_psi(): n = len(X) u_ = [(_-mu).T.dot(inv(cov).dot(_-mu)) for _ in X] return -.5*n*p*log(2 * np.pi) -.5*n*log(np.linalg.det(cov)) - .5 * sum(u_) def az(): n = len(X) u_ = [(_-mu).T.dot(inv(cov).dot(_-mu)) for _ in X] return -n*log(gamma(df/2.)) + .5*n*df*log(df/2.) + .5*df*(log(u_) ...
abigailStev/power_spectra
scripts/TimmerKoenig.ipynb
mit
import numpy as np from scipy import fftpack import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator import matplotlib.font_manager as font_manager import itertools ## Shows the plots inline, instead of in a separate window: %matplotlib inline ## Sets the font size for plotting font_prop = font_...
rbondesan/ssd
reinforcement_q_learning.ipynb
mit
import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import namedtuple from itertools import count from copy import deepcopy from PIL import Image import torch import torch.nn as nn import torch.optim as optim import torch.autograd as autograd impor...
vadim-ivlev/STUDY
handson-data-science-python/DataScience-Python3/LinearRegression.ipynb
mit
%matplotlib inline import numpy as np from pylab import * pageSpeeds = np.random.normal(3.0, 1.0, 1000) purchaseAmount = 100 - (pageSpeeds + np.random.normal(0, 0.1, 1000)) * 3 scatter(pageSpeeds, purchaseAmount) """ Explanation: Linear Regression Let's fabricate some data that shows a roughly linear relationship be...
mined-gatech/pymks_overview
notebooks/stress_homogenization_2D.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt """ Explanation: Effective Stiffness Introduction This example uses the MKSHomogenizationModel to create a homogenization linkage for the effective stiffness. This example starts with a brief background of the hom...
grokkaine/biopycourse
day3/DL2_CNN.ipynb
cc0-1.0
from tensorflow.keras.datasets import mnist from tensorflow.keras.utils import to_categorical (train_images, train_labels), (test_images, test_labels) = mnist.load_data() train_images = train_images.reshape((60000, 28, 28, 1)) train_images = train_images.astype('float32') / 255 test_images = test_images.reshape((10000...
eigendreams/TensorFlow-Tutorials
08_Transfer_Learning.ipynb
mit
from IPython.display import Image, display Image('images/08_transfer_learning_flowchart.png') """ Explanation: TensorFlow Tutorial #08 Transfer Learning by Magnus Erik Hvass Pedersen / GitHub / Videos on YouTube Introduction We saw in the previous Tutorial #07 how to use the pre-trained Inception model for classifying...
mne-tools/mne-tools.github.io
0.17/_downloads/c92e443909d938b06abf63b902dac687/plot_epochs_to_data_frame.ipynb
bsd-3-clause
# Author: Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import mne import matplotlib.pyplot as plt import numpy as np from mne.datasets import sample print(__doc__) data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif' event_fname = data_path + '...
xgcm/xgcm
doc/grid_metrics.ipynb
mit
import xarray as xr import numpy as np from xgcm import Grid import matplotlib.pyplot as plt %matplotlib inline # hack to make file name work with nbsphinx and binder import os fname = '../datasets/mitgcm_example_dataset_v2.nc' if not os.path.exists(fname): fname = '../' + fname ds = xr.open_dataset(fname) ds...
nicolas998/wmf
Examples/Ejemplo_Cuencas_Basico_1.ipynb
gpl-3.0
#Paquete Watershed Modelling Framework (WMF) para el trabajo con cuencas. from wmf import wmf """ Explanation: Ejemplo cuencas En el siguiente ejemplo se presentan las funcionalidades básicas de la herramienta wmf.Stream y wmf.Basin dentro de los temas tocados se presenta: Trazado de corrientes. Perfil de corrientes....
ConnectedSystems/veneer-py
doc/training/6_Model_Setup_and_Configuration.ipynb
isc
existing_models = v.model.link.routing.get_models() existing_models """ Explanation: Session 6 - Model Setup and Reconfiguration This session covers functionality in Veneer and veneer-py for making larger changes to model setup, including structural changes. Using this functionality, it is possible to: Create (and re...
harmsm/pythonic-science
chapters/00_inductive-python/key/03_conditionals_key.ipynb
unlicense
x = 5 print(x > 2) x = 5 print(x < 2) """ Explanation: Conditional Execution Conditional execution allows a program to only execute code if some condition is met. Predict what this code will do. End of explanation """ x = 20 print (x > 2) # one way x = 1 print (x > 2) # another way x = 20 print (x < 2) """ Expl...
jorisvandenbossche/DS-python-data-analysis
_solved/visualization_02_seaborn.ipynb
bsd-3-clause
import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: <p><font size="6"><b>Visualisation: Seaborn </b></font></p> © 2021, Joris Van den Bossche and Stijn Van Hoey (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#100;&#101;&#110;&#98;&#111;&#115;&#115;&#99;&#104;&#101;&#64;&#103;&#...
nimish-jose/dlnd
image-classification/dlnd_image_classification.ipynb
gpl-3.0
""" 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' class DLProgress(tqdm): last_block = 0 def hoo...
shareactorIO/pipeline
gpu.ml/notebooks/04_Train_Model_GPU.ipynb
apache-2.0
import tensorflow as tf from tensorflow.python.client import timeline import pylab import numpy as np %matplotlib inline %config InlineBackend.figure_format = 'retina' tf.logging.set_verbosity(tf.logging.INFO) tf.reset_default_graph() num_samples = 100000 from datetime import datetime version = int(datetime.now(...
bakerjd99/jacks
numpyjlove/NumPy and J make Sweet Array Love.ipynb
unlicense
import numpy as np """ Explanation: NumPy and J make Sweet Array Love Import NumPy using the standard naming convention End of explanation """ import sys # local api/python3 path - adjust path for your system japipath = 'C:\\j64\\j64-807\\addons\\api\\python3' if japipath not in sys.path: sys.path.append(japi...
wuafeing/Python3-Tutorial
01 data structures and algorithms/01.16 filter sequence elements.ipynb
gpl-3.0
mylist = [1, 4, -5, 10, -7, 2, 3, -1] [n for n in mylist if n > 0] [n for n in mylist if n < 0] """ Explanation: Previous 1.16 过滤序列元素 问题 你有一个数据序列,想利用一些规则从中提取出需要的值或者是缩短序列 解决方案 最简单的过滤序列元素的方法就是使用列表推导。比如: End of explanation """ pos = (n for n in mylist if n > 0) pos for x in pos: print(x) """ Explanation: 使用列表推导...
napsternxg/ipython-notebooks
Likelihood+ratio.ipynb
apache-2.0
def get_likelihood(theta, n, k, normed=False): ll = (theta**k)*((1-theta)**(n-k)) if normed: num_combs = comb(n, k) ll = num_combs*ll return ll get_likelihood(0.5, 2, 2, normed=True) get_likelihood(0.5, 10, np.arange(10), normed=True) N = 100 plt.plot( np.arange(N), get_likelihood...
fvnts/finitedifference
notebooks/fheat.ipynb
gpl-3.0
# ----------------------------------------/ %matplotlib inline # ----------------------------------------/ import numpy as np import matplotlib.pyplot as plt from scipy import * from ipywidgets import * from scipy import linalg from numpy import asmatrix from numpy import matlib as ml from scipy.sparse import spdiags ...
elmaso/tno-ai
aind2-cnn/cifar10-classification/cifar10_mlp.ipynb
gpl-3.0
import keras from keras.datasets import cifar10 # load the pre-shuffled train and test data (x_train, y_train), (x_test, y_test) = cifar10.load_data() """ Explanation: Artificial Intelligence Nanodegree Convolutional Neural Networks In this notebook, we train an MLP to classify images from the CIFAR-10 database. 1. ...
gojomo/gensim
docs/notebooks/Any2Vec_Filebased.ipynb
lgpl-2.1
import gensim import gensim.downloader as api from gensim.utils import save_as_line_sentence from gensim.models.word2vec import Word2Vec print(gensim.models.word2vec.CORPUSFILE_VERSION) # must be >= 0, i.e. optimized compiled version corpus = api.load("text8") save_as_line_sentence(corpus, "my_corpus.txt") model = ...
steinam/teacher
jup_notebooks/datenbanken/Sommer_2015.ipynb
mit
%load_ext sql %sql mysql://steinam:steinam@localhost/sommer_2015 """ Explanation: Subselects End of explanation """ %%sql %sql select count(*) as AnzahlFahrten from fahrten """ Explanation: Sommer 2015 Datenmodell Aufgabe Erstellen Sie eine Abfrage, mit der Sie die Daten aller Kunden, die Anzahl deren Aufträg...
mohanprasath/Course-Work
numpy/numpy_exercises_from_kyubyong/Logic_functions.ipynb
gpl-3.0
import numpy as np np.__version__ """ Explanation: Logic functions End of explanation """ x = np.array([1,2,3]) # x = np.array([1,0,3]) # """ Explanation: Truth value testing Q1. Let x be an arbitrary array. Return True if none of the elements of x is zero. Remind that 0 evaluates to False in python. End of expla...
Bio204-class/bio204-notebooks
Introduction-to-Simulation.ipynb
cc0-1.0
# set the seed for the pseudo-random number generator # the seed is any 32 bit integer # different seeds will generate different results for the # simulations that follow np.random.seed(20160208) """ Explanation: A brief note about pseudo-random numbers When carrying out simulations, it is typical to use random numb...
mne-tools/mne-tools.github.io
0.24/_downloads/31239620dd9631320a99b07ac4a81074/interpolate_bad_channels.ipynb
bsd-3-clause
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # Mainak Jas <mainak.jas@telecom-paristech.fr> # # License: BSD-3-Clause import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname = data_path + '/MEG/sample/sample_audvis-ave.fif' evoked = mne.read_evokeds(fname, ...
nick-youngblut/SIPSim
ipynb/bac_genome/fullCyc/.ipynb_checkpoints/Day1_default_run-checkpoint.ipynb
mit
import os import glob import re import nestly %load_ext rpy2.ipython %%R library(ggplot2) library(dplyr) library(tidyr) library(gridExtra) library(phyloseq) ## BD for G+C of 0 or 100 BD.GCp0 = 0 * 0.098 + 1.66 BD.GCp100 = 1 * 0.098 + 1.66 """ Explanation: Goal Simulating fullCyc Day1 control gradients Not simulati...
joshnsolomon/phys202-2015-work
assignments/assignment03/NumpyEx04.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns """ Explanation: Numpy Exercise 4 Imports End of explanation """ import networkx as nx K_5=nx.complete_graph(5) nx.draw(K_5) """ Explanation: Complete graph Laplacian In discrete mathematics a Graph is a set of vertices or n...
southpaw94/MachineLearning
TextExamples/3547_08_Code.ipynb
gpl-2.0
%load_ext watermark %watermark -a 'Sebastian Raschka' -u -d -v -p numpy,pandas,matplotlib,scikit-learn,nltk # to install watermark just uncomment the following line: #%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py """ Explanation: Sebastian Raschka, 2015 Python Machine Learning Ess...
danresende/deep-learning
sentiment_network/Sentiment Classification - Mini Project 1.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()...
fastai/fastai
nbs/35_tutorial.wikitext.ipynb
apache-2.0
path = untar_data(URLs.WIKITEXT_TINY) """ Explanation: Tutorial - Assemble the data on the wikitext dataset Using Datasets, Pipeline, TfmdLists and Transform in text In this tutorial, we explore the mid-level API for data collection in the text application. We will use the bases introduced in the pets tutorial so yo...
ethen8181/machine-learning
trees/gbm/gbm.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(css_style = 'custom2.css', plot_style = False) os.chdir(path) # 1. magic for inline ...
biosustain/cameo-notebooks
Advanced-SynBio-for-Cell-Factories-Course/Vanillin Production.ipynb
apache-2.0
from cameo import models model = models.bigg.iMM904 """ Explanation: Vanillin production In 2010, Brochado et al used heuristic optimization together with flux simulations to design a vanillin producing yeast strain. Brochado, A. R., Andrejev, S., Maranas, C. D., & Patil, K. R. (2012). Impact of stoichiometry represe...
GoogleCloudPlatform/ml-design-patterns
03_problem_representation/multilabel.ipynb
apache-2.0
import numpy as np import pandas as pd import tensorflow as tf from tensorflow import keras from tensorflow.keras import Model from tensorflow.keras.layers import Dense, Embedding, Input, Flatten, Conv2D, MaxPooling2D from sklearn.utils import shuffle from sklearn.preprocessing import MultiLabelBinarizer """ Explana...
dxl0632/deeplearning_nd_udacity
intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
davofis/computational_seismology
05_pseudospectral/ps_derivative.ipynb
gpl-3.0
# Import all necessary libraries, this is a configuration step for the exercise. # Please run it before the simulation code! import numpy as np import matplotlib.pyplot as plt # Show the plots in the Notebook. plt.switch_backend("nbagg") """ Explanation: <div style='background-image: url("../../share/images/header.sv...
cougarTech2228/Scouting-2016
notebooks/Obstacle_scatter.ipynb
mit
import matplotlib import matplotlib.pyplot as plot import pandas as pd import numpy as np %matplotlib inline """ Explanation: Scatter Plots of Rank, OPR, and Obstacle Success End of explanation """ a = [3, 4, 5, 6, 7, 15] b = [4, 5, 6, 7 , 7, 3] size = [2, 200, 10, 2, 15] hues = [0.1, 0.2, 0.6, 0.7, 0.9] plot.scatt...
ES-DOC/esdoc-jupyterhub
notebooks/mri/cmip6/models/sandbox-2/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mri', 'sandbox-2', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: MRI Source ID: SANDBOX-2 Topic: Atmoschem Sub-Topics: Transport, Emissions Co...
mne-tools/mne-tools.github.io
0.23/_downloads/9d142d98d094666b7fd2d94155f8b3ec/decoding_unsupervised_spatial_filter.ipynb
bsd-3-clause
# Authors: Jean-Remi King <jeanremi.king@gmail.com> # Asish Panda <asishrocks95@gmail.com> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.decoding import UnsupervisedSpatialFilter from sklearn.decomposition import PCA, FastI...
rastala/mmlspark
notebooks/samples/103 - Before and After MMLSpark.ipynb
mit
import pandas as pd import mmlspark from pyspark.sql.types import IntegerType, StringType, StructType, StructField dataFile = "BookReviewsFromAmazon10K.tsv" textSchema = StructType([StructField("rating", IntegerType(), False), StructField("text", StringType(), False)]) import os, urllib if not...
tensorflow/docs-l10n
site/ja/tutorials/keras/text_classification.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...
rvianello/rdkit
Code/GraphMol/ChemReactions/tutorial/EnumerationToolkit.ipynb
bsd-3-clause
from __future__ import print_function from rdkit.Chem import AllChem from rdkit.Chem import rdChemReactions from rdkit.Chem.AllChem import ReactionFromRxnBlock, ReactionToRxnBlock from rdkit.Chem.Draw import IPythonConsole IPythonConsole.ipython_useSVG=True rxn_data = """$RXN ISIS 090220091539 2 1 $MOL ...
albahnsen/ML_RiskManagement
notebooks/02-IntroPython_Numpy_Scypy_Pandas.ipynb
mit
import sys print('Python version:', sys.version) import IPython print('IPython:', IPython.__version__) import numpy print('numpy:', numpy.__version__) import scipy print('scipy:', scipy.__version__) import matplotlib print('matplotlib:', matplotlib.__version__) import pandas print('pandas:', pandas.__version__) ...
FFIG/ffig
demos/CppLondon_Aug-2017.ipynb
mit
%%file Tree.hpp #ifndef FFIG_DEMOS_TREE_H #define FFIG_DEMOS_TREE_H #include <memory> class Tree { std::unique_ptr<Tree> left_; std::unique_ptr<Tree> right_; int data_ = 0; public: Tree(int children) { if(children <=0) return; left_ = std::make_unique<Tree>(children-1); right_ = std::make_...
jbwhit/WSP-312-Tips-and-Tricks
notebooks/01-Tips-and-tricks.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format='retina' # Add this to python2 code to make life easier from __future__ import absolute_import, division, print_function from itertools import combinations import string from IPython.display import IFrame, HTML, YouTubeVideo import matplotlib as mpl from matplo...
quantopian/research_public
notebooks/data/eventvestor.issue_equity/notebook.ipynb
apache-2.0
# import the dataset from quantopian.interactive.data.eventvestor import issue_equity # or if you want to import the free dataset, use: # from quantopian.interactive.data.eventvestor import issue_equity_free # import data operations from odo import odo # import other libraries we will use import pandas as pd # Let's ...
PythonFreeCourse/Notebooks
week08/3_Exceptions.ipynb
mit
counter = 0 while counter < 10 print("Stop it!") counter += 1 """ Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם ...
stitchfix/d3-jupyter-tutorial
iris_scatterplot.ipynb
mit
from IPython.core.display import display, HTML from string import Template import pandas as pd import json, random HTML('<script src="lib/d3/d3.min.js"></script>') """ Explanation: Iris Scatterplot A simple example of using a bl.ock as the basis for a D3 visualization in Jupyter Using this bl.ocks example as a templa...
ibm-cds-labs/simple-data-pipe-connector-flightstats
notebook/Flight Predict with Pixiedust.ipynb
apache-2.0
!pip install --upgrade --user pixiedust !pip install --upgrade --user pixiedust-flightpredict """ Explanation: Flight Delay Predictions with PixieDust <img style="max-width: 800px; padding: 25px 0px;" src="https://ibm-watson-data-lab.github.io/simple-data-pipe-connector-flightstats/flight_predictor_architecture.png"/...
danijel3/ASRDemos
notebooks/VoxforgeDataPrep.ipynb
apache-2.0
import sys sys.path.append('../python') from voxforge import * """ Explanation: Preparing the Voxforge database This notebook will demonstrate how to prepare the free Voxforge database for training. This database is a medium sized (~80 hours) database available online for free under the GPL license. A much more comm...
moble/MatchedFiltering
GW150914/AdjustCoM.ipynb
mit
import scri import scri.SpEC import numpy as np data_dir = '/Users/boyle/Research/Data/SimulationAnnex/Incoming/BBH_SKS_d13.4_q1.23_sA_0_0_0.320_sB_0_0_-0.580/Lev5/' w_N2 = scri.SpEC.remove_avg_com_motion(data_dir + 'rhOverM_Asymptotic_GeometricUnits.h5/Extrapolated_N2.dir', file_write_mode='w') w_N3 = scri.SpEC.remo...
SheffieldML/notebook
compbio/periodic/figure1.ipynb
bsd-3-clause
%matplotlib inline import numpy as np from matplotlib import pyplot as plt import GPy np.random.seed(1) """ Explanation: Supplementary materials : Details on generating Figure 1 This document is a supplementary material of the article Detecting periodicities with Gaussian processes by N. Durrande, J. Hensman, M. Ratt...
hektor-monteiro/python-notebooks
aula-12_Monte-carlo.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt s = np.random.uniform(8,10., 100000) count, bins, ignored = plt.hist(s, 30) #print (count, bins, ignored) import numpy as np import matplotlib.pyplot as plt mean = [0, 0] cov = [[1, 10], [5, 10]] # covariancia diagonal x, y = np.random.multivariate_normal(mean...
Autodesk/molecular-design-toolkit
moldesign/_notebooks/Example 2. UV-vis absorption spectra.ipynb
apache-2.0
%matplotlib inline import numpy as np from matplotlib.pylab import * try: import seaborn #optional, makes plots look nicer except ImportError: pass import moldesign as mdt from moldesign import units as u """ Explanation: <span style="float:right"><a href="http://moldesign.bionano.autodesk.com/" target="_blank" tit...
lukasmerten/CRPropa3
doc/pages/example_notebooks/propagation_comparison/Propagation_Comparison_CK_BP.ipynb
gpl-3.0
def analytical_solution(max_trajectory, p_z, r_g_0, number_steps): # calculate the time stamps similar to that used in the numerical simulation t = np.linspace(0, max_trajectory/pc, int(number_steps+1)) # shift the phase so that the analytical solution # also starts at (0,0,0) with in the direction (p...
deepchem/deepchem
examples/tutorials/Introducing_JaxModel_and_PINNModel.ipynb
mit
!pip install --pre deepchem[jax] import numpy as np import functools try: import jax import jax.numpy as jnp import haiku as hk import optax from deepchem.models import PINNModel, JaxModel from deepchem.data import NumpyDataset from deepchem.models.optimizers import Adam from jax import jacrev has_ha...
rnikutta/rhocube
rhocube.ipynb
bsd-3-clause
from rhocube import * from models import * import warnings import pylab as p import matplotlib %matplotlib inline def myplot(images,titles='',interpolation='bicubic'): if not isinstance(images,list): images = [images] n = len(images) if not isinstance(titles,list): titles = [titles] ass...
matthewzhenggong/fiwt
workspace_py/RigFreeRollId-Copy1.ipynb
lgpl-3.0
%run matt_startup %run -i matt_utils button_qtconsole() #import other needed modules in all used engines #with dview.sync_imports(): # import os """ Explanation: Parameter Estimation of RIG Roll Experiments Setup and descriptions Without ACM model Turn off wind tunnel Only 1DoF for RIG roll movement Free in any a...
fastai/course-v3
docs/production/lesson-1-export-jit.ipynb
apache-2.0
%reload_ext autoreload %autoreload 2 %matplotlib inline import os import io import tarfile import PIL import boto3 from fastai.vision import * path = untar_data(URLs.PETS); path path_anno = path/'annotations' path_img = path/'images' fnames = get_image_files(path_img) np.random.seed(2) pat = re.compile(r'/([^/]+)...
zerothi/ts-tbt-sisl-tutorial
TS_01/run.ipynb
gpl-3.0
graphene = sisl.geom.graphene(1.44, orthogonal=True) graphene.write('STRUCT_ELEC_SMALL.fdf') graphene.write('STRUCT_ELEC_SMALL.xyz') elec = graphene.tile(2, axis=0) elec.write('STRUCT_ELEC.fdf') elec.write('STRUCT_ELEC.xyz') """ Explanation: First TranSiesta example. This example will only create the structures for ...
vahidpartovinia/pythonworkshop
jupyter/chapter03.ipynb
gpl-2.0
import numpy as np n=200 x_tr = np.linspace(0.0, 2.0, n) y_tr = np.exp(3*x_tr) import random mu, sigma = 0,50 random.seed(1) y = y_tr + np.random.normal(loc=mu, scale= sigma, size=len(x_tr)) import matplotlib.pyplot as plt %matplotlib inline plt.plot(x_tr,y,".",mew=3); plt.plot(x_tr, y_tr,"--r",lw=3); plt.xlabe...
davebshow/DH3501
class5.ipynb
mit
# Usually we import networkx as nx. import networkx as nx # Instantiate a graph. g = nx.Graph() # Add a node. g.add_node(1) # Add a list of nodes. g.add_nodes_from([2, 3, 4, 5]) # Add an edge. g.add_edge(1, 2) # Add a list of edges. g.add_edges_from([(2, 3), (3, 4)]) # Remove a node. g.remove_node(5) """ Explana...
mne-tools/mne-tools.github.io
0.23/_downloads/27d6cff3f645408158cdf4f3f05a21b6/30_eeg_erp.ipynb
bsd-3-clause
import os import numpy as np import matplotlib.pyplot as plt import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_filt-0-40_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, pr...
enakai00/jupyter_NikkeiLinux
No5/Figure11 - derivative_animation.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation %matplotlib nbagg """ Explanation: [4-1] 動画作成用のモジュールをインポートして、動画を表示可能なモードにセットします。 End of explanation """ def derivative(f, filename): fig = plt.figure(figsize=(4,4)) images = [] x0, d = 0.5, 0.5 for _ in range...
google/applied-machine-learning-intensive
content/04_classification/03_classification_with_tensorflow/colab.ipynb
apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
axm108/Rydberg
model_fitting/rabi/rabi_fit.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats from scipy.optimize import curve_fit %matplotlib inline """ Explanation: Rabi model fitting End of explanation """ def rabiModel(time, rabiFreq, T1, Tdec, phi, a0, a1, a2, detuning=0.0): phi_deg = phi*(np.pi/180) W = np.sqrt(rabiF...
transientskp/notebooks
trap movie.ipynb
mit
import matplotlib # remove this inline statement to stop the previews in the notebook %matplotlib inline #matplotlib.use('Agg') import logging from tkp.db.model import Image, Extractedsource from tkp.db import Database from pymongo import MongoClient from gridfs import GridFS from astropy.io import fits from astropy...
psychemedia/ou-robotics-vrep
robotVM/notebooks/Demo - Square N - Functions.ipynb
apache-2.0
import time def myFunction(): print("Hello...") #Pause awhile... time.sleep(2) print("...world!") #call the function - note the brackets! myFunction() """ Explanation: Traverse a Square - Part N - Functions tricky because of scoping - need to think carefully about this.... In the previo...