repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
ES-DOC/esdoc-jupyterhub
notebooks/snu/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'snu', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: SNU Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties: 6...
antoniomezzacapo/qiskit-tutorial
community/aqua/general/vqe.ipynb
apache-2.0
from qiskit_aqua import Operator, run_algorithm from qiskit_aqua.input import get_input_instance """ Explanation: Using Qiskit Aqua algorithms, a how to guide This notebook demonstrates how to use the Qiskit Aqua library to invoke a specific algorithm and process the result. Further information is available for the al...
jinzishuai/learn2deeplearn
google_dl_udacity/lesson3/3_regularization.ipynb
gpl-3.0
# 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 """ Explanation: Deep Learning Assignment 3 Previously in 2_fullyconnected.ipynb, you tra...
sdpython/pymyinstall
_doc/notebooks/example_profiling.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: test about profiling How to profile from a notebook with cProfile, memory_profiler End of explanation """ def big_list1(n): l = [] for i in range(n): l.append(i) return l def big_list2(n): return list(range(n)) ...
woobe/h2o_tutorials
introduction_to_machine_learning/py_03c_regression_ensembles.ipynb
mit
# Import all required modules import h2o from h2o.estimators.gbm import H2OGradientBoostingEstimator from h2o.estimators.random_forest import H2ORandomForestEstimator from h2o.estimators.deeplearning import H2ODeepLearningEstimator from h2o.estimators.stackedensemble import H2OStackedEnsembleEstimator from h2o.grid.gri...
ARM-software/lisa
ipynb/deprecated/releases/ReleaseNotes_v16.12.ipynb
apache-2.0
!head -n12 $LISA_HOME/logging.conf """ Explanation: Target Connectivity Configurable logging system All LISA modules have been updated to use a more consistent logging which can be configured using a single configuraton file: End of explanation """ !head -n30 $LISA_HOME/logging.conf | tail -n5 """ Explanation: Each...
AC209ConsumerConfidence/AC209ConsumerConfidence.github.io
DynamicVAR_Final.ipynb
gpl-3.0
# Load Datasets dateparse = lambda dates: pd.datetime.strptime(dates, '%Y-%m') cci = pd.read_csv('Economic_Sentiment_Forecast/CCI.csv', parse_dates=True, index_col='TIME',date_parser=dateparse) cci = cci["Value"] cci.columns = ["CCI"] cci = cci['1990-01-01':] dateparse = lambda dates: pd.datetime.strptime(dates, '%Y-%...
AaronCWong/phys202-2015-work
assignments/assignment09/IntegrationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy import integrate """ Explanation: Integration Exercise 1 Imports End of explanation """ def trapz(f, a, b, N): h = (b - a)/N i = np.arange(1,N) c = h*(0.5*f(a)+f(b)*0.5+f(a+i*h).sum()) return c f = lambda x: x**2 g = la...
matousc89/PPSI
podklady/notebooks/funkce_a_tridy.ipynb
mit
def my_function(a, b): """ This function sum together two variables (if they are summable). """ return a + b """ Explanation: Funkce a třídy Funkce Následuje příklad definice funkce, která sečte dva argumenty - a, b. End of explanation """ my_function(2, 5) my_function("Spam ", "eggs") my_functi...
sujitpal/polydlot
src/tensorflow/04-mnist-rnn.ipynb
apache-2.0
from __future__ import division, print_function from tensorflow.contrib import keras from sklearn.metrics import accuracy_score, confusion_matrix from sklearn.preprocessing import OneHotEncoder import matplotlib.pyplot as plt import numpy as np import os import tensorflow as tf %matplotlib inline DATA_DIR = "../../dat...
ivukotic/ML_platform_tests
tutorial/jupyter python numpy plotting/4_Plotting_Basics.ipynb
gpl-3.0
fig, ax = pl.subplots(2,2, figsize=(8,6)) fig ax ax[0,0] """ Explanation: We start by importing NumPy which you should be familiar with from the previous tutorial. The next library introduced is called MatPlotLib which is the roughly the Python equivalent of Matlab's plotting functionality. Think of it as a Mathema...
mgalardini/2017_python_course
notebooks/6-Useful_third_party_libraries_for_data_analysis.ipynb
gpl-2.0
# setup.py example # %%bash # wget https://github.com/biopython/biopython/archive/biopython-168.tar.gz # tar -xvf biopython-168.tar.gz # cd biopython-168.tar.gz # sudo python setup.py install # using pip # !pip install biopython # using anaconda # !conda install biopython # using ap-get # !sudo apt-get install pyth...
hdesmond/StatisticalMethods
examples/SDSScatalog/CorrFunc.ipynb
gpl-2.0
%load_ext autoreload %autoreload 2 import numpy as np import SDSS import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import copy # We want to select galaxies, and then are only interested in their positions on the sky. data = pd.read_csv("downloads/SDSSobjects.csv",usecols=['ra','dec','u','g',\ ...
sbenthall/bigbang
examples/experimental_notebooks/EME Diversity Analysis.ipynb
agpl-3.0
import bigbang.mailman as mailman import bigbang.process as process from bigbang.archive import Archive import pandas as pd import datetime from commonregex import CommonRegex import matplotlib.pyplot as plt %matplotlib inline """ Explanation: This work was done by Harsh Gupta as part of his internship at The Cent...
mdiaz236/DeepLearningFoundations
sentiment_network/Sentiment Classification - Mini Project 2.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()...
5agado/data-science-learning
graphics/physarum/Physarum.ipynb
apache-2.0
import numpy as np import cupy as cp import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import tqdm import math import os import sys from pathlib import Path %matplotlib inline %load_ext autoreload %autoreload 2 import Physarum as physarum from Physarum import Physarum from ds_utils.sim_util...
hpparvi/PyTransit
notebooks/contamination/example_1b.ipynb
gpl-2.0
%pylab inline import sys from corner import corner sys.path.append('.') from src.mocklc import MockLC, SimulationSetup from src.blendlpf import MockLPF import src.plotting as pl """ Explanation: Contamination example 1b No contamination and informative priors on orbit parameters Hannu Parviainen<br> Instituto de As...
LucaCanali/Miscellaneous
Spark_Physics/HEP_benchmark/ADL_HEP_Query_Benchmark_Q1_Q5_Parquet_sparkhistogram.ipynb
apache-2.0
# Install PySpark if needed # !pip install pyspark # Install sparkhistogram ! pip install sparkhistogram # Note: if you cannot install the package sparkhistogram, # create the computeHistogram function as detailed at the end of this notebook. # See https://github.com/LucaCanali/Miscellaneous/blob/master/Spark_Notes/...
JoseGuzman/myIPythonNotebooks
SignalProcessing/Complex numbers.ipynb
gpl-2.0
# initiation and examples z = complex(3,4) print('The complex {}, where {} is the real and {} the imaginary part'.format(z, z.real, z.imag)) """ Explanation: <H1>Complex numbers</H1> A complex number has the property that multipied by itself get a negative answer. For example, if an imaginary number like z could be ...
revspete/self-driving-car-nd
sem1/p1-lane-lines/.ipynb_checkpoints/P1-checkpoint.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline """ Explanation: Self-Driving Car Engineer Nanodegree Project: Finding Lane Lines on the Road In this project, you will use the tools you learned about in the lesson to ide...
DOV-Vlaanderen/pydov
docs/notebooks/search_boringen.ipynb
mit
%matplotlib inline import inspect, sys import warnings; warnings.simplefilter('ignore') # check pydov path import pydov """ Explanation: Example of DOV search methods for boreholes (boringen) Use cases explained below Get boreholes in a bounding box Get boreholes with specific properties Get boreholes in a bounding...
dismalpy/dismalpy
doc/notebooks/varmax.ipynb
bsd-2-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import dismalpy as dp import matplotlib.pyplot as plt dta = pd.read_stata('data/lutkepohl2.dta') dta.index = dta.qtr endog = dta.ix['1960-04-01':'1978-10-01', ['dln_inv', 'dln_inc', 'dln_consump']] """ Explanation: VARMAX models T...
UWSEDS/LectureNotes
Fall2018/07-Jupyter-Notebook-In-Depth/LorenzSystem.ipynb
bsd-2-clause
%matplotlib inline from ipywidgets import interact, interactive from IPython.display import clear_output, display, HTML import numpy as np from scipy import integrate from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.colors import cnames from matplotlib import animation ""...
unmrds/cc-python
.ipynb_checkpoints/Space Analysis -checkpoint.ipynb
apache-2.0
# Import a very useful and powerful module for interacting with tabular data import pandas as pd # Install and import tabulate for generating tables for hardcopy reports !TABULATE_INSTALL=lib-only; pip install tabulate from tabulate import tabulate # Set up the report generation variables report_file_name = 'report.m...
stanfordnqp/spins-b
examples/invdes/wdm2/monitor_processing_example.ipynb
gpl-3.0
## Import libraries necessary for monitor data processing. ## from matplotlib import pyplot as plt import numpy as np import os import pandas as pd import pickle from spins.invdes.problem_graph import log_tools ## Define filenames. ## # `save_folder` is the full path to the directory containing the Pickle (.pkl) log...
sarajcev/logreg-linreg
logreg-compare.ipynb
gpl-2.0
from __future__ import print_function import numpy as np import statsmodels.api as sm from sklearn.linear_model import LogisticRegression from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt from scipy import stats import seaborn as sns sns.set(style='darkgrid', font_scale=1.2) %matplot...
changhoonhahn/centralMS
notebook/local_sfs_prior.ipynb
mit
import numpy as np # -- centralms -- from centralMS import util as UT from centralMS import sfh as SFH from centralMS import catalog as Cat import corner as DFM import matplotlib as mpl import matplotlib.pyplot as pl mpl.rcParams['text.usetex'] = True mpl.rcParams['font.family'] = 'serif' mpl.rcParams['axes.linewi...
QuantScientist/Deep-Learning-Boot-Camp
day02-PyTORCH-and-PyCUDA/PyTorch/18-PyTorch-NUMER.AI-Binary-Classification-BCELoss.ipynb
mit
import torch import sys import torch from torch.utils.data.dataset import Dataset from torch.utils.data import DataLoader from torchvision import transforms from torch import nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from sklearn import cross_validation from skl...
MTG/essentia
src/examples/python/tutorial_pitch_melody.ipynb
agpl-3.0
# For embedding audio player import IPython # Plots import matplotlib.pyplot as plt from pylab import plot, show, figure, imshow plt.rcParams['figure.figsize'] = (15, 6) import numpy import essentia.standard as es audiofile = '../../../test/audio/recorded/flamenco.mp3' # Load audio file. # It is recommended to app...
ga7g08/ga7g08.github.io
_notebooks/2015-05-12-GDP-by-country.ipynb
mit
# %load ../data_sets/GDP_by_Country_WorldBank/Makefile DOWNLOAD = data.zip OUT = ny.gdp.mktp.cd_Indicator_en_csv_v2.csv .PHONY: download clean download: rm -f ${DOWNLOAD} wget http://api.worldbank.org/v2/en/indicator/ny.gdp.mktp.cd?downloadformat=csv -O data.zip unzip $(DOWNLOAD) rm -f ${DOWNLOAD} Metadata*csv *xm...
eds-uga/csci1360e-su17
lectures/L5.ipynb
mit
for i in range(10): print(i, end = " ") """ Explanation: Lecture 5: Advanced Data Structures CSCI 1360E: Foundations for Informatics and Analytics Overview and Objectives We've covered list, tuples, sets, and dictionaries. These are the foundational data structures in Python. In this lecture, we'll go over some mo...
dtsmith2001/p-data-challenge
Report.ipynb
mit
def convert_list(query_string): """Parse the query string of the url into a dictionary. Handle special cases: - There is a single query "error=True" which is rewritten to 1 if True, else 0. - Parsing the query returns a dictionary of key-value pairs. The value is a list. We must get the list ...
cliburn/sta-663-2017
notebook/03_Classes.ipynb
mit
class A: """Base class.""" def __init__(self, x): self.x = x def __repr__(self): return '%s(%a)' % (self.__class__.__name__, self.x) def report(self): """Report type of contained value.""" return 'My value is of type %s' % type(self.x) """ Explanation: Classes As you...
Almaz-KG/MachineLearning
ml-for-finance/python-for-financial-analysis-and-algorithmic-trading/02-NumPy/1-NumPy-Arrays.ipynb
apache-2.0
import numpy as np """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> <center>Copyright Pierian Data 2017</center> <center>For more information, visit us at www.pieriandata.com</center> NumPy NumPy (or Numpy) is a Linear Algebra Library for Python, the reason it is so im...
BenLangmead/comp-genomics-class
projects/UnpairedAsmChallenge.ipynb
gpl-2.0
# Download the file containing the reads to "reads.fa" in current directory ! wget http://www.cs.jhu.edu/~langmea/resources/f2020_hw4_reads.fa # Following line is so we can see the first few lines of the reads file # from within IPython -- don't paste this into your Python code ! head f2020_hw4_reads.fa """ Explanati...
DS-100/sp17-materials
sp17/labs/lab06/lab06_master.ipynb
gpl-3.0
!pip install ipython-sql %load_ext sql %sql sqlite:///./lab06.sqlite import sqlalchemy engine = sqlalchemy.create_engine("sqlite:///lab06.sqlite") connection = engine.connect() !pip install -U okpy from client.api.notebook import Notebook ok = Notebook('lab06.ok') """ Explanation: Lab 6: SQL End of explanation "...
madHatter106/DataScienceCorner
posts/a-bayesian-tutorial-in-python-part-I.ipynb
mit
import pickle import warnings import sys import pandas as pd import numpy as np from scipy.stats import norm as gaussian, uniform import seaborn as sb import matplotlib.pyplot as pl from matplotlib import rcParams from matplotlib import ticker as mtick print('Versions:') print('---------') print(f'python: {sys.vers...
hunterherrin/phys202-2015-work
assignments/assignment11/OptimizationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Optimization Exercise 1 Imports End of explanation """ def hat(x,a,b): return b*x**4-a*x**2 assert hat(0.0, 1.0, 1.0)==0.0 assert hat(0.0, 1.0, 1.0)==0.0 assert hat(1.0, 10.0, 1.0)==-9.0 """ Expl...
cranium/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...
strandbygaard/deep-learning
weight-initialization/weight_initialization.ipynb
mit
%matplotlib inline import tensorflow as tf import helper from tensorflow.examples.tutorials.mnist import input_data print('Getting MNIST Dataset...') mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) print('Data Extracted.') """ Explanation: Weight Initialization In this lesson, you'll learn how to fin...
Reddone/CarIncidentJupyter
RandomForest.ipynb
mit
# Load dataset load_path = r"0_CarIncident_2014" dataset = pd.read_pickle(load_path) dataset.drop('IDProtocollo', inplace=True, axis=1) dataset.drop('Progressivo', inplace=True, axis=1) dataset.describe() """ Explanation: Partendo dal dataset salvato precedentemente, cerchiamo di mettere su un algoritmo predittivo, at...
ayushmaskey/ayushmaskey.github.io
jupyter/pandas_resampling.ipynb
mit
rng = pd.date_range('1/1/2011', periods=72, freq='H') rng[1:4] ts = pd.Series(list(range(len(rng))), index=rng) ts.head() """ Explanation: resampling does not have frequency and we want it does not have the frequency we want End of explanation """ converted = ts.asfreq('45Min', method='ffill') converted.head(10) ...
postBG/DL_project
sentiment-network/Sentiment_Classification_Projects.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()...
YuriyGuts/kaggle-quora-question-pairs
notebooks/preproc-embeddings-fasttext.ipynb
mit
from pygoose import * import os import subprocess """ Explanation: Preprocessing: Create a FastText Vector Database Based on the vocabulary extracted from question texts, use a pretrained FastText model to query and save word vectors. Imports This utility package imports numpy, pandas, matplotlib and a helper kg modu...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/lectures/Long-Short_Equity/notebook.ipynb
unlicense
import numpy as np import pandas as pd import matplotlib.pyplot as plt # We'll generate a random factor current_factor_values = np.random.normal(0, 1, 10000) equity_names = ['Equity ' + str(x) for x in range(10000)] # Put it into a dataframe factor_data = pd.Series(current_factor_values, index = equity_names) factor_d...
ES-DOC/esdoc-jupyterhub
notebooks/awi/cmip6/models/sandbox-2/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'awi', 'sandbox-2', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: AWI Source ID: SANDBOX-2 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balance...
Kaggle/learntools
notebooks/deep_learning_intro/raw/ex5.ipynb
apache-2.0
# Setup plotting import matplotlib.pyplot as plt plt.style.use('seaborn-whitegrid') # Set Matplotlib defaults plt.rc('figure', autolayout=True) plt.rc('axes', labelweight='bold', labelsize='large', titleweight='bold', titlesize=18, titlepad=10) plt.rc('animation', html='html5') # Setup feedback system from lear...
rasbt/pattern_classification
data_collecting/reading_mnist.ipynb
gpl-3.0
import os import struct import numpy as np def load_mnist(path, which='train'): if which == 'train': labels_path = os.path.join(path, 'train-labels-idx1-ubyte') images_path = os.path.join(path, 'train-images-idx3-ubyte') elif which == 'test': labels_path = os.path.join(path, 't10k-la...
borja876/Thinkful-DataScience-Borja
The%2BBrandy%2BBunch%2BShow.ipynb
mit
df2=pd.DataFrame() df2['BB_age']=[14, 12, 11, 10, 8, 7, 8] #Calculate Mean & Median mean = np.mean(df2['BB_age']) median = np.median(df2['BB_age']) print(mean) print(median) #Calculate Mode (values, counts) = np.unique(df2['BB_age'], return_counts=True) ind = np.argmax(counts) print(ind) values[ind] #Calculate varia...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_artifacts_correction_rejection.ipynb
bsd-3-clause
import numpy as np import mne from mne.datasets import sample data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif' raw = mne.io.read_raw_fif(raw_fname) raw.set_eeg_reference() """ Explanation: Rejecting bad data (channels and segments) End of explanation """ raw.info[...
statkraft/shyft-doc
notebooks/nea-example/simulation-configured.ipynb
lgpl-3.0
# Pure python modules and jupyter notebook functionality # first you should import the third-party python modules which you'll use later on # the first line enables that figures are shown inline, directly in the notebook %pylab inline import os import datetime as dt from os import path import sys from matplotlib import...
sevo/closure_decorator
Other functional features.ipynb
mit
def add(a, b): return a + b def make_adder(a) : def adder(b) : return add(a, b) return adder add_two = make_adder(20) add_two(4) """ Explanation: 1. Partial function application 2. Pattern matching Ciastocna aplikacia - Partially applied functions http://blog.dhananjaynene.com/tags/functional-pro...
mikekestemont/ghent1516
Chapter 8 - Parsing XML.ipynb
mit
from lxml import etree """ Explanation: Parsing XML in Python XML in a nutshell So far, we have primarily dealt with unstructured data in this course: we have learned to read, for example, the contents of plain text files in the previous chapters. Such raw textual data is often called 'unstructured', because it lacks ...
SylvainCorlay/bqplot
examples/Tutorials/Updating Plots.ipynb
apache-2.0
import numpy as np import bqplot.pyplot as plt x = np.linspace(-10, 10, 100) y = np.sin(x) fig = plt.figure() line = plt.plot(x=x, y=y) fig """ Explanation: Updating Plots bqplot is an interactive plotting library. Attributes of plots can be updated in place without recreating the whole figure and marks. Let's look ...
thempel/adaptivemd
examples/tutorial/2_example_run.ipynb
lgpl-2.1
import sys, os from adaptivemd import Project, Event, FunctionalEvent, Trajectory """ Explanation: Example 2 - The Tasks Imports End of explanation """ project = Project('tutorial') """ Explanation: Let's open our test project by its name. If you completed the previous example this should all work out of the box. ...
NuGrid/NuPyCEE
DOC/Teaching/.ipynb_checkpoints/Section2.1-checkpoint.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import sygma import omega import stellab #loading the observational data module STELLAB stellab = stellab.stellab() """ Explanation: Section 2.1: Tracing the origin of C Result: Identification of which star is responsible for the origin of C End of explanation """ # OMEGA parameters ...
geoneill12/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...
openconnectome/ocpdocs
mrgraphs/dataset_variance/dataset_variance.ipynb
apache-2.0
import matplotlib.pyplot as plt %matplotlib inline import numpy as np import nibabel as nb import os from histogram_window import histogram_windowing """ Explanation: Analysis of Dataset Variance Data which is collected differently, look differently. This principle extends to all data (that I can think of), and of c...
mne-tools/mne-tools.github.io
0.20/_downloads/a47d41a5d6e12802ada8e8ab7ecc9ffc/plot_50_configure_mne.ipynb
bsd-3-clause
import os import mne """ Explanation: Configuring MNE-Python This tutorial covers how to configure MNE-Python to suit your local system and your analysis preferences. :depth: 1 We begin by importing the necessary Python modules: End of explanation """ print(mne.get_config('MNE_USE_CUDA')) print(type(mne.get_confi...
rsterbentz/phys202-2015-work
days/day08/Display.ipynb
mit
class Ball(object): pass b = Ball() b.__repr__() print(b) """ Explanation: Display of Rich Output In Python, objects can declare their textual representation using the __repr__ method. End of explanation """ class Ball(object): def __repr__(self): return 'TEST' b = Ball() print(b) """ Explanatio...
bioinformatica-corso/lezioni
laboratorio/lezione10-29ott21/esercizio5-soluzione.ipynb
cc0-1.0
import re """ Explanation: Esercizio 5 Prendere in input un file in formato GTF (Gene Transfer Format), che annota un set di geni su una genomica di riferimento, insieme al file FASTA della genomica di riferimento e produrre: le sequenze dei trascritti oppure le sequenze delle coding sequences (CDS) per i geni annota...
mdda/fossasia-2016_deep-learning
notebooks/work-in-progress/2018-08_DidTheModelUnderstandTheQuestion/VQA_playground.ipynb
mit
# Upgrade pillow to latest version (solves a colab Issue) : ! pip install -U 'Pillow>=5.2.0' import os, sys from matplotlib import pyplot as plt import warnings warnings.filterwarnings("ignore", category=UserWarning) # Cleaner demos : Don't do this normally... """ Explanation: VQA : Use and Abuse To answer a questi...
jrg365/gpytorch
examples/01_Exact_GPs/Spectral_Delta_GP_Regression.ipynb
mit
import gpytorch import torch """ Explanation: Spectral GP Learning with Deltas In this paper, we demonstrate another approach to spectral learning with GPs, learning a spectral density as a simple mixture of deltas. This has been explored, for example, as early as Lázaro-Gredilla et al., 2010. Compared to learning Gau...
ES-DOC/esdoc-jupyterhub
notebooks/cmcc/cmip6/models/sandbox-2/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cmcc', 'sandbox-2', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: CMCC Source ID: SANDBOX-2 Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
ivannz/crossing_paper2017
experiments/bellcore_traffic_data.ipynb
mit
import numpy as np %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Bellcore LAN traffic This notebook uses uncompressed data from here. Namely the datasets: BC-pAug89 and BC-pOct89. Description: The files whose names end in TL are ASCII-format tracing data, consisting of one 20-byte line per Ethe...
tensorflow/docs-l10n
site/zh-cn/lattice/tutorials/shape_constraints.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...
amitkaps/machine-learning
time_series/3-Refine.ipynb
mit
# Import the two library we need, which is Pandas and Numpy import pandas as pd import numpy as np # Read the csv file of Month Wise Market Arrival data that has been scraped. df = pd.read_csv('MonthWiseMarketArrivals.csv') df.head() df.tail() """ Explanation: 2. Refine the Data "Data is messy" We will be perform...
probml/pyprobml
deprecated/arhmm_example.ipynb
mit
!pip install git+git://github.com/lindermanlab/ssm-jax-refactor.git import ssm import copy import jax.numpy as np import jax.random as jr from tensorflow_probability.substrates import jax as tfp from ssm.distributions.linreg import GaussianLinearRegression from ssm.arhmm import GaussianARHMM from ssm.utils import...
tyarkoni/pliers
examples/Quickstart.ipynb
bsd-3-clause
from pliers.extractors import FaceRecognitionFaceLocationsExtractor # A picture of Barack Obama image = join(get_test_data_path(), 'image', 'obama.jpg') # Initialize Extractor ext = FaceRecognitionFaceLocationsExtractor() # Apply Extractor to image result = ext.transform(image) result.to_df() """ Explanation: Plie...
gwu-libraries/notebooks
20161122-twitter-jq-recipes/twitter_jq_recipes.ipynb
mit
!head -n5 tweets.json | jq -c '[.id_str, .text]' """ Explanation: Recipes for processing Twitter data with jq This notebook is a companion to Getting Started Working with Twitter Data Using jq. It focuses on recipes that the Social Feed Manager team has used when preparing datasets of tweets for researchers. We will c...
BrainIntensive/OnlineBrainIntensive
resources/matplotlib/Examples/3dplots.ipynb
mit
%load_ext watermark %watermark -u -v -d -p matplotlib,numpy """ Explanation: Sebastian Raschka back to the matplotlib-gallery at https://github.com/rasbt/matplotlib-gallery End of explanation """ %matplotlib inline """ Explanation: <font size="1.5em">More info about the %watermark extension</font> End of explanati...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_sensors_decoding.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score from sklearn.cross_validation import StratifiedKFold import mne from mne.datasets import sample from mne.decoding import TimeDecoding, GeneralizationAcrossTime data_path = sample.data_path() plt.close('all') """ Explanatio...
kaushik94/sympy
examples/notebooks/Macaulay_resultant.ipynb
bsd-3-clause
x, y, z = sym.symbols('x, y, z') a_1_1, a_1_2, a_1_3, a_2_2, a_2_3, a_3_3 = sym.symbols('a_1_1, a_1_2, a_1_3, a_2_2, a_2_3, a_3_3') b_1_1, b_1_2, b_1_3, b_2_2, b_2_3, b_3_3 = sym.symbols('b_1_1, b_1_2, b_1_3, b_2_2, b_2_3, b_3_3') c_1, c_2, c_3 = sym.symbols('c_1, c_2, c_3') variables = [x, y, z] f_1 = a_1_1 * x ** ...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session02/Day1/ReIntroToMachineLearning.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Re-Introduction to Machine Learning: Classifying the Iris Dataset with K-Nearest Neighbors Version 0.1 By AA Miller (Northwestern University, Adler Planetarium) During the first session of the LSSTC DSFP we had an opportunity to wo...
leriomaggio/deep-learning-keras-tensorflow
6. AutoEncoders and Embeddings/6.1. AutoEncoders and Embeddings.ipynb
mit
from keras.layers import Input, Dense from keras.models import Model from keras.datasets import mnist import numpy as np # this is the size of our encoded representations encoding_dim = 32 # 32 floats -> compression of factor 24.5, assuming the input is 784 floats # this is our input placeholder input_img = Input(...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch2-Problem_2-02.ipynb
unlicense
%pylab notebook %precision 4 """ Explanation: Excercises Electric Machinery Fundamentals Chapter 2 Problem 2-2 End of explanation """ Zline = 38.2 + 140.0j # [Ohm] Zeq = 0.10 + 0.4j # [Ohm] V_high = 14e3 # [V] V_low = 2.4e3 # [V] Pout = 90e3 # [W] load PF = 0.8 # lagging VS = 2.3e3 # [V] seco...
rafburzy/Python_EE
Capacitors/Discharging_capacitors.ipynb
bsd-3-clause
# Definitions of parameters of the circuit # Capacitance of generator [F] C = 1e-6 # Parallel resistance (discharging the capacitor in the generator forming the tail of the impulse) [Ohm] R1 = 4 # Series resistance (forming the head) [Ohm] R2 = 150 # Inductance of the loop [H] L = 1e-3 # Capacitance of the test o...
cassiogreco/udacity-data-analyst-nanodegree
P1/P1_Cassio.ipynb
mit
import pandas as pd import math %pylab inline import matplotlib.pyplot as plt CONGRUENT = 'Congruent' INCONGRUENT = 'Incongruent' TCRITICAL = 2.807 # two-tailed difference with 99% Confidence and Degree of Freedom of 23 path = r'~/udacity-data-analyst-nanodegree/P1/stroopdata.csv' initialData = pd.read_csv(path) dat...
ES-DOC/esdoc-jupyterhub
notebooks/messy-consortium/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'messy-consortium', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: MESSY-CONSORTIUM Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topic...
GraysonRicketts/collegeScorecard
notebooks/.ipynb_checkpoints/Initial Exploration-checkpoint.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import sqlite3 import pandas as pd import seaborn as sns sns.set_style("white") """ Explanation: Initial Eploration Goals Load dataset into sqlite server Make basic queries against database Understand basic structure and fields of dataset Start exploring different ...
cuthbertLab/bali
documentation/Using bali module.ipynb
bsd-3-clause
import bali """ Explanation: Here is how you load the "bali" module End of explanation """ fileReader = bali.FileReader() fileReader.taught fileReader.transcribed """ Explanation: Now we make a FileReader End of explanation """ fp = bali.FileParser() fp.taught """ Explanation: More useful Object The FileParser...
vravishankar/Jupyter-Books
Functions.ipynb
mit
# Simple Function def greet(): '''Simple Greet Function''' print('Hello World') greet() """ Explanation: Functions Function is a group of related statements that perform a specific task. Function help break large programs into smaller and modular chunks Function makes the code more organised and easy to ...
Illedran/NIPSTimeMachine
topic_evolution/topic_evolution.ipynb
gpl-3.0
import csv import pandas as pd import os, re import codecs import os DATA_DIR = "../nips-data" MODEL_DIR = "../models" papers = pd.read_csv(os.path.join(DATA_DIR, 'papers.csv')) with open(os.path.join(MODEL_DIR, 'stopwords.txt')) as f: stopwords=[] for line in f: stopwords.append(line.strip()) """ ...
unmrds/cc-python
.ipynb_checkpoints/Name_Data-checkpoint.ipynb
apache-2.0
# http://api.census.gov/data/2010/surname import requests import json import pandas as pd import matplotlib.pyplot as plt """ Explanation: An Introductory Python Workflow: US Census Surname Data This notebook provides working examples of many of the concepts introduced earlier: Importing modules or libraries to exten...
SciTools/courses
course_content/iris_course/5.Cube_Plotting.ipynb
gpl-3.0
import iris """ Explanation: Iris introduction course 5. Cube Plotting Learning Outcome: by the end of this section, you will be able to visualise the data stored in Iris Cubes. Duration: 30 mins Overview:<br> 5.1 Plotting Data<br> 5.2 Maps with cartopy<br> 5.3 Exercise<br> 5.4 Summary of the Section Setup End of expl...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/sandbox-1/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'sandbox-1', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: MIROC Source ID: SANDBOX-1 Topic: Atmoschem Sub-Topics: Transport, Emission...
ivukotic/ML_platform_tests
tutorial/jupyter python numpy plotting/3_NumPy_Basics.ipynb
gpl-3.0
import numpy as np from __future__ import print_function """ Explanation: NumPy Basics Numerical Python, or "NumPy" for short, is a foundational package on which many of the most common data science packages are built. Numpy provides us with high performance multi-dimensional arrays which we can use as vectors or mat...
david-hoffman/scripts
notebooks/mandelbrot_numbapro.ipynb
apache-2.0
%pylab inline import numpy as np from timeit import default_timer as timer """ Explanation: A NumbaPro Mandelbrot Example This notebook was written by Mark Harris based on code examples from Continuum Analytics that I modified somewhat. This is an example that demonstrates accelerating a Mandelbrot fractal computation...
flsantos/startup_acquisition_forecast
exploratory_code/2_dataset_preparation.ipynb
mit
import pandas as pd startups = pd.read_csv('data/startups_1_1.csv', index_col=0) startups[:3] """ Explanation: Dataset Preparation Here we'll be removing nan's, normalizing numerical features, converting date features to numerical normalized features, and so on... Importing the dataset End of explanation """ #drop f...
rbharath/deepchem
examples/broken/protein_ligand_complex_notebook.ipynb
mit
%load_ext autoreload %autoreload 2 %pdb off # set DISPLAY = True when running tutorial DISPLAY = False # set PARALLELIZE to true if you want to use ipyparallel PARALLELIZE = False import warnings warnings.filterwarnings('ignore') dataset_file= "../datasets/pdbbind_core_df.pkl.gz" from deepchem.utils.save import load_f...
Unidata/unidata-python-workshop
notebooks/XArray/XArray and CF.ipynb
mit
# Convention for import to get shortened namespace import numpy as np import xarray as xr # Create some sample "temperature" data data = 283 + 5 * np.random.randn(5, 3, 4) data """ Explanation: <div style="width:1000 px"> <div style="float:right; width:98 px; height:98px;"> <img src="https://raw.githubusercontent.co...
mne-tools/mne-tools.github.io
0.22/_downloads/1af5a35cbb809b9480120842884536c5/plot_brainstorm_auditory.ipynb
bsd-3-clause
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: BSD (3-clause) import os.path as op import pandas as pd import numpy as np import mne from mne import combine_evoked from mne.minimum_norm impor...
elenduuche/deep-learning
autoencoder/Simple_Autoencoder_Solution.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
GuillaumeDec/machine-learning
deep-multivariate-lstm-tensorflow/tensorflow deep multivariate lstm .ipynb
gpl-3.0
import numpy as np import pandas as pd import tensorflow as tf import utils as utl from collections import Counter """ Explanation: Modeling Stock Market Sentiment with LSTMs and TensorFlow In this tutorial, we will build a Long Short Term Memory (LSTM) Network to predict the stock market sentiment based on a comment ...
karhohs/boardgame-bookie
boardgames/seafall/game_engine/Logic Test.ipynb
bsd-3-clause
%matplotlib inline import numpy import matplotlib from matplotlib.patches import Circle, Wedge, Polygon from matplotlib.collections import PatchCollection import matplotlib.pyplot as plt import matplotlib.patches as mpatches import matplotlib.lines as mlines import matplotlib.path as mpath import numpy as np import sea...
abatula/MachineLearningIntro
KNN_Tutorial.ipynb
gpl-2.0
# Print figures in the notebook %matplotlib inline import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from sklearn import neighbors, datasets # Import the nerest neighbor function and dataset from scikit-learn from sklearn.model_selection import train_test_split, KFold # ...
gully/starfish-demo
demo6/lnprior.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns % config InlineBackend.figure_format = 'retina' """ Explanation: How to set priors on stellar parameters. gully https://github.com/iancze/Starfish/issues/32 The strategy here is to define a lnprior and add it to the lnprob. We...
VUInformationRetrieval/IR2015_2016
04_analysis.ipynb
gpl-2.0
import pickle, bz2 from collections import * import numpy as np import matplotlib.pyplot as plt # show plots inline within the notebook %matplotlib inline # set plots' resolution plt.rcParams['savefig.dpi'] = 100 from IPython.display import display, HTML Ids_file = 'data/air__Ids.pkl.bz2' Summaries_file = 'data/air...
lalonica/PhD
vehicles/VehiclesTimeCycles.ipynb
gpl-3.0
%matplotlib inline from pandas import Series, DataFrame import pandas as pd from itertools import * import numpy as np import csv import math import matplotlib.pyplot as plt from matplotlib import pylab from scipy.signal import hilbert, chirp import scipy import networkx as nx """ Explanation: Loading the necessary l...
godfreyduke/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...