repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
asydorchuk/ml
classes/cs231n/assignment2/ConvolutionalNetworks.ipynb
mit
# As usual, a bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.cnn import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient from cs231n.layers import * from cs231n.fast_layers import * from cs...
tpin3694/tpin3694.github.io
python/filter_dataframes.ipynb
mit
import pandas as pd """ Explanation: Title: Filter pandas Dataframes Slug: filter_dataframes Summary: Filter pandas Dataframes Date: 2016-05-01 12:00 Category: Python Tags: Data Wrangling Authors: Chris Albon Import modules End of explanation """ data = {'name': ['Jason', 'Molly', 'Tina', 'Jake', 'Amy'], ...
mathnathan/notebooks
dissertation/Single Gaussian.ipynb
mit
a = -0.7 j_vals = [] kl_vals = [] mus = np.linspace(0,1,100) for mu in mus: j_vals.append(J(mu,p_sig,a)[0]) kl_vals.append(KL(mu,p_sig)[0]) fig = plt.figure(figsize=(15,5)) p_vals = p(mus) plt.plot(mus, p_vals/p_vals.max(), label="$p(x)$") #plt.plot(mus, j_vals/np.max(np.abs(j_vals)), label='$J$') plt.plot(mus,...
martinjrobins/hobo
examples/interfaces/automatic-differentiation-using-autograd.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import warnings from timeit import repeat import pints import pints.toy as toy import autograd.numpy as np from autograd.scipy.integrate import odeint from autograd.builtins import tuple from autograd import grad """ Explanation: Using autograd to calculate the gra...
phoebe-project/phoebe2-docs
2.0/examples/sun.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" """ Explanation: Sun (single rotating star) Setup Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of explanation """ %matplotlib i...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Collections Module-checkpoint.ipynb
apache-2.0
from collections import Counter """ Explanation: Collections Module The collections module is a built-in module that implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers. We've already gone over the basics: dict, list, set, and tuple. Now we'll learn about t...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_home/2020_regex.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: Tech - expressions régulières Les expressions régulières sont utilisées pour rechercher des motifs dans un texte tel que des mots, des dates, des nombres... End of explanation """ poeme = """ A noir, E blanc, I rouge, U vert, O bleu, vo...
southpaw94/MachineLearning
TextExamples/3547_02_Code.ipynb
gpl-2.0
%load_ext watermark %watermark -a 'Sebastian Raschka' -u -d -v -p numpy,pandas,matplotlib # 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 Essentials Chapter 2 ...
jrbourbeau/cr-composition
notebooks/legacy/parameter-tuning/RF-parameter-tuning.ipynb
mit
import sys sys.path.append('/home/jbourbeau/cr-composition') print('Added to PYTHONPATH') from __future__ import division, print_function import argparse from collections import defaultdict import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import seabor...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_stats_cluster_time_frequency_repeated_measures_anova.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.sta...
statsmodels/statsmodels.github.io
v0.13.2/examples/notebooks/generated/deterministics.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pandas as pd plt.rc("figure", figsize=(16, 9)) plt.rc("font", size=16) """ Explanation: Deterministic Terms in Time Series Models End of explanation """ from statsmodels.tsa.deterministic import DeterministicProcess index = pd.RangeIndex(0, 100) det_proc = ...
gojomo/gensim
docs/notebooks/soft_cosine_tutorial.ipynb
lgpl-2.1
# Initialize logging. import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) """ Explanation: Finding similar documents with Word2Vec and Soft Cosine Measure Soft Cosine Measure (SCM) [1, 3] is a promising new tool in machine learning that allows us to submit a quer...
usantamaria/iwi131
ipynb/15-FuncionesAvanzadas/FuncionesAvanzadas.ipynb
cc0-1.0
from math import exp, cos, pi, sin from random import randrange, choice from turtle import * # Evitar print exp(5.5) print cos(pi / 2) print randrange(10) print choice(['Lunes', 'Martes', 'Viernes']) """ Explanation: <header class="w3-container w3-teal"> <img src="images/utfsm.png" alt="" align="left"/> <img src="ima...
deeplook/notebooks
color_scheme_3d/visualising_color_schemes_3d.ipynb
mit
from collections import OrderedDict # values entered manually from https://brandlive.here.com/colors here_primary_cols = OrderedDict( HERE_Aqua = '#48dad0', HERE_Aqua_UNKNOWN = '#00908a', # unknown status, maybe an error? HERE_Aqua_Dark = '#00afaa', HERE_Aqua_75 = '#76e3dc', HERE_Aq...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch9-Problem_9-09.ipynb
unlicense
%pylab notebook """ Explanation: Excercises Electric Machinery Fundamentals Chapter 9 Problem 9-9 End of explanation """ p = 12 n_m = 600 # [r/min] """ Explanation: Description How many pulses per second must be supplied to the control unit of the motor in Problem 9-8 to achieve a rotational speed of 600 r/min?...
oldtopos/SDCND_Project1
P1.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...
xunilrj/sandbox
courses/MITx/MITx 6.86x Machine Learning with Python-From Linear Models to Deep Learning/SVM%20-%20PyTorch.ipynb
apache-2.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt X = np.array([[0,0],[2,0],[3,0],[0,2],[2,2],[5,1],[5,2],[2,4],[4,4],[5,5]]) Y = np.array([-1,-1,-1,-1,-1,1,1,1,1,1]) YColor = np.array(["red","red","red","red","red","green","green","green","green","green"]) plt.scatter(x=X[:, 0], y=X[:, 1], c=YColo...
jcharit1/Amazon-Fine-Foods-Reviews
code/.ipynb_checkpoints/experimental-checkpoint (jimmy-Precision-T1600's conflicted copy 2017-05-14).ipynb
mit
import os import pandas as pd import numpy as np import scipy as sp import seaborn as sns import matplotlib.pyplot as plt import json from IPython.display import Image from IPython.core.display import HTML import tensorflow as tf retval=os.chdir("..") clean_data=pd.read_pickle('./clean_data/clean_data.pkl') clean_da...
Iwan-Zotow/VV
C25_GP3.ipynb
mit
import math import matplotlib import numpy as np import matplotlib.pyplot as plt import BEAMphsf import text_loader import H1Dn import H1Du import ListTable %matplotlib inline """ Explanation: Validation and Verification of the 25mm collimator simulation, GP3 Here we provide code and output which verifies and valid...
tensorflow/docs-l10n
site/en-snapshot/tfx/tutorials/tfx/penguin_tfma.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...
datacommonsorg/api-python
notebooks/intro_data_science/Regression_Basics_and_Prediction.ipynb
apache-2.0
# Setup/Imports !pip install datacommons --upgrade --quiet !pip install datacommons_pandas --upgrade --quiet # Data Commons Python and Pandas APIs import datacommons import datacommons_pandas # For manipulating data import numpy as np import pandas as pd # For implementing models and evaluation methods from sklearn ...
Aniruddha-Tapas/Applied-Machine-Learning
Regression/Air-Quality-Prediction.ipynb
mit
import os from sklearn.tree import DecisionTreeClassifier, export_graphviz import pandas as pd import numpy as np from time import time from sklearn.linear_model import LinearRegression from sklearn.linear_model import SGDRegressor from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import tr...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/solutions/serving_babyweight.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst %%bash # Check your project name export PROJECT=$(gcloud config list project --format "value(core.project)") echo "Your current GCP Project Name is: "$PROJECT import os os.environ["BUCKET"] = "your-bucket-id-here" # Recommended: use your project name ...
ES-DOC/esdoc-jupyterhub
notebooks/inm/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inm', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: INM Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbulen...
BayesianTestsML/tutorial
Python/Bsignedrank.ipynb
gpl-3.0
import numpy as np scores = np.loadtxt('Data/accuracy_nbc_aode.csv', delimiter=',', skiprows=1, usecols=(1, 2)) names = ("NBC", "AODE") """ Explanation: Bayesian Signed-Rank Test Module signrank in bayesiantests computes the Bayesian equivalent of the Wilcoxon signed-rank test. It returns probabilities that, based on ...
cmawer/pycon-2017-eda-tutorial
notebooks/1-RedCard-EDA/4-Redcard-final-joins.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format='retina' from __future__ import absolute_import, division, print_function import matplotlib as mpl from matplotlib import pyplot as plt from matplotlib.pyplot import GridSpec import seaborn as sns import numpy as np import pandas as pd import os, sys from tqdm imp...
karlstroetmann/Formal-Languages
ANTLR4-Python/AST-2-Dot.ipynb
gpl-2.0
import graphviz as gv """ Explanation: Drawing Abstract Syntax Trees with GraphViz End of explanation """ def tuple2dot(t): dot = gv.Digraph('Abstract Syntax Tree') Nodes_2_Names = {} assign_numbers((), t, Nodes_2_Names) create_nodes(dot, (), t, Nodes_2_Names) return dot """ Explanation: The fun...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/expression.derivation.ipynb
gpl-3.0
import vcsn from IPython.display import Latex def diffs(r, ss): eqs = [] for s in ss: eqs.append(r'\frac{{\partial}}{{\partial {0}}} {1}& = {2}' .format(s, r.format('latex'), r.derivation(s).format('latex'))) return Latex(r'''...
ihmeuw/dismod_mr
examples/export_csv.ipynb
agpl-3.0
!wget http://ghdx.healthdata.org/sites/default/files/record-attached-files/IHME_GBD_HEP_C_RESEARCH_ARCHIVE_Y2013M04D12.ZIP !unzip IHME_GBD_HEP_C_RESEARCH_ARCHIVE_Y2013M04D12.ZIP # This Python code will export predictions # for the following region/sex/year: predict_region = 'USA' predict_sex = 'male' predict_year = 2...
kfollette/ASTR200-Spring2017
Labs/Lab11/Lab11.ipynb
mit
#data from: http://exoplanetarchive.ipac.caltech.edu/cgi-bin/TblView/nph-tblView?app=ExoTbls&config=planets #download table -> csv format, all rows, all columns import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import scipy.stats as st # these set the pandas defaults so that it...
valter-lisboa/ufo-notebooks
Python3/ufo-sample-python3.ipynb
gpl-3.0
import pandas as pd import numpy as np """ Explanation: USA UFO sightings (Python 3 version) This notebook is based on the first chapter sample from Machine Learning for Hackers with some added features. I did this to present Jupyter Notebook with Python 3 for Tech Days in my Job. The original link is offline so you ...
nmih/ssbio
docs/notebooks/GEM-PRO - Calculating Protein Properties.ipynb
mit
import sys import logging # Import the GEM-PRO class from ssbio.pipeline.gempro import GEMPRO # Printing multiple outputs per cell from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" """ Explanation: GEM-PRO - Calculating Protein Properties This notebook gives a...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_object_raw.ipynb
bsd-3-clause
from __future__ import print_function import mne import os.path as op from matplotlib import pyplot as plt """ Explanation: .. _tut_raw_objects: The :class:Raw &lt;mne.io.Raw&gt; data structure: continuous data End of explanation """ # Load an example dataset, the preload flag loads the data into memory now data_pa...
adrianstaniec/deep-learning
04_intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
tcstewar/testing_notebooks
Learning and Adjusting Tuning Curves.ipynb
gpl-2.0
%matplotlib inline import pylab # plotting import seaborn # plotting import numpy as np # math functions import nengo # neural modelling """ Explanation: Learning and Adjusting Tuning Curves This is a quick notebook just to sketch out some initial stages of looking at modelling Aaron Batista's data...
tacaswell/conda-prescriptions
scripts/notebooks/DAG build and runtime requirements for NSLS-II stack.ipynb
bsd-3-clause
latest_tagged = defaultdict(dict) for lib_name, all_versions in all_recipes.items(): versions = sorted(all_versions.keys()) if len(versions) == 1: version = versions[0] else: if 'dev' in versions: versions.remove('dev') version = versions[-1] latest_tagged[lib_name][v...
berquist/ipython_notebooks_for_qc
notebooks/Frequency Calculations.ipynb
mpl-2.0
import numpy as np with open('qm_files/drop_0375_0qm_0mm.out') as f: contents_qmoutput = f.read() """ Explanation: Frequency Calculations End of explanation """ contents_splitlines = contents_qmoutput.splitlines() contents_splitlines[340:370] """ Explanation: Advanced: calculate frequencies directly from the ...
rabernat/pyqg
docs/examples/linear_stability.ipynb
mit
import numpy as np from numpy import pi import matplotlib.pyplot as plt %matplotlib inline import pyqg m = pyqg.LayeredModel(nx=256, nz = 2, U = [.01, -.01], V = [0., 0.], H = [1., 1.], L=2*pi,beta=1.5, rd=1./20., rek=0.05, f=1.,delta=1.) """ Explanation: Built-in linear stability analy...
gabll/RomeaJam
Traffik_EDA.ipynb
gpl-3.0
def get_status(dt, category=None): """returns road status given specific datetime""" if category: return db.session.query(RoadStatus).filter(RoadStatus.timestamp > dt.strftime('%s')).\ filter(RoadStatus.timestamp < (dt+timedelta(0,60)).strftime('%s')).\ ...
SSDS-Croatia/SSDS-2017
Day-2/segmentation/semantic_segmentation_clean.ipynb
mit
%matplotlib inline import time from os.path import join import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import utils from data import Dataset tf.set_random_seed(31415) tf.logging.set_verbosity(tf.logging.ERROR) plt.rcParams["figure.figsize"] =...
tensorflow/docs
site/en/r1/tutorials/keras/basic_regression.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...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_ica_from_raw.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import mne from mne.preprocessing import ICA from mne.preprocessing import create_ecg_epochs, create_eog_epochs from mne.datasets import sample "...
YihaoLu/statsmodels
examples/notebooks/statespace_structural_harvey_jaeger.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from IPython.display import display, Latex """ Explanation: Detrending, Stylized Facts and the Business Cycle In an influential article, Harvey and Jaeger (1993) described the use of unobserved comp...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/recommendation_systems/solutions/multitask.ipynb
apache-2.0
# Installing the necessary libraries. !pip install -q tensorflow-recommenders !pip install -q --upgrade tensorflow-datasets """ Explanation: Multi-task recommenders Learning Objectives 1. Training a model which focuses on ratings. 2. Training a model which focuses on retrieval. 3. Training a joint model that ass...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/hadgem3-gc31-hm/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-hm', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: MOHC Source ID: HADGEM3-GC31-HM Topic: Land Sub-Topics: Soil, Snow, Vegetation, ...
daniestevez/jupyter_notebooks
AmicalSat/ShockBurst image packets.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from collections import Counter """ Explanation: AmicalSat ShockBurst image packets processing This notebook shows how to process ShockBurst S-band image packets to reassemble the image file End of explanation """ data = np.fromfile('/home/daniel/...
mrcslws/nupic.research
projects/archive/dynamic_sparse/notebooks/mcaporale/2019-10-07--Experiment-Analysis-NonBinaryHeb.ipynb
agpl-3.0
from IPython.display import Markdown, display %load_ext autoreload %autoreload 2 import sys import itertools sys.path.append("../../") from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import n...
csc-training/python-introduction
notebooks/examples/6 - Objects.ipynb
mit
class Student(object): """ The above states that the code-block (indented area) below will define a class Student, that derives from a class called 'object'. Inheriting from 'object' is S """ def __init__(self, name, birthyear, interest=None): """__init__ is special method that is...
numerical-mooc/assignment-bank-2015
Chris Tiu Project/Test2.ipynb
mit
import numpy from matplotlib import pyplot %matplotlib inline from matplotlib import rcParams rcParams['font.family']= 'serif' rcParams['font.size']=16 from IPython.display import Image """ Explanation: Copyright statement? A New 'Transition' Welcome back! At this point in the course you are all likley aces at numeric...
geoscixyz/gpgLabs
notebooks/seismic/Seis_Refraction.ipynb
mit
plotWavelet(); """ Explanation: Interpretation and data acquisition strategies of seismic refraction data In the <a href="https://www.3ptscience.com/app/SeismicRefraction">3pt Science app</a>, you explored the expected arrival times for refractions and reflections from a two-layer over a half-space model. In this not...
dougsweetser/ipq
q_notebooks/billiard_calculations.ipynb
apache-2.0
%%capture import Q_tools as qt; Aq1=qt.Q8([1470000000,0,1.1421,0,1.4220,0,0,0]) Aq2=qt.Q8([1580000000,0,4.2966,0,0,0.3643,0,0]) q_scale = qt.Q8([2.2119,0,0,0,0,0,0,0], qtype="S") Aq1s=Aq1.product(q_scale) Aq2s=Aq2.product(q_scale) print(Aq1s) print(Aq2s) """ Explanation: Table of Contents Observing Billiards Using S...
laurent-george/tutmom
intro.ipynb
bsd-3-clause
import numpy as np objective = np.poly1d([1.3, 4.0, 0.6]) print objective """ Explanation: Introduction to optimization The basic components The objective function (also called the 'cost' function) End of explanation """ import scipy.optimize as opt x_ = opt.fmin(objective, [3]) print "solved: x={}".format(x_) %ma...
CoreSecurity/pysap
docs/protocols/SAPRouter.ipynb
gpl-2.0
from pysap.SAPRouter import * from IPython.display import display """ Explanation: SAP Router The following subsections show a graphical representation of the main protocol packets and how to generate them. First we need to perform some setup to import the packet classes: End of explanation """ for command in router...
JuBra/cobrapy
documentation_builder/building_model.ipynb
lgpl-2.1
from cobra import Model, Reaction, Metabolite # Best practise: SBML compliant IDs cobra_model = Model('example_cobra_model') reaction = Reaction('3OAS140') reaction.name = '3 oxoacyl acyl carrier protein synthase n C140 ' reaction.subsystem = 'Cell Envelope Biosynthesis' reaction.lower_bound = 0. # This is the defaul...
Tsiems/machine-learning-projects
Lab1/Lab1_Playground.ipynb
mit
import pandas as pd import numpy as np df = pd.read_csv('data/data.csv') # read in the csv file """ Explanation: Data Loading and Preprocessing To begin, we load the data into a Pandas data frame from a csv file. End of explanation """ df.info() df.head() """ Explanation: Let's take a cursory glance at the data t...
VandyAstroML/Vandy_AstroML
profiles/Richard/Project_ScikitLearn_Datasets.ipynb
mit
%matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_digits from sklearn.neighbors import KNeighborsClassifier from sklearn.cross_validation import cross_val_score """ Explanation: KNN algorithm example with the sklean digits dataset Purpose We will...
rvm-segfault/edx
python_for_data_sci_dse200x/week3/03_Numpy_Notebook.ipynb
apache-2.0
import numpy as np an_array = np.array([3, 33, 333]) # Create a rank 1 array print(type(an_array)) # The type of an ndarray is: "<class 'numpy.ndarray'>" # test the shape of the array we just created, it should have just one dimension (Rank 1) print(an_array.shape) # because this is a 1-rank array, we...
seg/2016-ml-contest
LA_Team/Facies_classification_LA_TEAM_06.ipynb
apache-2.0
%%sh pip install pandas pip install scikit-learn pip install tpot from __future__ import print_function import numpy as np %matplotlib inline import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold , StratifiedKFold from classif...
mne-tools/mne-tools.github.io
0.18/_downloads/3a40d74661a066ddd49c83c766d57670/plot_visualize_epochs.ipynb
bsd-3-clause
# sphinx_gallery_thumbnail_number = 7 import os.path as op import mne data_path = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample') raw = mne.io.read_raw_fif( op.join(data_path, 'sample_audvis_raw.fif'), preload=True) raw.load_data().filter(None, 9, fir_design='firwin') raw.set_eeg_reference('average', p...
deepmind/deepmind-research
gated_linear_networks/colabs/dendritic_gated_network.ipynb
apache-2.0
# Copyright 2021 DeepMind Technologies Limited. All rights reserved. # # # 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 a...
Alexoner/skynet
notebooks/knn.ipynb
mit
# Run some setup code for this notebook. import random import numpy as np from skynet.utils.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'] ...
Hugovdberg/timml
notebooks/timml_notebook1_sol.ipynb
mit
%matplotlib inline from pylab import * from timml import * figsize=(8, 8) ml = ModelMaq(kaq=[10, 20, 5], z=[0, -20, -40, -80, -90, -140], c=[4000, 10000]) w = Well(ml, xw=0, yw=0, Qw=10000, rw=0.2, layers=1) Constant(ml, xr=10000, yr=0, hr=20, layer=0) Uflow(ml, slope=0.002, angle=0) ml.so...
gbtimmon/ase16GBT
code/6/pwang13.ipynb
unlicense
%matplotlib inline # All the imports from __future__ import print_function, division from math import * import random import sys import matplotlib.pyplot as plt # TODO 1: Enter your unity ID here __author__ = "pwang13" class O: """ Basic Class which - Helps dynamic updates - Pretty Prints ...
computational-class/cjc2016
code/08.07-analyzing_titanic_dataset.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt """ Explanation: Introduction to the Basics of Statistics 王成军 wangchengjun@nju.edu.cn 计算传播网 http://computational-communication.com 一、使用Pandas清洗泰坦尼克数据 练习使用Pandas 二、分析天涯回帖数据 学习使用Statsmodels End of explanation """ import pandas as pd """ Explanation: End of exp...
henchc/Data-on-the-Mind-2017-scraping-apis
02-Scraping/solutions/01-BS_solutions.ipynb
mit
import requests # to make GET request from bs4 import BeautifulSoup # to parse the HTML response import time # to pause between calls import csv # to write data to csv import pandas # to see CSV """ Explanation: Webscraping with Beautiful Soup In this lesson we'll learn about various techniques to scrape data fr...
f-guitart/data_mining
exercises/exercise1.ipynb
gpl-3.0
df1 = pd.read_csv("../data/iqsize.csv") # we can apply head method, it will return the n first rows # n = 5 as a default value df1.head(10) """ Explanation: Load iqsize.csv using pd.read_csv End of explanation """ print("Columns: {}".format(df1.columns)) print("Rows: {}".format(df1.index)) """ Explanation: Print bo...
irsisyphus/machine-learning
3 Kernel, Bayes and Models.ipynb
apache-2.0
%load_ext watermark %watermark -a '' -u -d -v -p numpy,pandas,matplotlib,scipy,sklearn %matplotlib inline # Added version check for recent scikit-learn 0.18 checks from distutils.version import LooseVersion as Version from sklearn import __version__ as sklearn_version """ Explanation: Assignment 3 - basic classifiers...
great-expectations/great_expectations
tests/test_fixtures/upgrade_helper/great_expectations_v20_project_with_v30_configuration_and_v20_checkpoints/notebooks/pandas/validation_playground.ipynb
apache-2.0
import json import great_expectations as ge import great_expectations.jupyter_ux from great_expectations.datasource.types import BatchKwargs import datetime """ Explanation: Validation Playground Watch a short tutorial video or read the written tutorial This notebook assumes that you created at least one expectation s...
whitead/numerical_stats
unit_10/hw_2016/homework_9_key.ipynb
gpl-3.0
from math import erf, sqrt import numpy as np import scipy.stats """ Explanation: Homework 9 Key CHE 116: Numerical Methods and Statistics Prof. Andrew White Version 1.0 (3/23/2016) End of explanation """ mu_sample=1070 mu_popul=1064. st_dev=5 z=(-mu_popul+mu_sample)/st_dev print('Z:', z) p=(1 - np.abs((scipy.stats....
jorisvandenbossche/DS-python-data-analysis
_solved/case2_observations_processing.ipynb
bsd-3-clause
import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.style.use('seaborn-whitegrid') """ Explanation: <p><font size="6"><b> CASE - Observation data - data cleaning and enrichment</b></font></p> © 2021, Joris Van den Bossche and Stijn Van Hoey (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#1...
Code-Girls/2016Summer
Day6/code/k-means_clustering.ipynb
mit
# NOTE: we use non-random initializations for the cluster centers # to make autograding feasible; normally cluster centers would be # randomly initialized. data = np.load('data/X.npz') X = data['X'] centers = data['centers'] print ('X: \n' + str(X)) print ('\ncenters: \n' + str(centers)) """ Explanation: In this...
NelisW/ComputationalRadiometry
12g-Plume-texture.ipynb
mpl-2.0
# to prepare the environment import numpy as np import scipy as sp import pandas as pd import os.path from scipy.optimize import curve_fit from scipy import interpolate from scipy import integrate from scipy import signal from scipy import ndimage import matplotlib.pyplot as plt import scipy.constants as const import p...
merryjman/astronomy
templateGraphing.ipynb
gpl-3.0
# import software packages import pandas as pd import numpy as np %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt inline_rc = dict(mpl.rcParams) """ Explanation: Data Analysis Template This notebook is a template for data analysis and includes some useful code for calculations and plotting....
hankcs/HanLP
plugins/hanlp_demo/hanlp_demo/zh/tutorial.ipynb
apache-2.0
!pip install hanlp_restful """ Explanation: 欢迎来到HanLP在线交互环境,这是一个Jupyter记事本,可以输入任意Python代码并在线执行。请点击左上角【Run】来运行这篇NLP教程。 安装 量体裁衣,HanLP提供RESTful(云端)和native(本地)两种API,分别面向轻量级和海量级两种场景。无论何种API何种语言,HanLP接口在语义上保持一致,你可以任选一种API来运行本教程。 轻量级RESTful API 仅数KB,适合敏捷开发、移动APP等场景。简单易用,无需GPU配环境,强烈推荐,秒速安装: End of explanation """ from hanlp...
mathLab/RBniCS
tutorials/07_nonlinear_elliptic/tutorial_nonlinear_elliptic_deim.ipynb
lgpl-3.0
from dolfin import * from rbnics import * """ Explanation: Tutorial 07 - Non linear Elliptic problem Keywords: DEIM, POD-Galerkin 1. Introduction In this tutorial, we consider a non linear elliptic problem in a two-dimensional spatial domain $\Omega=(0,1)^2$. We impose a homogeneous Dirichlet condition on the boundary...
ibm-et/defrag2015
notebooks/doodle.ipynb
mit
import requests api_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' url = "https://api.meetup.com/2/open_events" params = {'topic':'bluemix', 'key':api_key} r = requests.get(url, params=params) r.raise_for_status() resp = r.json() resp.keys() """ Explanation: Upcoming Bluemix Meetups http://www.meetup.com/meetup_api/d...
csc-training/python-introduction
notebooks/answers/3 - Control Structures.ipynb
mit
breakfast = ["sausage", "eggs", "bacon", "spam"] for item in breakfast: print(item) """ Explanation: Control Structures Simple for loop Write a for loop which iterates over the list of breakfast items "sausage", "eggs", "bacon" and "spam" and prints out the name of item End of explanation """ squares = [] for i ...
apryor6/apryor6.github.io
visualizations/seaborn/notebooks/.ipynb_checkpoints/colors-checkpoint.ipynb
mit
%matplotlib inline import pandas as pd import matplotlib.pyplot as plt import seaborn as sns plt.rcParams['figure.figsize'] = (20.0, 10.0) df = pd.read_csv('../../../datasets/movie_metadata.csv') df.head() """ Explanation: seaborn.countplot Bar graphs are useful for displaying relationships between categorical data...
daniel-koehn/Theory-of-seismic-waves-II
05_2D_acoustic_FD_modelling/lecture_notebooks/3_fdac2d_num_stability_anisotropy.ipynb
gpl-3.0
# Execute this cell to load the notebook's style sheet, then ignore it from IPython.core.display import HTML css_file = '../../style/custom.css' HTML(open(css_file, "r").read()) """ Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 by D. Koehn, notebook ...
kpyuan1776/mvv_analyse
graphCompDistances.ipynb
gpl-3.0
import googlemaps import json from datetime import datetime import networkx as nx import csv import matplotlib import numpy as np import matplotlib.pyplot as plt %matplotlib inline # here is my API key from my project gmaps = googlemaps.Client(key='PUT_GOOGLE_MAPS_API_KEY_HERE') file_edges = 'edges_sbahn_fixed.tx...
gschivley/Index-variability
Notebooks/Compile population data.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np import os from os.path import join cwd = os.getcwd() data_directory = join(cwd, '..', 'Data storage') """ Explanation: Combine data files with state populations The first data file has 2000-2010 End of expla...
encima/Comp_Thinking_In_Python
Session_8/8_Recursion and Dicts.ipynb
mit
empty_dict = {} contact_dict = { "name": "Homer", "email": "homer@simpsons.com", "phone": 999 } print(contact_dict) """ Explanation: Recursion and Dictionaries Dr. Chris Gwilliams gwilliamsc@cardiff.ac.uk Overview Scripts in Python Types Methods and Functions Flow control Lists Iteration for loops while l...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/tensorflow_extended/labs/penguin_tfdv.ipynb
apache-2.0
# Install the TensorFlow Extended library !pip install -U tfx """ Explanation: Data validation using TFX Pipeline and TensorFlow Data Validation Learning Objectives Understand the data types, distributions, and other information (e.g., mean value, or number of uniques) about each feature. Generate a preliminary schem...
ireapps/pycar
completed/analyzing_data_with_pandas_notebook_complete.ipynb
mit
import pandas as pd """ Explanation: Analyzing data with Pandas First a little setup. Importing the pandas library as pd End of explanation """ %matplotlib inline pd.set_option("max_columns", 150) pd.set_option('max_colwidth',40) pd.options.display.float_format = '{:,.2f}'.format """ Explanation: Set some helpful d...
abatula/MachineLearningIntro
LinearRegression_Tutorial.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model, datasets # Import the linear regression function and dataset from scikit-learn from sklearn.model_selection import train_test_split, KFold from sklearn.metrics import mean_squared_error, r2_score # Print figures in the notebook %matpl...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_visualize_evoked.ipynb
bsd-3-clause
import os.path as op import numpy as np import matplotlib.pyplot as plt import mne # sphinx_gallery_thumbnail_number = 9 """ Explanation: Visualize Evoked data In this tutorial we focus on plotting functions of :class:mne.Evoked. End of explanation """ data_path = mne.datasets.sample.data_path() fname = op.join(da...
ueapy/ueapy.github.io
content/notebooks/2020-11-05-ways-of-python.ipynb
mit
from pygments import highlight from pygments.lexers import PythonLexer from pygments.formatters import HtmlFormatter import IPython """ Explanation: Unlike other programs that have a single programming interface (matlab) or a dominant interface de jour (R with RStudio), Python has a whole ecosystem of programs for wri...
marcelomiky/PythonCodes
codes/back_to_basics/conceitos/Lists.ipynb
mit
list1 = ['apple', 'banana', 'orange'] list1 list2 = [7, 11, 13, 17, 19] list2 list3 = ['text', 23, 66, -1, [0, 1]] list3 empty = [] empty list1[0] list1[-1] list1[-2] 'orange' in list1 'pineapple' in list1 0 in list3 0 in list3[-1] None in empty 66 in list3 len(list2) len(list3) del list2[2] list2 new_l...
LSSTDESC/Monitor
examples/simple_error_model.ipynb
bsd-3-clause
import os import desc.monitor import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from lsst.sims.photUtils import calcNeff %matplotlib inline %load_ext autoreload %autoreload 2 """ Explanation: Simple Error Model for Twinkles This notebook will calculate a simple error model for the Twinkles da...
gjwo/nilm_gjw_data
notebooks/disaggregation-hart-active_and_reactive(normal).ipynb
apache-2.0
%matplotlib inline import numpy as np import pandas as pd from os.path import join from pylab import rcParams import matplotlib.pyplot as plt rcParams['figure.figsize'] = (13, 6) plt.style.use('ggplot') #import nilmtk from nilmtk import DataSet, TimeFrame, MeterGroup, HDFDataStore from nilmtk.disaggregate.hart_85 impor...
EricChiquitoG/Simulacion2017
Modulo1/.ipynb_checkpoints/Clase4_OsciladorArmonico-checkpoint.ipynb
mit
from IPython.display import YouTubeVideo YouTubeVideo('k5yTVHr6V14') """ Explanation: ¿Cómo se mueve un péndulo? Se dice que un sistema cualquiera, mecánico, eléctrico, neumático, etc., es un oscilador armónico si, cuando se deja en libertad fuera de su posición de equilibrio, vuelve hacia ella describiendo oscilacio...
yangliuy/yangliuy.github.io
markdown_generator/publications.ipynb
mit
!cat publications.tsv """ Explanation: Publications markdown generator for academicpages Takes a TSV of publications with metadata and converts them for use with academicpages.github.io. This is an interactive Jupyter notebook (see more info here). The core python code is also in publications.py. Run either from the m...
taraokelly/Problem-set-Jupyter-Pyplot-and-Numpy
solutions/solution.ipynb
mit
import numpy as np # Load in data from csv file. sepal_length, sepal_width, petal_length, petal_width = np.genfromtxt('../data/IRIS.csv', delimiter=',', usecols=(0,1,2,3), unpack=True, dtype=float) iris_class = np.genfromtxt('../data/IRIS.csv', delimiter=',', usecols=(4), unpack=True, dtype=str) # Loaded the columns ...
sisnkemp/deep-learning
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
sassoftware/sas-viya-programming
python/python-integration-viya/SAS Viya_ CAS & Python Integration Workshop.ipynb
apache-2.0
## Data Management import swat import pandas as pd ## Data Visualization from matplotlib import pyplot as plt import seaborn as sns %matplotlib inline ## Global Options swat.options.cas.trace_actions = False # Enabling tracing of actions (Default is False. Will change to true later) swat.options.cas.trace_ui_a...
stephenbeckr/convex-optimization-class
Homeworks/APPM5630_HW8_helper.ipynb
mit
import numpy as np def mySimpleSolver(f,x0,maxIters=13): x = np.asarray(x0,dtype='float64').copy() for k in range(maxIters): fx = f(x) x -= .001*x # some weird update rule, just to make something interesting happen return x # Let's solve this in 1D f = lambda x : x**2 x = mySimpleSolver( f, 1 ) print(...
mne-tools/mne-tools.github.io
dev/_downloads/b99fcf919e5d2f612fcfee22adcfc330/40_autogenerate_metadata.ipynb
bsd-3-clause
from pathlib import Path import matplotlib.pyplot as plt import mne data_dir = Path(mne.datasets.erp_core.data_path()) infile = data_dir / 'ERP-CORE_Subject-001_Task-Flankers_eeg.fif' raw = mne.io.read_raw(infile, preload=True) raw.filter(l_freq=0.1, h_freq=40) raw.plot(start=60) # extract events all_events, all_ev...
kubeflow/code-intelligence
Issue_Embeddings/notebooks/01_AcquireData.ipynb
mit
from mdparse.parser import transform_pre_rules, compose import pandas as pd from tqdm import tqdm_notebook from fastai.text.transform import defaults """ Explanation: Running This Notebook This notebook should be run using the github/mdtok container on DockerHub. The Dockerfile that defines this container is located ...
tarashor/vibrations
py/notebooks/.ipynb_checkpoints/MatricesForPlaneCorrugatedShells1-checkpoint.ipynb
mit
from sympy import * from geom_util import * from sympy.vector import CoordSys3D import matplotlib.pyplot as plt import sys sys.path.append("../") %matplotlib inline %reload_ext autoreload %autoreload 2 %aimport geom_util # Any tweaks that normally go in .matplotlibrc, etc., should explicitly go here %config InlineBa...
computational-class/cjc
code/pytorch.ipynb
mit
import torch """ Explanation: Install conda install pytorch torchvision -c soumith Import End of explanation """ x = torch.Tensor(5, 3) print(x) """ Explanation: Tutorial http://pytorch.org/tutorials/beginner/blitz/tensor_tutorial.html http://pytorch.org/tutorials/ End of explanation """ import torch from torch.a...