repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
Chilipp/psy-simple
examples/example_bar.ipynb
gpl-2.0
import psyplot.project as psy %matplotlib inline %config InlineBackend.close_figures = False axes = iter(psy.multiple_subplots(2, 2, n=3)) for var in ['t2m', 'u', 'v']: psy.plot.barplot( 'demo.nc', # netCDF file storing the data name=var, # one plot for each variable y=[0, 1], # two bars ...
mertnuhoglu/study
py/jupyter/week04_01.ipynb
apache-2.0
import numpy as np import h5py import matplotlib.pyplot as plt from testCases_v2 import * from dnn_utils_v2 import sigmoid, sigmoid_backward, relu, relu_backward %matplotlib inline plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['imag...
darkrun95/Applied-Data-Science
Applied Plotting in Python/Week 2/.ipynb_checkpoints/Week 2 - course-checkpoint.ipynb
gpl-3.0
%matplotlib notebook import matplotlib as mpl mpl.get_backend() import matplotlib.pyplot as plt plt.plot? # because the default is the line style '-', # nothing will be shown if we only pass in one point (3,2) plt.plot(3, 2) # we can pass in '.' to plt.plot to indicate that we want # the point (3,2) to be indicate...
TheMitchWorksPro/DataTech_Playground
PY_Basics/TMWP_PerfTesting_w_time_magics_JupyterNBs.ipynb
mit
def myFun(x): return (x**x)**x myFun(9) """ Explanation: <div align="right">Python 3.6 [conda env: PY36]</div> Performance Testing in iPython/Jupyter NBs The timeit() command appears to have strict limitations in how you can use it within a Jupyter Notebook. For it to work most effectively: - organize the code ...
ledeprogram/algorithms
class7/donow/najmabadi_shannon_7_donow.ipynb
gpl-3.0
import pandas as pd %matplotlib inline import numpy as np from sklearn.linear_model import LogisticRegression """ Explanation: Apply logistic regression to categorize whether a county had high mortality rate due to contamination 1. Import the necessary packages to read in the data, plot, and create a logistic regressi...
AdamD94/CompPhysLab
Steppers.ipynb
mit
#Solves an equation of the form dy/dt=f(y,t) using the Euler method #f is the function which returns the derivative of the state vector of the system #y0 is the initial state of the system #t is an array of times at which f will be evaluated def Euler(f, y0, t, args=()): n = len(t) #Find number ...
claudiuskerth/PhDthesis
Data_analysis/SNP-indel-calling/BAM/Big_Data.ipynb
mit
import os !ls """ Explanation: List files in current working directory: End of explanation """ if not os.path.exists("ery_30-15.sorted.cov.gz"): try: # 'call' is from the subprocess module retcode = os.system("bamtools coverage -in ery_30-15.sorted.bam | gzip > ery_30-15.sorted.cov.gz") ...
albangaignard/BioLinkedData-HandsOn
petitDej_LOD.ipynb
mit
from SPARQLWrapper import SPARQLWrapper, JSON, XML # Set SPARQL endpoint endpoint = "http://www.ebi.ac.uk/rdf/services/ensembl/sparql" sparql = SPARQLWrapper(endpoint) # Set prefix prefix = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dcte...
planet-os/notebooks
api-examples/ERA5_tutorial.ipynb
mit
# Initialize notebook environment. %matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import warnings warnings.filterwarnings("ignore") # Import Planet OS API from API_client.python.datahub import datahub_main from API_client.python.lib.dataset import dataset from API_client.pyth...
dereneaton/ipyrad
newdocs/API-analysis/cookbook-raxml.ipynb
gpl-3.0
# conda install ipyrad -c bioconda # conda install raxml -c bioconda # conda install toytree -c eaton-lab import ipyrad.analysis as ipa import toytree """ Explanation: <span style="color:gray">ipyrad-analysis toolkit:</span> RAxML RAxML is the most popular tool for inferring phylogenetic trees using maximum likelihoo...
davebshow/projx
ipython-graphs.ipynb
mit
%matplotlib inline %load_ext cypher import asyncio import networkx as nx import pandas as pd import projx as px import matplotlib.pyplot as plt from datetime import datetime from gizmo import AsyncGremlinClient plt.rcParams['figure.figsize'] = 12, 7 """ Explanation: IPython Graphs This notebook uses: Neo4j 2.1.6, Ti...
echohenry2006/tvb-library
tvb/simulator/demos/region_stochastic_jansen.ipynb
gpl-2.0
from tvb.simulator.lab import * """ Explanation: Single node dynamics using the Jansen and Rit model. White noise is added to one specific state variable to emulate the external stochastic stimulus p(t) as described in [JansenRit_1995] End of explanation """ LOG.info("Configuring...") #Initialise a Model, Coupling,...
mne-tools/mne-tools.github.io
0.19/_downloads/2ef14e30f2307383fca298e63d57a535/spm_faces_dataset.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.datasets import spm_face from mne.preprocessing import ICA, create_eog_epochs from mne import io, combine_evoked from mne.mi...
phoebe-project/phoebe2-docs
2.0/tutorials/compute.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" """ Explanation: Compute Now that we have datasets added to our Bundle, our next step is to run the forward model and compute a synthetic model for each of these datasets. Setup Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line i...
sods/ods
notebooks/pods/datasets/mauna-loa.ipynb
bsd-3-clause
import pods import pylab as plt %matplotlib inline data = pods.datasets.mauna_loa() """ Explanation: Datasets: Downloading Data from the Mauna Loa Observatory Open Data Science Initiative 28th May 2014 Neil D. Lawrence This data set collection is from the Mauna Loa observatory which records atmospheric carbon levels...
alansaul/ods
notebooks/pods/datasets/mauna_loa.ipynb
bsd-3-clause
import pods import pylab as plt %matplotlib inline data = pods.datasets.mauna_loa() """ Explanation: Datasets: Downloading Data from the Mauna Loa Observatory Open Data Science Initiative 28th May 2014 Neil D. Lawrence This data set collection is from the Mauna Loa observatory which records atmospheric carbon levels...
neuro-ml/reskit
tutorials/3. Transformers Guide.ipynb
bsd-3-clause
import numpy as np from reskit.normalizations import mean_norm from reskit.core import MatrixTransformer matrix_0 = np.random.rand(5, 5) matrix_1 = np.random.rand(5, 5) matrix_2 = np.random.rand(5, 5) y = np.array([0, 0, 1]) X = np.array([matrix_0, matrix_1, matrix_2]) output = np.array(...
pegasus-isi/pegasus
tutorial/docker/notebooks/01-Introduction-API/01-Introduction-API.ipynb
apache-2.0
from Pegasus.api import * """ Explanation: Pegasus Tutorial Welcome to the Pegasus tutorial notebook, which is intended for new users who want to get a quick overview of Pegasus concepts and usage. This tutorial covers: Using the Pegasus API to generate an abstract workflow Using the API to plan the abstract workflow...
mne-tools/mne-tools.github.io
dev/_downloads/06371e7a69d2c0314dea0a4363315ef2/css.ipynb
bsd-3-clause
# Author: John G Samuelsson <johnsam@mit.edu> import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.simulation import simulate_sparse_stc, simulate_evoked """ Explanation: Cortical Signal Suppression (CSS) for removal of cortical signals This script shows an example o...
jphall663/GWU_data_mining
09_matrix_factorization/src/py_part_9_kaggle_GLRM_example.ipynb
apache-2.0
import h2o from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator from h2o.estimators.glm import H2OGeneralizedLinearEstimator from h2o.grid.grid_search import H2OGridSearch h2o.init(max_mem_size='12G') # give h2o as much memory as possible h2o.no_progress() # turn off h2o progress bars import matplotlib as p...
BrainIntensive/OnlineBrainIntensive
resources/matplotlib/AnatomyOfMatPlotLib/AnatomyOfMatplotlib-Part4-Limits_Legends_and_Layouts.ipynb
mit
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=plt.figaspect(0.5)) ax1.plot([-10, -5, 0, 5, 10, 15], [-1.2, 2, 3.5, -0.3, -4, 1]) ax2.scatter([-10, -5, 0, 5, 10, 15], [-1.2, 2, 3.5, -0.3, -4, 1]) plt.show() """ Explanation: Limits, Legends, and Layouts In this section, we'll focus on what happens around th...
science-of-imagination/nengo-buffer
Project/mental_translation_training.ipynb
gpl-3.0
import matplotlib.pyplot as plt %matplotlib inline import nengo import numpy as np import scipy.ndimage import matplotlib.animation as animation from matplotlib import pylab from PIL import Image import nengo.spa as spa import cPickle import random from nengo_extras.data import load_mnist from nengo_extras.vision impo...
theideasmith/theideasmith.github.io
_notebooks/Electricity/electricity.ipynb
mit
import numpy as np import numpy.ma as ma from scipy.integrate import odeint mag = lambda r: np.sqrt(np.sum(np.power(r, 2))) def g(y, t, q, m, n,d, k): """ n: the number of particles d: the number of dimensions (for fun's sake I want this to work for k-dimensional systems) y: an (n*2,d) di...
Aniruddha-Tapas/Applied-Machine-Learning
Classification/Logistic Regression for Banknote Authentication.ipynb
mit
import numpy as np import pandas as pd # read .csv from provided dataset csv_filename="data_banknote_authentication.txt" # We assign the collumn names ourselves and load the data in a Pandas Dataframe df=pd.read_csv(csv_filename,names=["Variance","Skewness","Curtosis","Entropy","Class"]) """ Explanation: Logistic Re...
tylere/docker-tmpnb-ee
notebooks/1 - IPython Notebook Examples/IPython Project Examples/IPython Kernel/Trapezoid Rule.ipynb
apache-2.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt def f(x): return (x-3)*(x-5)*(x-7)+85 x = np.linspace(0, 10, 200) y = f(x) """ Explanation: Basic Numerical Integration: the Trapezoid Rule A simple illustration of the trapezoid rule for definite integration: $$ \int_{a}^{b} f(x)\, dx \approx...
swirlingsand/deep-learning-foundations
rnns/embeddings/Skip-Gram_word2vec.ipynb
mit
import time import numpy as np import tensorflow as tf import utils """ Explanation: Skip-gram word2vec In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p...
pysg/pyther
Modelo de impregnacion/modelo2/Activité 10_Viernes_Revisión3-checkpoint.ipynb
mit
import numpy as np from scipy import integrate from matplotlib.pylab import * """ Explanation: Evaluation des modèles pour l'extraction supercritique L'extraction supercritique est de plus en plus utilisée afin de retirer des matières organiques de différents liquides ou matrices solides. Cela est dû au fait que les f...
tensorflow/docs
site/en/guide/migrate/sessionrunhook_callback.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-3/cmip6/models/sandbox-3/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-3', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: TEST-INSTITUTE-3 Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topic...
liganega/Gongsu-DataSci
previous/y2017/GongSu02_Anaconda_Installation.ipynb
gpl-3.0
a = 2 b = 3 a + b """ Explanation: 아나콘다(Anaconda) 소개 수정 사항 파이썬3 이용 아나콘다 팩키지 설치 이미지 업데이트 필요 아나콘다 패키지 소개 파이썬 프로그래밍 언어 개발환경 파이썬 기본 패키지 이외에 데이터분석용 필수 패키지 포함 기본적으로 스파이더 에디터를 활용하여 강의 진행 아나콘다 패키지 다운로드 아나콘다 패키지를 다운로드 하려면 아래 사이트를 방문한다 https://www.anaconda.com/download/ 이후 아래 그림을 참조하여 다운받는다. 주의: 강의에서는 파이썬 3 최신 버전을 사용한다....
amueller/odsc-masterclass-2017-morning
notebooks/00 - Data Loading.ipynb
mit
from sklearn.datasets import load_digits import numpy as np digits = load_digits() digits.keys() digits.data.shape digits.data.shape digits.target.shape digits.target np.bincount(digits.target) import matplotlib.pyplot as plt %matplotlib inline # %matplotlib notebook <- interactive interface plt.matshow(digits.d...
tien-le/uranus
Importing Notebooks.ipynb
mit
import io, os, sys, types from IPython import get_ipython from nbformat import read from IPython.core.interactiveshell import InteractiveShell """ Explanation: Importing Jupyter Notebooks as Modules It is a common problem that people want to import code from Jupyter Notebooks. This is made difficult by the fact that ...
Kaggle/learntools
notebooks/geospatial/raw/tut5.ipynb
apache-2.0
#$HIDE_INPUT$ import folium from folium import Marker, GeoJson from folium.plugins import HeatMap import pandas as pd import geopandas as gpd """ Explanation: Introduction In this tutorial, you'll explore several techniques for proximity analysis. In particular, you'll learn how to do such things as: - measure the d...
prideloki/til-arima-online-retail
online-retail-ARIMA.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt import warnings import itertools import operator import statsmodels.api as sm online_retail = pd.read_excel('data/Online Retail.xlsx') online_retail.describe() online_retail.head() online_retail['InvoiceDate'] = online_retail['InvoiceDate'].ast...
tensorflow/docs-l10n
site/es-419/guide/checkpoint.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...
probml/pyprobml
notebooks/book1/20/word_analogies_jax.ipynb
mit
import jax import jax.numpy as jnp import requests import zipfile import hashlib import os # Required functions def download(name, cache_dir=os.path.join("..", "data")): """Download a file inserted into DATA_HUB, return the local filename.""" assert name in DATA_HUB, f"{name} does not exist in {DATA_HUB}." ...
CrowdTruth/CrowdTruth-core
tutorial/notebooks/.ipynb_checkpoints/Multiple Choice Task - Relation Extraction-checkpoint.ipynb
apache-2.0
import pandas as pd test_data = pd.read_csv("../data/relex-multiple-choice.csv") test_data.head() """ Explanation: CrowdTruth for Multiple Choice Tasks: Relation Extraction In this tutorial, we will apply CrowdTruth metrics to a multiple choice crowdsourcing task for Relation Extraction from sentences. The workers we...
4dsolutions/Python5
OverviewNotes_PYTDS_3.ipynb
mit
import numpy as np from sklearn.datasets import load_digits digits = load_digits() print(digits.data.shape) print(digits.DESCR) import matplotlib.pyplot as plt % matplotlib inline plt.gray() # gray reversed shown below _ = plt.matshow(digits.images[0]) """ Explanation: PYT-DS SAISOFT Overview 1 Overview 2 <a d...
obestwalter/obestwalter.github.io
content/articles/python-is-made-of-star-stuff/python-is-made-of-star-stuff.ipynb
mit
# Yes. The code makes no sense. Thanks for pointing it out. from os import * def append(*, end=linesep): def _append(function): def star_reporter(*args, **kwargs): print(*args, **kwargs, end=end) return function(*args, **kwargs) return star_reporter return _append @app...
mimoralea/applied-reinforcement-learning
notebooks/solutions/02-dynamic-programming.ipynb
mit
def fib(n): if n < 2: return n return fib(n-2) + fib(n-1) %time fib(30) """ Explanation: Recursion, Memoization and Dynamic Programming Remember how we talk about using recursion and dynamic programming. One interesting thing to do is to implement the solution to a common problem called Fibonnaci numb...
fotis007/python_intermediate
Python_2_10.ipynb
gpl-3.0
text = """Als der Abend herbeikam und die Freunde in einer weitumherschauenden Laube saßen, trat eine ansehnliche Figur auf die Schwelle, welche unser Freund sogleich für den Barbier von heute früh erkannte. Auf einen tiefen, stummen Bückling des Mannes erwiderte Lenardo: Ihr kommt, wie immer, sehr gelegen und werdet n...
ML4DS/ML4all
C1.Intro_Classification/Intro_Classification_professor.ipynb
mit
# To visualize plots in the notebook %matplotlib inline # Import some libraries that will be necessary for working with data and displaying plots import csv # To read csv files import random import matplotlib.pyplot as plt import numpy as np from scipy import spatial from sklearn import neighbors, datasets """ E...
jan-rybizki/Chempy
tutorials/4-Simple_stellar_population.ipynb
mit
%pylab inline # Chempy has to be called from within the /source directory. We load the default parameters from Chempy.parameter import ModelParameters a = ModelParameters() """ Explanation: Simple Stellar Population (SSP) Here we will explain the central routine of Chempy. The observational counterpart of an SSP is ...
mne-tools/mne-tools.github.io
dev/_downloads/9f8cb3957705df93f5da4fe6dc1bc69b/fnirs_artifact_removal.ipynb
bsd-3-clause
# Authors: Robert Luke <mail@robertluke.net> # # License: BSD-3-Clause import os import mne from mne.preprocessing.nirs import (optical_density, temporal_derivative_distribution_repair) """ Explanation: Visualise NIRS artifact correction methods Here we artificially introduce seve...
landlab/landlab
notebooks/tutorials/hillslope_geomorphology/depth_dependent_taylor_diffuser/depth_dependent_taylor_diffuser.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from landlab import RasterModelGrid from landlab.components import DepthDependentTaylorDiffuser """ Explanation: <a href="http://landlab.github.io"><img style="float: left" src="../../../landlab_header.png"></a> Component Overview: DepthDependentTaylorDiffuser <hr> <s...
statsmodels/statsmodels.github.io
v0.13.1/examples/notebooks/generated/statespace_tvpvar_mcmc_cfa.ipynb
bsd-3-clause
%matplotlib inline from importlib import reload import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from scipy.stats import invwishart, invgamma # Get the macro dataset dta = sm.datasets.macrodata.load_pandas().data dta.index = pd.date_range('1959Q1', '2009Q3', freq='Q...
dtamayo/MachineLearning
Day4/How HDBSCAN Works.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import sklearn.datasets as data %matplotlib inline sns.set_context('poster') sns.set_style('white') sns.set_color_codes() plot_kwds = {'alpha' : 0.5, 's' : 80, 'linewidths':0} """ Explanation: How HDBSCAN Works HDBSCAN is a clustering algorithm d...
mne-tools/mne-tools.github.io
0.19/_downloads/30d3f995eaa317ef564a8fb6d72c22bf/plot_left_cerebellum_volume_source.ipynb
bsd-3-clause
# Author: Alan Leggitt <alan.leggitt@ucsf.edu> # # License: BSD (3-clause) import mne from mne import setup_source_space, setup_volume_source_space from mne.datasets import sample print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' subject = 'sample' aseg_fname = subjects_dir + '/sam...
NeuPhysics/aNN
ipynb/vacuum.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...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-veg/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-veg', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-VEG Topic: Ocean Sub-Top...
marksibrahim/musings
notebooks/A Neural Network Classifier using Keras.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegressionCV from sklearn import datasets from keras.models import Sequential from keras.layers.core import Den...
bgruening/EDeN
examples/graph_format.ipynb
gpl-3.0
%matplotlib inline import pylab as plt import networkx as nx G=nx.Graph() G.add_node(0, label='A') G.add_node(1, label='B') G.add_node(2, label='C') G.add_edge(0,1, label='x') G.add_edge(1,2, label='y') G.add_edge(2,0, label='z') from eden.util import display print display.serialize_graph(G) from eden.util import d...
ES-DOC/esdoc-jupyterhub
notebooks/cccma/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cccma', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: CCCMA Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Con...
wesleybowman/UTide
notebooks/utide_real_data_example.ipynb
mit
with open("can1998.dtf") as f: lines = f.readlines() print("".join(lines[:5])) """ Explanation: Look at the data file to see what structure it has. End of explanation """ names = ["seconds", "year", "month", "day", "hour", "elev", "flag"] obs = pd.read_csv( "can1998.dtf", names=names, skipinitialsp...
zlpure/CS231n
assignment1/knn.ipynb
mit
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplotlib inline plt.rcParams['figure.figsize'] = (10....
jna29/SymGP
symgp/notebooks/CCA.ipynb
mit
from symgp import * from sympy import * from IPython.display import display, Math, Latex """ Explanation: Canonical Correlation Analysis (CCA) Example is taken from Section 12.5.3, Machine Learning: A Probabilistic Perspective by Kevin Murphy. End of explanation """ # Shapes D_x, D_y, L_o, L_x, L_y = symbols('D_x, ...
tensorflow/docs-l10n
site/en-snapshot/addons/tutorials/layers_weightnormalization.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 # 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 License is d...
Featuretools/featuretools
docs/source/resources/frequently_asked_questions.ipynb
bsd-3-clause
import featuretools as ft import pandas as pd import numpy as np import woodwork as ww """ Explanation: Frequently Asked Questions Here we are attempting to answer some commonly asked questions that appear on Github, and Stack Overflow. End of explanation """ es = ft.demo.load_mock_customer(return_entityset=True) es...
mne-tools/mne-tools.github.io
0.20/_downloads/03c9d71de135994dbf45db72856a1f9a/plot_mne_inverse_envelope_correlation.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # Sheraz Khan <sheraz@khansheraz.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne.connectivity import envelope_correlation from mn...
bsautermeister/tensorlight
examples/datasets-test.ipynb
mit
# Force matplotlib to use inline rendering %matplotlib inline import os import sys import time # add path to libraries for ipython sys.path.append(os.path.expanduser("~/libs")) import numpy as np import tensorflow as tf import tensorlight as light DATA_ROOT = "data" TRAIN_DIR = "train-test/datasets" def write_anim...
stijnvanhoey/course_gis_scripting
notebooks/02-scientific-python-introduction.ipynb
bsd-3-clause
import matplotlib.pyplot as plt %matplotlib inline plt.style.use('seaborn-white') """ Explanation: <p><font size="6"><b>Scientific Python essentials</b></font></p> Introduction to GIS scripting May, 2017 © 2017, Stijn Van Hoey (&#115;&#116;&#105;&#106;&#110;&#118;&#97;&#110;&#104;&#111;&#101;&#121;&#64;&#103;&#109;&...
vinhqdang/my_mooc
coursera/python_data_analysis_spec/1_intro_python_data_science/week2_basic_pandas/Assignment2.ipynb
mit
import pandas as pd df = pd.read_csv('olympics.csv', index_col=0, skiprows=1) for col in df.columns: if col[:2]=='01': df.rename(columns={col:'Gold'+col[4:]}, inplace=True) if col[:2]=='02': df.rename(columns={col:'Silver'+col[4:]}, inplace=True) if col[:2]=='03': df.rename(columns...
ray-project/ray
doc/source/ray-air/examples/feast_example.ipynb
apache-2.0
# !pip install feast==0.20.1 ray[air]>=1.13 xgboost_ray """ Explanation: Integrate Ray AIR with Feast feature store End of explanation """ import os WORKING_DIR = os.path.expanduser("~/ray-air-feast-example/") %env WORKING_DIR=$WORKING_DIR ! mkdir -p $WORKING_DIR ! wget --no-check-certificate https://github.com/ray...
jsvine/pdfplumber
examples/notebooks/extract-table-nics.ipynb
mit
import pdfplumber print(pdfplumber.__version__) """ Explanation: Demonstration of pdfplumber's table-extraction options This notebook uses a report from the FBI's National Instant Criminal Background Check System. Import pdfplumber End of explanation """ pdf = pdfplumber.open("../pdfs/background-checks.pdf") """ Ex...
mne-tools/mne-tools.github.io
stable/_downloads/7a4ee69e8136370345a316ee3b2e2187/publication_figure.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # Daniel McCloy <dan.mccloy@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD-3-Clause """ Explanation: Make figures more publication ready In this example, we show several use cases to take MNE plots and customize them for ...
MVerbakel/statistical_review
Examples/Initial_analysis_example.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt # Local packages import stats # Set up formatting pd.set_option('display.float_format', lambda x: '%.3f' % x) plt.style.use('ggplot') # Load data example_df = pd.read_csv('bank.csv', na_values=[np.nan]) # Print high-level summary of the data fra...
kgrodzicki/machine-learning-specialization
course-2-regression/notebooks/week-4-ridge-regression-assignment-2-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 4: Ridge Regression (gradient descent) In this notebook, you will implement ridge regression via gradient descent. You will: * Convert an SFrame into a Numpy array * Write a Numpy function to compute the derivative of the regression weights with respect to a single feat...
cajal/pipeline
python/example/how_to_fill_proxmity_cell_match.ipynb
lgpl-3.0
from pipeline import meso """ Explanation: In this notebook, I briefly demonstrate the use of ProximityCellMatch and BestProximityCellMatch tables in meso End of explanation """ source_scan = dict(animal_id=25133, session=3, scan_idx=11) target_scan = dict(animal_id=25133, session=4, scan_idx=13) """ Explanation: ...
eflegara/NetStruc
.ipynb_checkpoints/6. Community Detection-checkpoint.ipynb
mit
try: ## For Network Analysis and Visualization import networkx as nx import numpy as np import matplotlib.pyplot as plt %matplotlib inline from collections import defaultdict import operator ## For Hierarchical Clustering from scipy.cluster import hierarchy from scipy.spatial im...
walkon302/CDIPS_Recommender
notebooks/.ipynb_checkpoints/Create_Datasets_for_Evaluation-checkpoint.ipynb
apache-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline # get data user_profile = pd.read_csv('../data_user_view_buy/user_profile.csv',sep='\t',header=None) user_profile.columns = ['user_id','buy_spu','buy_sn','buy_ct3','view_spu','view_sn','view_ct3','time_interval','view_cnt','view_...
kit-cel/wt
wt/vorlesung/ch7_9/white_noise.ipynb
gpl-2.0
# importing import numpy as np import matplotlib.pyplot as plt import matplotlib # showing figures inline %matplotlib inline # plotting options font = {'size' : 20} plt.rc('font', **font) plt.rc('text', usetex=True) matplotlib.rc('figure', figsize=(18, 6) ) """ Explanation: Content and Objective Simulate (disc...
duetosymmetry/slimplectic
Damped_Oscillator_SlimplecticGGLvsRK.ipynb
mit
%matplotlib inline from __future__ import print_function import numpy as np, matplotlib.pyplot as plt import slimplectic # Set harmonic oscillator parameters m = 1.0 k = 1.0 ll = 1e-4*np.sqrt(m*k) # ll is $\lambda$ in the paper """ Explanation: Simple damped harmonic oscillator This example notebook characterizes th...
magne-max/zipline-ja
docs/notebooks/tutorial.ipynb
apache-2.0
!tail ../../zipline/examples/buyapple.py """ Explanation: Zipline beginner tutorial Basics Zipline is an open-source algorithmic trading simulator written in Python. The source can be found at: https://github.com/quantopian/zipline Some benefits include: Realistic: slippage, transaction costs, order delays. Stream-ba...
nimagh/CNN_Implementations
Notebooks/DCGAN.ipynb
gpl-3.0
# Imports %reload_ext autoreload %autoreload 1 import os, sys sys.path.append('../') sys.path.append('../common') from tools_general import tf, np from IPython.display import Image from tools_train import get_train_params, OneHot, vis_square import imageio # define parameters networktype = 'DCGAN_MNIST' work_dir = ...
ronnydw/data-science-projects
class-central-survey-2016-17/Newbees vs Experienced MOOCers.ipynb
mit
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt sns.set(style="white") sns.set_context("talk") """ Explanation: Class Central Survey: compare target group 'Newbees' with 'Experienced' respondents Newbees = respondents that haven't finished a MOOC yet Experienced = respondents having finished ...
DS-100/sp17-materials
sp17/labs/lab07/lab07.ipynb
gpl-3.0
# Run this cell to set up the notebook. import numpy as np import pandas as pd import seaborn as sns import scipy as sci import matplotlib %matplotlib inline import matplotlib.pyplot as plt from matplotlib import patches, cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from mpl_toolkits.mplot3d impo...
phungkh/phys202-2015-work
assignments/assignment07/AlgorithmsEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import seaborn as sns import numpy as np """ Explanation: Algorithms Exercise 2 Imports End of explanation """ def find_peaks(a): """Find the indices of the local maxima in a sequence.""" b=[] count=0 while count<(len(a)): # wh...
vvishwa/deep-learning
autoencoder/Simple_Autoencoder.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...
sebastiandres/mat281
laboratorios/lab04-Clustering/Kmeans.ipynb
cc0-1.0
# Configuracion para recargar módulos y librerías %reload_ext autoreload %autoreload 2 %matplotlib inline from IPython.core.display import HTML HTML(open("style/mat281.css", "r").read()) from mat281_code.lab import greetings alumno_1 = ("Sebastian Flores", "2004001-7") alumno_2 = ("Maria Jose Vargas", "2004007-8")...
giacomov/3ML
docs/notebooks/custom_plugins.ipynb
bsd-3-clause
class PluginPrototype(object): __metaclass__ = abc.ABCMeta def __init__(self, name, nuisance_parameters): assert is_valid_variable_name(name), "The name %s cannot be used as a name. You need to use a valid " \ "python identifier: no spaces, cannot start with...
jqug/microscopy-object-detection
CNN training & evaluation - plasmodium (motic).ipynb
mit
N_samples_to_display = 10 pos_indices = np.where(test_y)[0] pos_indices = pos_indices[np.random.permutation(len(pos_indices))] for i in range(N_samples_to_display): plt.subplot(2,N_samples_to_display,i+1) example_pos = test_X[pos_indices[i],:,:,:] example_pos = np.swapaxes(example_pos,0,2) plt.imshow(ex...
HUDataScience/StatisticalMethods2016
notebooks/Exo7_StepFit_CepheidCase.ipynb
apache-2.0
# No annoying warnings import warnings warnings.filterwarnings('ignore') # == Basic import == # # plot within the notebook %matplotlib inline import numpy as np import matplotlib.pyplot as mpl """ Explanation: Fit a Step – Exercise 7 Based on the Intrinsic Dispersion fitting class you created last week create a new c...
orlox/binary_tools
binary/notebooks/kicks.ipynb
gpl-3.0
from binary_tools.binary.kicks import* from binary_tools.binary.tests.test_kicks import* from binary_tools.binary.orbits import* from binary_tools.binary.tests.run_tests import* """ Explanation: Utils Functions and Tests End of explanation """ phi = rand_phi() """ Explanation: kicks The kicks file contains a series...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_covariance_whitening_dspm.ipynb
bsd-3-clause
# Author: Denis A. Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io from mne.datasets import spm_face from mne.minimum_norm import apply_inverse, make_inverse_operator from mne.cov import compute_covariance print(__doc__)...
metpy/MetPy
dev/_downloads/62a1acd718d4c5b9717787544d4cf09f/Gradient.ipynb
bsd-3-clause
import numpy as np import metpy.calc as mpcalc from metpy.units import units """ Explanation: Gradient Use metpy.calc.gradient. This example demonstrates the various ways that MetPy's gradient function can be utilized. End of explanation """ data = np.array([[23, 24, 23], [25, 26, 25], ...
jfconavarrete/spts-uoe
preprocessing_weather_readings.ipynb
gpl-3.0
%matplotlib inline import logging import itertools import json import os import pickle import urllib2 import folium import time import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from datetime import datetime from os import listdir fro...
bashtage/statsmodels
examples/notebooks/interactions_anova.ipynb
bsd-3-clause
%matplotlib inline from urllib.request import urlopen import numpy as np np.set_printoptions(precision=4, suppress=True) import pandas as pd pd.set_option("display.width", 100) import matplotlib.pyplot as plt from statsmodels.formula.api import ols from statsmodels.graphics.api import interaction_plot, abline_plot ...
snowch/biginsight-examples
misc/SparkOnBluemix.ipynb
apache-2.0
cluster = '10451' # E.g. 10000 username = 'biadmin' # E.g. biadmin password = '' # Please request password from chris.snow@uk.ibm.com table = 'biadmin.rowapplyout' # BigSQL table to query """ Explanation: This spark notebook connects to BigInsights on Cloud using BigSQL. This notebook runs succesf...
vicente-gonzalez-ruiz/YAPT
02-basics/30-profiling.ipynb
cc0-1.0
? """ Explanation: Profiling IPython Interactive Python provides some Built-in magic commands that can help up when developing code. ? IPython's help. End of explanation """ %quickref """ Explanation: %quickref Quick reference. End of explanation """ help """ Explanation: help Python’s own help system. End of ex...
tensorflow/docs-l10n
site/ko/io/tutorials/prometheus.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...
fweik/espresso
doc/tutorials/lattice_boltzmann/lattice_boltzmann_part4.ipynb
gpl-3.0
import logging import sys import matplotlib.pyplot as plt import numpy as np import espressomd import espressomd.lb import espressomd.lbboundaries import espressomd.shapes logging.basicConfig(level=logging.INFO, stream=sys.stdout) espressomd.assert_features(['LB_BOUNDARIES_GPU']) # System constants BOX_L = 16.0 TI...
eco32i/biodata
sessions/05 - Python.ipynb
mit
import this """ Explanation: Python Dynamically typed language created by Guido van Rossum (BDFL) in mid-90. code blocks are defined by INDENTATION everything is an object everything is a reference first class functions garbage collected batteries included OBJECT: A data structure that holds (encapsulates) both dat...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/ukesm1-0-ll/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-ll', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: MOHC Source ID: UKESM1-0-LL Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, ...
datosgobar/pydatajson
samples/caso-uso-3-pydatajson-xlsx-justicia-valido.ipynb
mit
from pydatajson import DataJson #lib y clase from pydatajson.pydatajson import read_catalog # lib, modulo ... metodo Lle el catalogo -json o xlsx o (local o url) dicc- y lo transforma en un diccionario de python from pydatajson.xlsx_to_json import write_json_catalog import arrow """ Explanation: Caso de uso 3 - Valida...
shngli/Data-Mining-Python
Basic Algorithms.ipynb
gpl-3.0
def combinations(string): if len(string) == 1: return set([string, '']) result = set() for i in range(len(string)): for com in combinations(string[:i] + string[(i+1):]): result.add(''.join(sorted(com))) result.add(''.join(sorted(com + string[i]))) return result ...
griffinfoster/fundamentals_of_interferometry
6_Deconvolution/6_2_clean.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary 6. Deconvolution in Imaging Previous: 6.1 Sky Models Next: 6.3 CLEAN Implementations Import standard modules: End of explanati...
briennakh/BIOF509
Wk08/Wk08_Numpy_model_package_survey.ipynb
mit
import matplotlib.pyplot as plt import numpy as np %matplotlib inline n = 20 x = np.random.random((n,1)) y = 5 + 6 * x ** 2 + np.random.normal(0,0.5, size=(n,1)) plt.plot(x, y, 'b.') plt.show() """ Explanation: Week 8 - Implementing a model in numpy and a survey of machine learning packages for python This week we...
codefordc/opendatadc
docs/analyses/anc/scripts/anc_elections.ipynb
agpl-3.0
dc_2012 = pd.read_csv('Data/November_6_2012_General_and_Special_Election_Certified_Results.csv') dc_2014 = pd.read_csv('Data/November_4_2014_General_Election_Certified_Results.csv') dc_2016 = pd.read_csv('Data/November_4_2014_General_Election_Certified_Results.csv') dc_2018 = pd.read_csv('Data/November_6_2018_General_E...
beangoben/HistoriaDatos_Higgs
Dia3/7_Machine_Learning_Intro.ipynb
gpl-2.0
def grafica_KMeans(X1,X2,Y,clf): X1=X[:, 0] X2=X[:, 1] # Plot the decision boundary. For that, we will assign a color to each x_min, x_max = X1.min()-1, X1.max() +1 y_min, y_max = X2.min()-1, X2.max() +1 xx, yy = np.meshgrid(np.linspace(x_min, x_max, 200), np.linspace(y_min, y_max, 200)) # ...
asydorchuk/ml
classes/cs231n/assignment2/Dropout.ipynb
mit
# As usual, a bit of setup import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solver import Solver %matplotlib inline ...