repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
keras-team/keras-io
examples/vision/ipynb/deit.ipynb
apache-2.0
from typing import List import tensorflow as tf import tensorflow_addons as tfa import tensorflow_datasets as tfds import tensorflow_hub as hub from tensorflow import keras from tensorflow.keras import layers tfds.disable_progress_bar() tf.keras.utils.set_random_seed(42) """ Explanation: Distilling Vision Transforme...
YaleDHLab/lab-workshops
beautifulsoup/intro-to-html-parsing.ipynb
mit
!pip install requests """ Explanation: Introduction to HTML Parsing with Python The web has vast troves of data, but to use that data in a machine learning application, it must first be collected and parsed. This workshop aims to show you how to accomplish both of these feats. By the end of this notebook, you will hav...
tiagoft/inteligencia_computacional
classificador_regras.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot as plt """ Explanation: Classificação por Regras Pré-Definidas O problema com o qual vamos lidar é o de classificar automaticamente elementos de um conjunto através de suas características mensuráveis. Trata-se, assim, do problema de observar element...
tensorflow/workshops
extras/amld/notebooks/exercises/1_data.ipynb
apache-2.0
data_path = '/content/gdrive/My Drive/amld_data' # Alternatively, you can also store the data in a local directory. This method # will also work when running the notebook in Jupyter instead of Colab. # data_path = './amld_data if data_path.startswith('/content/gdrive/'): from google.colab import drive assert data_...
VictorQuintana91/Thesis
notebooks/001_data_normalisation.ipynb
mit
def parse(path): g = gzip.open(path, 'rb') for l in g: yield eval(l) def getDF(path): i = 0 df = {} for d in parse(path): df[i] = d i += 1 return pd.DataFrame.from_dict(df, orient='index') df = getDF('/Users/falehalrashidi/Downloads/reviews_Books_5.json.gz') df.head() df1 = df[['reviewerID',...
google/nitroml
examples/nitroml_kubeflow.ipynb
apache-2.0
import sys # install kfp (https://kubeflow-pipelines.readthedocs.io/en/latest/source/kfp.html) !{sys.executable} -m pip install --user --upgrade -q kfp==1.0.0 !{sys.executable} -m pip install --user --upgrade -q kfp-server-api==1.0.0 # Download skaffold and set it executable. # !curl -Lo skaffold https://storage.goog...
koverholt/notebooks
fire-incidents/fire-incidents.ipynb
bsd-3-clause
import pandas as pd %matplotlib inline pd.set_option('display.max_rows', 1000) pd.set_option('display.max_columns', 1000) df = pd.read_csv('fire-incidents.csv') df.head(3) df.shape """ Explanation: Data from http://catalog.data.gov/dataset/baton-rouge-fire-incidents End of explanation """ df.columns df['DISPAT...
johanfrisk/Python_at_web
notebooks/networked_programs.ipynb
mit
# Python built in support for TCP sockets import socket # this just opens a 'porthole' out from my computer mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # this connects me to the other computer mysock.connect(('www.py4inf.com', 80)) """ Explanation: These are my notes on networked programs End of expla...
ngast/rmf_tool
examples/Example_2choice.ipynb
mit
# To load the library import rmftool as rmf import importlib importlib.reload(rmf) # To plot the results import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: This document demonstrate how to use the library to define a "density dependent population process" and to compute its mean-...
tensorflow/docs-l10n
site/ja/federated/tutorials/custom_federated_algorithms_2.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...
mmckerns/tuthpc
kocham.ipynb
bsd-3-clause
$ unzip kocham.zip $ cd kocham $ python setup.py install """ a toy password cracker """ import time import itertools from multiprocess.dummy import Pool import kocham.imap as imap import kocham.corpus as corpus stopwords = corpus.stopwords ipassword = corpus.ipassword compare = imap.login # turn on verbosity corpus.V...
mne-tools/mne-tools.github.io
0.21/_downloads/142c866d928b3d3a3a76c80e0ef4ea81/plot_rereference_eeg.ipynb
bsd-3-clause
# Authors: Marijn van Vliet <w.m.vanvliet@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import mne from mne.datasets import sample from matplotlib import pyplot as plt print(__doc__) # Setup for reading the raw data data_path = sample.data_path() raw_fname = data_...
macks22/gensim
docs/notebooks/word2vec.ipynb
lgpl-2.1
# import modules & set up logging import gensim, logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) sentences = [['first', 'sentence'], ['second', 'sentence']] # train word2vec on the two sentences model = gensim.models.Word2Vec(sentences, min_count=1) """ Explanation:...
tpin3694/tpin3694.github.io
machine-learning/random_forest_classifier.ipynb
mit
# Load libraries from sklearn.ensemble import RandomForestClassifier from sklearn import datasets """ Explanation: Title: Random Forest Classifier Slug: random_forest_classifier Summary: Training a random forest classifier in scikit-learn. Date: 2017-09-21 12:00 Category: Machine Learning Tags: Trees And Forests Autho...
nicjhan/MOM6-examples
ocean_only/flow_downslope/Understanding native output data from MOM6.ipynb
gpl-3.0
%pylab inline import scipy.io.netcdf """ Explanation: This "flow downslope" example involves four sub-directories, layer, rho, sigma and z, in which the model is running in one of four coordinate configurations. To use this notebook it is assumed you have run each of those experiments in place and have kept the outpu...
scotthuang1989/Python-3-Module-of-the-Week
text/re.ipynb
apache-2.0
import re pattern = 'text' text = 'Does this text match the pattern?' match = re.search(pattern, text) s = match.start() e = match.end() print('Found "{}"\n in "{}"\n from {} to {} ("{}")'.format( match.re.pattern, match.string, s, e, text[s:e])) """ Explanation: Regular expressions are text matching patterns ...
xdze2/thermique_appart
testweek_get_data.ipynb
mit
coords_grenoble = (45.1973288, 5.7139923) startday = pd.to_datetime('12/07/2017', format='%d/%m/%Y').tz_localize('Europe/Paris') lastday = pd.to_datetime('24/07/2017', format='%d/%m/%Y').tz_localize('Europe/Paris') """ Explanation: Téléchargement des données et premier traitement End of explanation """ # routine po...
mmathioudakis/web_browsing
browsing_history.ipynb
gpl-2.0
%%bash cp ~/Library/Safari/History.db ~/Workspace/web_browsing/hs.db """ Explanation: Part 1: Retrieving our Safari Browsing History To access our browsing history, we go to ~/Library/Safari and look for the database History.db. We make a copy of it in a folder in our workspace, e.g. to ~/Workspace/web_browsing/hs.db....
bcantarel/bcantarel.github.io
bicf_nanocourses/courses/ML_1/exercises/PGM.ipynb
gpl-3.0
from scipy.stats import beta α = 1 colors = sns.palettes.color_palette("Blues",15)[5:] for i in range(10): β = 0.5*(i+1) x = np.linspace(1e-2, 1-1e-2, 1e4) _ = sns.plt.plot(x, beta.pdf(x, α, β), color=colors[i], lw=2, alpha=0.6, label='') """ Explanation: Probability Primer Distributi...
Kevogich/Mercedes-Benz-Test-Bench-Kaggle-
BenzDatasetAnalysis.ipynb
mit
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt import seaborn as sns from sklearn import preprocessing import xgboost as xgb color = sns.color_palette() %matplotlib inline pd.options.mode.chained_assignment = None # default='...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/end_to_end_ml/solutions/preproc.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst !pip install --user google-cloud-bigquery==1.25.0 """ Explanation: <h1> Preprocessing using Dataflow </h1> This notebook illustrates: <ol> <li> Creating datasets for Machine Learning using Dataflow </ol> <p> While Pandas is fine for experimenting, fo...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_compute_raw_data_spectrum.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne import io, read_proj, read_selection from mne...
kingmolnar/DataScienceProgramming
03-NumPy-and-Linear-Algebra/Introduction_class.ipynb
cc0-1.0
%matplotlib inline import math import numpy as np import matplotlib.pyplot as plt ##import seaborn as sbn ##from scipy import * """ Explanation: Introduction to NumPy Topics Basic Synatx creating vectors matrices special: ones, zeros, identity eye add, product, inverse Mechanics: indexing, slicing, concatenating, r...
neildhir/DCBO
notebooks/ind_scm.ipynb
mit
%load_ext autoreload %autoreload 2 import sys sys.path.append("../src/") sys.path.append("..") from src.examples.example_setups import setup_ind_scm from src.utils.sem_utils.toy_sems import StationaryIndependentSEM as IndSEM from src.utils.sem_utils.sem_estimate import build_sem_hat from src.experimental.experiments ...
matthewljones/computingincontext
CinC_lecture_02_vectorizing.ipynb
gpl-2.0
%matplotlib inline import pandas as pd def document_vector(wordstring): """put yer documentation here friend""" wordlist = wordstring.split() set_of_words=set(wordlist) distinct_words=list(set_of_words) wordfreq = [wordlist.count(w) for w in distinct_words] return distinct_words, wordfreq x,...
PythonFreeCourse/Notebooks
week05/2_Functions_Part_2.ipynb
mit
def my_range(end, start): numbers = [] i = start while i < end: numbers.append(i) i += 1 return numbers my_range(5, 0) """ Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול...
kit-cel/wt
mloc/ch4_Autoencoders/Autoencoder_Compression_Binarizer_Sweep.ipynb
gpl-2.0
import torch import torch.nn as nn import torch.optim as optim import torchvision import numpy as np from matplotlib import pyplot as plt device = 'cuda' if torch.cuda.is_available() else 'cpu' print("We are using the following device for learning:",device) """ Explanation: Image Compression using Autoencoders with B...
wheeler-microfluidics/mr-box-peripheral-board.py
mr_box_peripheral_board/notebooks/Peripherals GTK UI.ipynb
mit
import gtk import gobject import threading import datetime as dt import matplotlib as mpl import matplotlib.style import numpy as np import pandas as pd from streaming_plot import StreamingPlot def _generate_data(stop_event, data_ready, data): ''' Generate random data to emulate, e.g., reading data from ADC...
great-expectations/great_expectations
tests/test_fixtures/rule_based_profiler/example_notebooks/DataAssistants_Instantiation_And_Running.ipynb
apache-2.0
import great_expectations as ge from great_expectations.core.yaml_handler import YAMLHandler from great_expectations.core.batch import BatchRequest from great_expectations.core import ExpectationSuite from great_expectations.core.expectation_configuration import ExpectationConfiguration from great_expectations.validato...
myedibleenso/this-before-that
notebooks/keras-lstm.ipynb
apache-2.0
import pandas as pd data = pd.read_json("../annotations.json") # how many annotations exist with the positive labels of interest? print("annotations for E1 precedes E2: {}".format((pd.read_json("../annotations.json").relation == "E1 precedes E2").sum())) print("annotations for E2 precedes E1: {}".format((pd.read_json...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/.ipynb_checkpoints/n00_datasets_generation-checkpoint.ipynb
mit
# Basic imports import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys from time import time from sklearn.metrics import r2_score, median_absolute_error %matplotlib inline %pylab inline pylab.rcParams['figure.figsize'] = (20.0, 10...
ageron/ml-notebooks
math_linear_algebra.ipynb
apache-2.0
from __future__ import division, print_function, unicode_literals """ Explanation: Math - Linear Algebra Linear Algebra is the branch of mathematics that studies vector spaces and linear transformations between vector spaces, such as rotating a shape, scaling it up or down, translating it (ie. moving it), etc. Machine...
rdhyee/diversity-census-calc
03_02_Displaying_Census_URLs.ipynb
apache-2.0
# http://api.census.gov/data/2010/sf1/geo.html from IPython.core.display import HTML HTML("<iframe src='http://api.census.gov/data/2010/sf1/geo.html' width='800px'/>") %%HTML <b>hi there</b> try: from urllib.parse import urlparse, urlencode, parse_qs, urlunparse except ImportError: from urlparse import url...
dtamayo/MachineLearning
Day3/TransitClassification_Ensemble_part1.ipynb
gpl-3.0
import sklearn from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split from sklearn.utils import shuffle from sklearn import metrics from sklearn.metrics import roc_curve from sklearn.metrics import classification_report from sklearn.decomposition import PCA from sklear...
probml/pyprobml
notebooks/book1/12/poisson_regression_insurance.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import pandas as pd import sklearn print(sklearn.__version__) from sklearn.linear_model import PoissonRegressor """ Explanation: <a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/notebooks/poisson_regression_insurance.ipynb" target="_pare...
alanmitchell/fnsb-benchmark
ddc/ddc_data_tutorial.ipynb
mit
# Import the needed libraries import pandas as pd import numpy as np import ddc_readers # the module that has DDC trend file readers # import matplotlib pyplot commands import matplotlib.pyplot as plt # Show Plots in the Notebook %matplotlib inline # Increase the size of plots and their fonts plt.rcParams['fig...
chseifert/tutorials
visual-perception/Color-Perception-and-Palettes.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap fig, ax1 = plt.subplots() my_map = LinearSegmentedColormap.from_list('Map', ['yellow', 'blue']) left, bottom, width, height = [0.57, 0.65, 0.2, 0.2] ax2 = fig.add_axes([left, bottom, width, height]) left, bottom...
richardotis/pycalphad-sandbox
CALPHAD2015-Demo.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from pycalphad import Database, binplot db_alfe = Database('alfe_sei.TDB') my_phases_alfe = ['LIQUID', 'B2_BCC', 'FCC_A1', 'HCP_A3', 'AL5FE2', 'AL2FE', 'AL13FE4', 'AL5FE4'] fig = plt.figure(figsize=(9,6)) pdens = [{'B2_BCC': 20000}, 2000] %time binplot(db_alfe, ['AL',...
mauriciogtec/PropedeuticoDataScience2017
Alumnos/Karen_Esther/Tarea_2/Tarea_2 _Karen_v2.ipynb
mit
import numpy as np # funciones numéricas (arrays, matrices, etc.) import PIL.Image # funciones para cargar y manipular imágenes im = PIL.Image.open("/Users/Karen/image.jpg") col,row = im.size image = np.zeros((row*col, 5)) pixels = im.load() print(pixels[188,266]) for i in range(col): ...
empet/Plotly-plots
Isosurface-in-volumetric-data.ipynb
gpl-3.0
import plotly.graph_objs as go import numpy as np from skimage import measure """ Explanation: Isosurface in volumetric data Linear and nonlinear slices in volumetric data, as graphs of functions of two variables, were defined in this Jupyter Notebook http://nbviewer.jupyter.org/github/empet/Plotly-plots/blob/master/P...
nguy/AWOT
examples/awot_track_kmz_save.ipynb
gpl-2.0
import os import matplotlib.pyplot as plt import numpy as np import awot %matplotlib inline """ Explanation: <h2>Examples saving KMZ/KML files</h2> End of explanation """ flname = os.path.join("/Users/guy/data/king_air/pecan2015", "20150716.c1.nc") fl = awot.io.read_netcdf(fname=flname, platform='uwka') print(fl[...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/sandbox-1/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-1', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NERC Source ID: SANDBOX-1 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radi...
zerkh/theano_lstm
Tutorial.ipynb
bsd-3-clause
## Fake dataset: class Sampler: def __init__(self, prob_table): total_prob = 0.0 if type(prob_table) is dict: for key, value in prob_table.items(): total_prob += value elif type(prob_table) is list: prob_table_gen = {} for key in prob_tabl...
sempwn/salary-prediction
explore-data.ipynb
mit
data.SalaryNormalized.hist(); plt.ylabel('frequency'); plt.xlabel(u'salary (£)'); plt.yscale('log'); """ Explanation: plot salary Normalized salary is the target variable. Seems fairly straight on a ylog plot suggesting a simple linear regression on categories isn't going to cut it. End of explanation """ cachedStop...
vitojph/kschool-nlp
notebooks-py3/vsm.ipynb
gpl-3.0
# corpus ficticio con tres documentos de la misma longitud # y sin repeticiones de términos dentro del mismo documento # cada doc es una lista de palabras d1 = 'los angeles times'.split() d2 = 'new york times'.split() d3 = 'new york post'.split() # nuestro corpus D es una lista de documentos D = [d1, d2, d3] print(D...
UDST/activitysim
activitysim/examples/example_estimation/notebooks/14_joint_tour_scheduling.ipynb
bsd-3-clause
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating Joint Tour Scheduling This notebook illustrates how to re-estimate the joint tour scheduling component for ActivitySim. This process includes running ActivitySim in estimation mode to read h...
spencerchan/ctabus
notebooks/Visualizing Bus Bunching.ipynb
gpl-3.0
patterns = tools.load_patterns(73, waypoints=True) patterns = patterns[patterns.pid == 2170] patterns.head() """ Explanation: A Common City Scene If you've ever ridden the bus, you've probably had the following experience. You're standing at the bus stop waiting for the bus to come. You've been waiting over ten minute...
iiasa/xarray_tutorial
xarray-tutorial-egu2017-answers.ipynb
bsd-3-clause
# standard imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import xarray as xr import warnings %matplotlib inline np.set_printoptions(precision=3, linewidth=80, edgeitems=1) # make numpy less verbose xr.set_options(display_width=70) warnings.simplefilter('ignore') # filter some warnin...
gaufung/PythonStandardLibrary
mathematic/decimal.ipynb
mit
import decimal fmt = '{0:<25}{1:<25}' print(fmt.format('Input', 'Output')) print(fmt.format('-'*25, '-'*25)) #Integer print(fmt.format(5, decimal.Decimal(5))) #String print(fmt.format('3.14', decimal.Decimal('3.14'))) #Float f = 0.1 print(fmt.format(repr(f), decimal.Decimal(str(f)))) print('{:0.23g}{:<25}'.format(f, st...
sbg/Mitty
docs/filter-based-analysis-tutorial/filter-based-analysis-tutorial.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 import time import matplotlib.pyplot as plt import cytoolz.curried as cyt from bokeh.plotting import figure, show, output_file import mitty.analysis.bamtoolz as bamtoolz import mitty.analysis.bamfilters as mab import mitty.analysis.plots as mapl # import logging # FORMAT = "[%(file...
Rotvig/cs231n
Deep Learning/Exercise 2/Q1.ipynb
mit
# As usual, a bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient from cs231n.layers import * %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolati...
Ganeshgajakosh/ml_lab_ecsc_306
labwork/lab7/sci-learn/plot_pca_3d.ipynb
apache-2.0
print(__doc__) # Authors: Gael Varoquaux # Jaques Grobler # Kevin Hughes # License: BSD 3 clause from sklearn.decomposition import PCA from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt from scipy import stats """ Explanation: ===============================...
kmunve/APS
aps/notebooks/ml_varsom/linear_regression.ipynb
mit
import pandas as pd import numpy as np import json import graphviz import matplotlib.pyplot as plt from sklearn import linear_model pd.set_option("display.max_rows",6) %matplotlib inline df_data = pd.read_csv('varsom_ml_preproc.csv', index_col=0) X = df_data.filter(['mountain_weather_wind_speed_num', 'mountain_weat...
nirmorgo/BTC_trade_strategy_utils
BTC trade strategy utilities demo.ipynb
gpl-3.0
import pandas as pd pd.options.mode.chained_assignment = None # default='warn' # Need to disable the annoying Pandas warnings that were added in 0.20... import matplotlib %matplotlib inline """ Explanation: This is a short demo that demonstrates the use of the functions in this repo End of explanation """ from da...
anguszxd/segment
你好,Colaboratory.ipynb
gpl-3.0
import tensorflow as tf input1 = tf.ones((2, 3)) input2 = tf.reshape(tf.range(1, 7, dtype=tf.float32), (2, 3)) output = input1 + input2 with tf.Session(): result = output.eval() result """ Explanation: <a href="https://colab.research.google.com/github/anguszxd/segment/blob/master/%E4%BD%A0%E5%A5%BD%EF%BC%8CColab...
Spandan-Madan/DeepLearningProject
docs/Deep_Learning_Project-Pytorch.ipynb
mit
import warnings warnings.filterwarnings('ignore') import torchvision import urllib2 import requests import json import imdb import time import itertools import wget import os import tmdbsimple as tmdb import numpy as np import random import matplotlib import matplotlib.pyplot as plt %matplotlib inline import seaborn as...
tensorflow/tensorflow
tensorflow/lite/g3doc/models/modify/model_maker/question_answer.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...
trangel/Data-Science
reinforcement_learning/qlearning.ipynb
gpl-3.0
#XVFB will be launched if you run on a server import os if type(os.environ.get("DISPLAY")) is not str or len(os.environ.get("DISPLAY")) == 0: !bash ../xvfb start os.environ['DISPLAY'] = ':1' import numpy as np import matplotlib.pyplot as plt %matplotlib inline %load_ext autoreload %autoreload 2 %%writ...
rsheftel/raccoon
examples/usage_dropin.ipynb
mit
# remove comment to use latest development version import sys; sys.path.insert(0, '../') # import libraries import raccoon as rc """ Explanation: Example Usage for Drop-in List Replacements End of explanation """ from blist import blist # Construct with blist df_blist = rc.DataFrame({'a': [1, 2, 3]}, index=[5, 6, ...
mne-tools/mne-tools.github.io
0.19/_downloads/075ba1175413b0aa0dc66e721f312729/plot_mixed_norm_inverse.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # # License: BSD (3-clause) import numpy as np import mne from mne.datasets import sample from mne.inverse_sparse import mixed_norm, make_stc_from_dipoles from mne.minimum_norm import make_inverse_...
ES-DOC/esdoc-jupyterhub
notebooks/mohc/cmip6/models/hadgem3-gc31-lm/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'mohc', 'hadgem3-gc31-lm', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: MOHC Source ID: HADGEM3-GC31-LM Sub-Topics: Radiative Forcings. Propert...
vitojph/kschool-nlp
notebooks-py3/nltk-pos.ipynb
gpl-3.0
import nltk """ Explanation: Resumen NLTK: Etiquetado morfológico (part-of-speech tagging) Este resumen se corresponde con el capítulo 5 del NLTK Book Categorizing and Tagging Words. La lectura del capítulo es muy recomendable. Etiquetado morfológico con NLTK NLTK propociona varias herramientas para poder crear fácilm...
wei-Z/Python-Machine-Learning
code/bonus/reading_mnist.ipynb
mit
%load_ext watermark %watermark -a 'Sebastian Raschka' -v -d # to install watermark just uncomment the following line: #%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py """ Explanation: Sebastian Raschka, 2015 https://github.com/rasbt/python-machine-learning-book Note that the optiona...
abitofalchemy/hrg_nets
peer_into_thrg.ipynb
gpl-3.0
# imports import networkx as nx %matplotlib inline import matplotlib.pyplot as plt params = {'legend.fontsize':'small', 'figure.figsize': (7,7), 'axes.labelsize': 'small', 'axes.titlesize': 'small', 'xtick.labelsize':'small', 'ytick.labelsize':'small'} plt.rcParams.upda...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-2/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-2', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-2 Sub-Topics: Radiative Forcings. Properties: 85 (42 ...
Bio204-class/bio204-notebooks
inclass-2016-02-24-CLT.ipynb
cc0-1.0
%matplotlib inline import numpy as np import scipy.stats as stats import pandas as pd import matplotlib.pyplot as plt import matplotlib """ Explanation: Standard Imports End of explanation """ import statplots """ Explanation: Imports from a custom module As you carry out your own analyses, probably build up a lib...
citxx/sis-python
crash-course/builtin-sort.ipynb
mit
a = [5, 3, -2, 9, 1] # Метод sort меняет существующий список a.sort() print(a) """ Explanation: <h1>Содержание<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Встроенная-сортировка" data-toc-modified-id="Встроенная-сортировка-1">Встроенная сортировка</a></span></li><li><spa...
mathnathan/notebooks
mpfi/Research Outline.ipynb
mit
x1 = np.random.uniform(size=500) x2 = np.random.uniform(size=500) plt.scatter(x1,x2); plt.xlim(-0.25,1.25); plt.ylim(-0.25,1.25) plt.grid(); plt.show() """ Explanation: Introduction What are the underlying biophysics that govern astrocyte behavior? To explore this question we have at our disposal a large dataset of ob...
B4cchus/wh40k-hitscalc
Mathhammer-Intro.ipynb
gpl-3.0
profiles[0] = {'shots': 10, 'p_hit': 1 / 2, 'p_wound': 1 / 2, 'p_unsaved': 4 / 6, 'damage': '1'} profile_damage = damage_dealt(profiles[0]) wound_chart(profile_damage, profiles) """ Explanation: Visual mathhammer for 8th edition Introduction to plots The charts and numbers below visually present the distribution of to...
jpwhite3/python-analytics-demo
Part_2.ipynb
cc0-1.0
from __future__ import division, unicode_literals import pandas as pd import numpy as np import matplotlib %matplotlib inline matplotlib.style.use('ggplot') """ Explanation: 1.) Import the modules we will need End of explanation """ df = pd.read_excel('./input/complete_data.xls') df.head() """ Explanation: 2.) Prev...
M0nica/python-foundations-hw
07/pandas_cheatsheet.ipynb
mit
# !workon dataanalysis import pandas as pd """ Explanation: 01: Building a pandas Cheat Sheet, Part 1 Use the csv I've attached to answer the following questions Import pandas with the right name End of explanation """ import matplotlib.pyplot as plt #DISPLAY MOTPLOTLIB INLINE WITH THE NOTEBOOK AS OPPOSED TO POP UP ...
sspickle/sci-comp-notebooks
P11-FourierSeries.ipynb
mit
L=1.0 N=500 # make sure N is even for simpson's rule A=1.0 def fLeft(x): return 2*A*x/L def fRight(x): return 2*A*(L-x)/L def fa_vec(x): """ vector version 'where(cond, A, B)', returns A when cond is true and B when cond is false. """ return np.where(x<L/2, fLeft(x), fRight(x)) x=np...
nerdcommander/scientific_computing_2017
lesson15/Lesson15_individual.ipynb
mit
# Planet class definition at the end of Part 1 """ Explanation: Lesson15 Individual Assignment Individual means that you do it yourself. You won't learn to code if you don't struggle for yourself and write your own code. Remember that while you can discuss the general (algorithmic) way to solve a problem, you should...
tpin3694/tpin3694.github.io
machine-learning/tokenize_text.ipynb
mit
# Load library from nltk.tokenize import word_tokenize, sent_tokenize """ Explanation: Title: Tokenize Text Slug: tokenize_text Summary: How to tokenize text from unstructured text data for machine learning in Python. Date: 2016-09-08 12:00 Category: Machine Learning Tags: Preprocessing Text Authors: Chris Albon Prel...
BinRoot/TensorFlow-Book
ch04_classification/Concept02_logistic.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt learning_rate = 0.01 training_epochs = 1000 """ Explanation: Ch 04: Concept 02 Logistic regression Import the usual libraries, and set up the usual hyper-parameters: End of explanation """ x1 = np.random.normal(-4, 2, 1000...
keras-team/keras-io
guides/ipynb/training_with_built_in_methods.ipynb
apache-2.0
import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers """ Explanation: Training & evaluation with the built-in methods Author: fchollet<br> Date created: 2019/03/01<br> Last modified: 2020/04/13<br> Description: Complete guide to training & evaluation with fit() and evaluate(). Setup...
Unidata/netcdf4-python
examples/writing_netCDF.ipynb
mit
import netCDF4 # Note: python is case-sensitive! import numpy as np """ Explanation: Writing netCDF data Important Note: when running this notebook interactively in a browser, you probably will not be able to execute individual cells out of order without getting an error. Instead, choose "Run All" from the Cell m...
JorisBolsens/PYNQ
Pynq-Z1/notebooks/examples/pmod_grove_light.ipynb
bsd-3-clause
from pynq import Overlay Overlay("base.bit").download() """ Explanation: Grove Light Sensor 1.1 This example shows how to use the Grove Light Sensor v1.1. You will also see how to plot a graph using matplotlib. The Grove Light Sensor produces an analog signal which requires an ADC. The Grove Light Sensor, PYNQ Grove A...
Upward-Spiral-Science/team1
code/Imaging Cortical Layers.ipynb
apache-2.0
from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt #%matplotlib inline import numpy as np import urllib2 import scipy.stats as stats np.set_printoptions(precision=3, suppress=True) url = ('https://raw.githubusercontent.com/Upward-Spiral-Science' '/data/master/syn-density/output.csv') data ...
csdms/pymt
notebooks/ku.ipynb
mit
# Load standard Python modules import numpy as np import matplotlib.pyplot as plt # Load PyMT model(s) import pymt.models ku = pymt.models.Ku() """ Explanation: Kudryavtsev Model Link to this notebook: https://github.com/csdms/pymt/blob/master/notebooks/ku.ipynb Install command: $ conda install notebook pymt_permamo...
gschivley/Index-variability
Notebooks/Capacity.ipynb
bsd-3-clause
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import os import pathlib from pathlib import Path import sys from os.path import join import json import calendar sns.set(style='white') idx = pd.IndexSlice """ Explanation: Calculate generation capacity by month This noteboo...
Unidata/unidata-python-workshop
notebooks/Model_Output/Downloading model fields with NCSS.ipynb
mit
# Resolve the latest GFS dataset import metpy from siphon.catalog import TDSCatalog # Set up access via NCSS gfs_catalog = ('http://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/' 'Global_0p5deg/catalog.xml?dataset=grib/NCEP/GFS/Global_0p5deg/Best') cat = TDSCatalog(gfs_catalog) ncss = cat.datasets[0]....
bmcfee/ismir2017_chords
notebooks/03 - Results.ipynb
bsd-2-clause
chordino = load_results('/home/bmcfee/git/chord_models/data/chordino/') dnn = load_results('/home/bmcfee/git/chord_models/data/ejh2015_dnn/') khmm = load_results('/home/bmcfee/git/chord_models/data/ejh2015_khmm/') plain = load_results('/home/bmcfee/working/chords/model/') aug = load_results('/home/bmcfee/working/ch...
yangw1234/BigDL
python/chronos/use-case/fsi/stock_prediction.ipynb
apache-2.0
import numpy as np import pandas as pd import os # S&P 500 FILE_NAME = 'all_stocks_5yr.csv' SOURCE_URL = 'https://github.com/CNuge/kaggle-code/raw/master/stock_data/' filepath = './data/'+ FILE_NAME filepath = os.path.join('data', FILE_NAME) print(filepath) # download data !if ! [ -d "data" ]; then mkdir data;...
d-k-b/udacity-deep-learning
gan_mnist/Intro_to_GANs_Solution.ipynb
mit
%matplotlib inline import pickle as pkl 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') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
harmsm/pythonic-science
labs/04_machine-learning/04_PCA-analysis_key.ipynb
unlicense
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from sklearn import datasets from sklearn.decomposition import PCA """ Explanation: Machine Learning End of explanation """ def load_pdb(pdb_file): f = open(pdb_file,'r') lines = f.readlines() f.close() all_coord = ...
fajifr/recontent
gensim_trial.ipynb
mit
doc1="Electron acceleration in a post-flare decimetric continuum source Prasad Subramanian, S. M. White, M. Karlický, R. Sych, H. S. Sawant, S. Ananthakrishnan(Submitted on 23 Mar 2007)Aims: To calculate the power budget for electron acceleration and the efficiency of the plasma emission mechanism in a post-flare decim...
dolittle007/dolittle007.github.io
notebooks/GLM-hierarchical.ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import pymc3 as pm import pandas as pd import theano data = pd.read_csv(pm.get_data('radon.csv')) data['log_radon'] = data['log_radon'].astype(theano.config.floatX) county_names = data.county.unique() county_idx = data.county_code.values n_countie...
astarostin/MachineLearningSpecializationCoursera
course2/week1/peer_review_linreg_height_weight.ipynb
apache-2.0
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Линейная регрессия и основные библиотеки Python для анализа данных и научных вычислений Это задание посвящено линейной регрессии. На примере прогнозирования роста человека по его весу Вы уви...
steven-murray/halomod
docs/examples/component-showcase.ipynb
mit
import halomod import hmf import numpy as np print(f"Using halomod v{halomod.__version__}") print(f"Using hmf v{hmf.__version__}") from halomod.bias import make_colossus_bias from halomod.concentration import make_colossus_cm """ Explanation: A Showcase of Components in halomod In this demo, we will showcase each and ...
gagneurlab/concise
nbs/PWM_initialization.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt # RBP PWM's from concise.data import attract dfa = attract.get_metadata() dfa # TF PWM's from concise.data import encode dfe = encode.get_metadata() dfe # TF PWM's from concise.data import hocomoco dfh = hocomoco.get_metadata() dfh """ Explanation: Initializing ...
jseabold/statsmodels
examples/notebooks/discrete_choice_example.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import logit print(sm.datasets.fair.SOURCE) print( sm.datasets.fair.NOTE) dta = sm.datasets.fair.load_pandas().data dta['affair'] = (dta['affai...
CitrineInformatics/lolo
python/examples/regression-example.ipynb
apache-2.0
%matplotlib inline from matplotlib import pyplot as plt from lolopy.learners import RandomForestRegressor from sklearn.ensemble import RandomForestRegressor as SKRFRegressor from sklearn.datasets import load_boston import numpy as np """ Explanation: Comparing Lolo and Scikit-Learn The purpose of this notebook is to c...
GoogleCloudPlatform/training-data-analyst
quests/endtoendml/labs/3_keras_wd.ipynb
apache-2.0
# Ensure the right version of Tensorflow is installed. !pip freeze | grep tensorflow==2.1 # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'] = BUCKET os.environ['PROJECT'] = PROJECT os.environ['REGION'] = RE...
bjsmith/motivation-simulation
test-jupyter-widgets-clone.ipynb
gpl-3.0
from matplotlib.pyplot import figure, plot, xlabel, ylabel, title, show from IPython.display import display text = widgets.FloatText() floatText = widgets.FloatText(description='MyField',min=-5,max=5) floatSlider = widgets.FloatSlider(description='MyField',min=-5,max=5) #https://ipywidgets.readthedocs.io/en/stable/...
mayank-johri/LearnSeleniumUsingPython
Section 2 - Advance Python/Chapter S2.12 - Weak Reference, Copy/copy.ipynb
gpl-3.0
import copy class MyTry: def __init__(self): self.lst = [1,2,3,4,5] a = MyTry() dup = copy.copy(a) a.lst.append(6) print(a.lst, dup.lst) print(id(a), id(dup)) import copy class MyTry: def __init__(self): self.lst = [1,2,3,4,5] a = MyTry() dup = copy.copy(a) a.lst.append(6) print(a.lst, du...
nicolas998/wmf
Examples/PrePara_Altavista_AguasAbajo.ipynb
gpl-3.0
%matplotlib inline from wmf import wmf import numpy as np import pylab as pl import datetime as dt import os ruta = '/media/nicolas/discoGrande/01_SIATA/' """ Explanation: Prepara Alta Vista Para Modelacion Se prepara la cuenca de alta vista para que sea modelada en el SIATA en tiempo real, en este caso se preparan ...
opalytics/opalytics-ticdat
examples/amplpy/netflow/netflow_other_data_sources.ipynb
bsd-2-clause
commodities = [['Pencils', 0.5], ['Pens', 0.2125]] # a one column table can just be a simple list nodes = ['Boston', 'Denver', 'Detroit', 'New York', 'Seattle'] cost = [['Pencils', 'Denver', 'Boston', 10.0], ['Pencils', 'Denver', 'New York', 10.0], ['Pencils', 'Denver', 'Seattle', 7.5], ['Pe...
emsi/wordvectors
Build OpenSubtitles Corpus.ipynb
mit
%%bash mkdir -p data truncatefile > data/OpenSubtitles2016.txt 2&> /dev/null echo "Truncated data/OpenSubtitles2016.txt" """ Explanation: OpenSubtitles corpus The following code was used to extract Polish OpenSubtitles corpus. It consists of ~775 milion tokens and ~143 milion sentences, vastly dialogues which makes it...
mne-tools/mne-tools.github.io
0.24/_downloads/2d3a2ce4cdcb2dad9804801c80816516/parcellation.ipynb
bsd-3-clause
# Author: Eric Larson <larson.eric.d@gmail.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD-3-Clause import mne Brain = mne.viz.get_brain_class() subjects_dir = mne.datasets.sample.data_path() + '/subjects' mne.datasets.fetch_hcp_mmp_parcellation(subjects_dir=subjects_dir, ...