repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
tensorflow/docs-l10n
site/ja/r1/tutorials/keras/basic_text_classification.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
crystalzhaizhai/cs207_yi_zhai
lectures/L18/L18.ipynb
mit
import sqlite3 """ Explanation: Lecture 18 Wednesday, November 8th, 2017 Databases with SQlite SQLite Exercises Today you will work with the candidates and contributors datasets to create a database in Python using SQLite. The exercises will consist of a sequence of steps to help illustrate basic commands. <a id='deli...
phoebe-project/phoebe2-docs
development/tutorials/latex_repr.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" import phoebe from phoebe import u # units import numpy as np logger = phoebe.logger() """ Explanation: Advanced: Parameter Latex Representation Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook ses...
mlund/faunus-notebooks
gvdw-interactive/gvdw.ipynb
mit
from __future__ import division, unicode_literals, print_function %matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy.integrate import quad from ipywidgets import interact from math import sqrt, pi plt.rcParams.update({'font.size': 14, 'figure.figsize': [6.0, 4.0]}) """ Explanation: Equati...
au9ustine/org.edx.cs100
lab0_student.ipynb
mit
# Check that Spark is working largeRange = sc.parallelize(xrange(100000)) reduceTest = largeRange.reduce(lambda a, b: a + b) filterReduceTest = largeRange.filter(lambda x: x % 7 == 0).sum() print reduceTest print filterReduceTest # If the Spark jobs don't work properly these will raise an AssertionError assert reduce...
DistrictDataLabs/yellowbrick
examples/ndanielsen/Missing Values Examples.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 import sys sys.path.append("./../..") %reload_ext yellowbrick %matplotlib inline # Imports import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib from sklearn.preprocessing import OneHotEncoder from yellowbrick.contrib.missing import MissingValue...
ray-project/ray
doc/source/ray-core/examples/highly_parallel.ipynb
apache-2.0
import ray import random import time import math from fractions import Fraction # Let's start Ray ray.init(address='auto') """ Explanation: Using Ray for Highly Parallelizable Tasks While Ray can be used for very complex parallelization tasks, often we just want to do something simple in parallel. For example, we may...
eaton-lab/toytree
docs/5-toytrees.ipynb
bsd-3-clause
import toytree import toyplot import numpy as np # load a tree for this tutorial tre = toytree.tree("https://eaton-lab.org/data/Cyathophora.tre") """ Explanation: ToyTree objects The main class object users interact with in toytree is called a ToyTree. This object contains a number of useful functions for interacting...
ksooklall/deep_learning_foundation
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...
ptpro3/ptpro3.github.io
Projects/Project5/Neural Networks Summary.ipynb
mit
# plot y = x-squared import matplotlib.pyplot as plt import numpy as np %matplotlib inline x = np.linspace(-5,5,1000) y = x**2 plt.plot(x,y); # create our function def f(x): return x**2 # define values epsilon = 1e-5 x = 4 # calculate delta y / delta x gradient = (f(x+epsilon) - f(x-epsilon)) / (2*epsilon) # ...
marmarko/ml101
tensorflow/examples/tutorials/deepdream/deepdream.ipynb
bsd-2-clause
# boilerplate code from __future__ import print_function import os from io import BytesIO import numpy as np from functools import partial import PIL.Image from IPython.display import clear_output, Image, display, HTML import tensorflow as tf """ Explanation: DeepDreaming with TensorFlow Loading and displaying the m...
neuro-data-science/neuro_data_science
python/basics/comparing_two_datasets.ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats import (ttest_ind, ttest_1samp, ttest_rel, wilcoxon, ks_2samp) from statsmodels.distributions.empirical_distribution import ECDF import statsmodels.api as sm %matplotlib inline """ Explanation: Comparing t...
molgor/spystats
notebooks/.ipynb_checkpoints/global_variogram-checkpoint.ipynb
bsd-2-clause
# Load Biospytial modules and etc. %matplotlib inline import sys sys.path.append('/apps') import django django.setup() import pandas as pd import numpy as np import matplotlib.pyplot as plt ## Use the ggplot style plt.style.use('ggplot') from external_plugins.spystats import tools %run ../testvariogram.py section.sha...
madsenmj/ml-introduction-course
Class10/Class10.ipynb
apache-2.0
import pandas as pd df = pd.read_csv('Class10_wine_data.csv') df.head() """ Explanation: Class 10 ML Techniques: Feature scaling Another aspect of optimizing machine learning algorithms is to think about feature scaling. When we use multiple numeric features as inputs to a regression or classification algorithm, the...
bsmithyman/zephyr
Demo 1 - Single forward problem [local].ipynb
mit
import numpy as np """ Explanation: Demo 1 - Single forward problem [local] Brendan Smithyman | bsmithym@uwo.ca | March, 2015 Import NumPy End of explanation """ import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib %matplotlib inline from IPython.display import set_matplotlib_formats set_ma...
betatim/BlackBox
examples/bayesian-optimization.ipynb
bsd-3-clause
import numpy as np np.random.seed(123) %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Bayesian optimization with skopt Gilles Louppe, Manoj Kumar July 2016. End of explanation """ noise_level = 0.1 def f(x, noise_level=noise_level): return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) + np.r...
dennys-bd/Coursera-Machine-Learning-Specialization
Course 2 - ML, Regression/week-4-ridge-regression-assignment-1-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 4: Ridge Regression (interpretation) In this notebook, we will run ridge regression multiple times with different L2 penalties to see which one produces the best fit. We will revisit the example of polynomial regression as a means to see the effect of L2 regularization....
ShinjiKatoA16/UCSY-sw-eng
Iterable object.ipynb
mit
# iterable objecct retuns iterator to iter() function s = 'abc' itr = iter(s) print(next(itr)) print(next(itr)) print(next(itr)) ## __iter__() function and __next__() function can be called directly as well x = s.__iter__() print(x.__next__()) print(next(x)) # StopIteration signal is raised after all items are ret...
robblack007/clase-dinamica-robot
Practicas/practica1/numerico.ipynb
mit
def f(x, t): # Se importan funciones matematicas necesarias from numpy import cos # Se desenvuelven las variables que componen al estado q1, q̇1 = x # Se definen constantes del sistema g = 9.81 m1, J1 = 0.3, 0.0005 l1 = 0.2 τ1 = 0 # Se calculan las variables a devolver por e...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_sensor_permutation_test.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import mne from mne import io from mne.stats import permutation_t_test from mne.datasets import sample print(__doc__) """ Explanation: Permutation T-test on sensor data One tests if the signal sign...
weikang9009/giddy
notebooks/DirectionalLISA.ipynb
bsd-3-clause
import libpysal import numpy as np from giddy.directional import Rose %matplotlib inline f = open(libpysal.examples.get_path('spi_download.csv'), 'r') lines = f.readlines() f.close() lines = [line.strip().split(",") for line in lines] names = [line[2] for line in lines[1:-5]] data = np.array([list(map(int, line[3:])...
danielgoncalvesti/BIGDATA2017
Atividade02/Lab/Lab2_Spark_PySpark.ipynb
gpl-3.0
ListaPalavras = ['gato', 'elefante', 'rato', 'rato', 'gato'] palavrasRDD = sc.parallelize(ListaPalavras, 4) print type(palavrasRDD) print palavrasRDD.collect() """ Explanation: Spark + Python = PySpark Esse notebook introduz os conceitos básicos do Spark através de sua interface com a linguagem Python. Como aplicação ...
guruucsd/EigenfaceDemo
python/Backprop Demo.ipynb
mit
import pickle dataset = pickle.load(open('data/cafe.pkl','r')) # or 'pofa.pkl' # This is the neural network class, for your information. from sklearn.decomposition import PCA from sklearn.learning_curve import learning_curve from sklearn.cross_validation import train_test_split from numpy.linalg import pinv from num...
mne-tools/mne-tools.github.io
dev/_downloads/99a2efbcf51159fbb58f12830f81525d/compute_csd.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # License: BSD-3-Clause from matplotlib import pyplot as plt import mne from mne.datasets import sample from mne.time_frequency import csd_fourier, csd_multitaper, csd_morlet print(__doc__) """ Explanation: Compute a cross-spectral density (CSD) matrix A cross-spe...
tensorflow/workshops
tfx_labs/Lab_4_Data_Validation.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...
phuijse/bagging_pu
PU_Learning_simple_example.ipynb
mit
N = 6000 known_labels_ratio = 0.1 X, y = make_moons(n_samples=N, noise=0.1, shuffle=True) rp = np.random.permutation(int(N/2)) data_P = X[y==1][rp[:int(len(rp)*known_labels_ratio)]] data_U = np.concatenate((X[y==1][rp[int(len(rp)*known_labels_ratio):]], X[y==0]), axis=0) print("Amount of labeled samples: %d" % (data_P....
mediagit2016/workcamp-maschinelles-lernen-grundlagen
20-10-28-ml-workcamp/wc-tf-data-preparation-10-aufgabe.ipynb
gpl-3.0
# import pandas as pd # Zum Arbeiten mit Series # Für die Normalisierung von Daten verwenden wir den MinMaxScaler # Definieren einer Panda Series # data=[11.0,201.0,301.0,41.0,501.0,601.0,701.0,81.0,901.0,1001.0] # Worin besteht hier das Problem ? data=[11.0,201.0,301.0,41.0,501.0,601.0,701.0,81.0,901.0,1001.0] # ...
fmaussion/cleo
examples/DataLevels.ipynb
gpl-3.0
import matplotlib as mpl import numpy as np from cleo.graphics import DataLevels %matplotlib inline a = np.array([-1., 0., 1.1, 1.9, 9.]) cm = mpl.cm.get_cmap('RdYlBu_r') """ Explanation: cleo.DataLevels examples End of explanation """ dl = DataLevels(a, cmap=cm) dl.visualize(orientation='horizontal', add_values=...
thalesians/tsa
src/jupyter/python/pypeincoming.ipynb
apache-2.0
import os, sys sys.path.append(os.path.abspath('../../main/python')) import thalesians.tsa.pypes as pypes pype = pypes.Pype(pypes.Direction.INCOMING, name='EXAMPLE', port=5758); pype """ Explanation: This Jupyter notebook should be used in conjunction with pypeoutgoing.ipynb. Run through the following cells... End o...
lamahechag/clubes_de_ciencia
Dia_2/Visualización de datos (calentamiento global).ipynb
mit
# ejemplo def mi_funcion(): return 'Clubes de Ciencia!!' print (mi_funcion()) #ejemplo def contar_letras(texto): n = len(texto) return n def contar_palabras(texto): lista = texto.split(' ') n = len(lista) return n def contar_palabras_letras(texto): palabras = contar_palabras(texto) ...
mromanello/SunoikisisDC_NER
participants_notebooks/Sunoikisis - Named Entity Extraction 1b_MR.ipynb
gpl-3.0
######## # NLTK # ######## import nltk from nltk.tag import StanfordNERTagger ######## # CLTK # ######## import cltk from cltk.tag.ner import tag_ner ############## # MyCapytain # ############## import MyCapytain from MyCapytain.resolvers.cts.api import HttpCTSResolver from MyCapytain.retrievers.cts5 import CTS from M...
bmbutle2/ethereum_blockchain
notebooks/feature_engineering.ipynb
gpl-3.0
df['txcnt_second'] = df['tx_count'].values / df['blockTime'].values df['avg_gasUsed_t_perblock'] = df.groupby('block_id')['gasUsed_t'].transform('mean') df['avg_price_perblock'] = df.groupby('block_id')['price_gwei'].transform('mean') def rolling_avg(window_size): price = df[['block_id', 'avg_price_perblock']...
heatseeknyc/data-science
src/bryan analyses/Hack for Heat #3.ipynb
mit
connection = psycopg2.connect('dbname = threeoneone user=threeoneoneadmin password=threeoneoneadmin') cursor = connection.cursor() """ Explanation: Hack for Heat #3: Number of complaints over time This time, we're going to look at raw 311 complaint data. The data that I was working with previously was summarized data....
Nozdi/first-steps-with-pandas-workshop
first-steps-with-pandas.ipynb
mit
import platform print('Python: ' + platform.python_version()) import numpy as np print('numpy: ' + np.__version__) import pandas as pd print('pandas: ' + pd.__version__) import scipy print('scipy: ' + scipy.__version__) import sklearn print('scikit-learn: ' + sklearn.__version__) import matplotlib as plt print('ma...
brclark-usgs/flopy
examples/Notebooks/flopy3_SpatialReference_demo.ipynb
bsd-3-clause
import sys sys.path.append('../..') import os import numpy as np import matplotlib.pyplot as plt import flopy from flopy.utils.reference import SpatialReference import flopy.utils.binaryfile as bf % matplotlib inline outpath = 'temp/' """ Explanation: FloPy SpatialReference demo A short demonstration of functionality...
andrew-lundgren/detchar
Notebooks/inverse_spectrum_truncation.ipynb
gpl-3.0
sample_rate = 4096 nyquist = sample_rate/2 time_length_seconds = 512 """ Explanation: We're going to simulate data discretely sampled in time. We need to set a sample rate in Hz. The highest resolvable frequency, the Nyquist frequency, is half the sample rate. We also need to decide how long the simulated data record ...
mathnathan/notebooks
mpfi/GMM in High Dimensions.ipynb
mit
import matplotlib #matplotlib.use('nbagg') import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from scipy import linalg from sklearn.mixture import GaussianMixture def generate_clusters(dims, num_pts=1000): clust1 = np.random.multivariate_normal([-0.5]*dims, np.eye(dims), num_...
Arn-O/kadenze-deep-creative-apps
session-1/lecture-1.ipynb
apache-2.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') """ Explanation: Session 1: Introduction to Tensorflow <p class='lead'> Creative Applications of Deep Learning with Tensorflow<br /> Parag K. Mital<br /> Kadenze, Inc.<br /> </p> <a name="learning-goals"></a> Learning Goals ...
cwehmeyer/pydpc
ipython/Example01.ipynb
lgpl-3.0
%matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from pydpc import Cluster from pydpc._reference import Cluster as RefCluster """ Explanation: Example and timings This notebook gives a short introduction in how to use pydpc for a simple clustering problem. End of explanati...
alfkjartan/control-computarizado
approximating-cont-controller/notebooks/First-order-hold sampling of lead compensator.ipynb
mit
h, b, a,K = sy.symbols('h, b, a, K', real=True, positive=True) s, z = sy.symbols('s, z', real=False) F = K*(s+b)/(s+a) U = F/s/s Up = sy.apart(U, s) Up from sympy.integrals.transforms import inverse_laplace_transform from sympy.abc import t u = sy.simplify(inverse_laplace_transform(Up, s, t)) u """ Explanation: Fir...
nudomarinero/mltier1
Match_LOFAR_combined_generic.ipynb
gpl-3.0
import numpy as np from astropy.table import Table, join from astropy import units as u from astropy.coordinates import SkyCoord, search_around_sky from IPython.display import clear_output import pickle import os from mltier1 import (get_center, Field, MultiMLEstimatorU, parallel_process, get_sigma_all) %load_ext aut...
GoogleCloudPlatform/asl-ml-immersion
notebooks/tfx_pipelines/guided_projects/guided_project_3_nlp_starter/keras_for_text_classification.ipynb
apache-2.0
import os import pandas as pd from google.cloud import bigquery %load_ext google.cloud.bigquery """ Explanation: Keras for Text Classification Learning Objectives 1. Learn how to create a text classification datasets using BigQuery 1. Learn how to tokenize and integerize a corpus of text for training in Keras 1. Lea...
dipanjank/ml
tensorflow/word_embeddings_in_tensorflow.ipynb
gpl-3.0
import numpy as np import tensorflow as tf %pylab inline pylab.style.use('ggplot') import pandas as pd """ Explanation: In this notebook, we will explore word embeddings based on the news articles in the Brown Corpus. Note that the content is heavily borrowed from the official tensorflow tutorial: https://www.tensorfl...
michaelaye/planet4
notebooks/user_name_encoding.ipynb
isc
from planet4 import io db = io.DBManager() data = db.get_all() from sklearn import preprocessing le = preprocessing.LabelEncoder() le.fit(data.user_name) len(le.classes_) data.user_name = le.transform(data.user_name) le.transform(data.tail().user_name) import pickle folder = Path('/Users/klay6683/Dropbox/data/p...
landmanbester/fundamentals_of_interferometry
7_Observing_Systems/7_5_primary_beam.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 7. Observing Systems Previous: 7.4 Digital Correlators Next: 7.6 Polarization and Antenna Feeds Import standard modules: End of ...
jorisvandenbossche/DS-python-data-analysis
_solved/pandas_06_data_cleaning.ipynb
bsd-3-clause
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: <p><font size="6"><b> Pandas: Methods for data cleaning</b></font></p> © 2021, Joris Van den Bossche and Stijn Van Hoey (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#100;&#101;&#110;&#98;&#111;&#115;&#115;&#99;&#104;&#101;&...
comp-journalism/Baseline_Problem_for_Algorithm_Audits
IMAGE_BOX/ImageAPI_analysis.ipynb
mit
def read_jsons(f, candidate): tmp_dict = {} with open(f) as json_file: data = json.load(json_file) for i in data[0]['scores']: if data[0]['scores'][i] > 0.55: # confidence score threshold. tmp_dict[i] = data[0]['scores'][i] else: tmp_dict[i] = n...
tpin3694/tpin3694.github.io
python/matplotlib_stacked_bar_plot.ipynb
mit
%matplotlib inline import pandas as pd import matplotlib.pyplot as plt import numpy as np """ Explanation: Title: Scatterplot In MatPlotLib Slug: matplotlib_stacked_bar_plot Summary: Scatterplot In MatPlotLib Date: 2016-05-01 12:00 Category: Python Tags: Data Visualization Authors: Chris Albon Based on: Sebastian R...
erikdrysdale/erikdrysdale.github.io
_rmd/extra_hrt/hrt_python_copy.ipynb
mit
# import the necessary modules import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.datasets import make_classification import seaborn as sns """ Explanation: The HRT for mixed data types (Python implementation) In my last post I showed how the holdout random test (HR...
AndreySheka/dl_ekb
hw9/Seminar9-ru-Avito.ipynb
mit
low_RAM_mode = True very_low_RAM = False #если у вас меньше 3GB оперативки, включите оба флага import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Использование глубокого обучения в NLP Смотрите в этой серии: * Простые способы работать с текстом, bag of words ...
vicolab/neural-network-intro
3-convnet/convolutional-network.ipynb
mit
# Plots will be displaying plots within the notebook %matplotlib notebook import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator # NumPy is a package for manipulating N-dimensional array objects import numpy as np # Pandas is a data analysis package import pandas as pd #Library To test/verify som...
hparik11/Deep-Learning-Nanodegree-Foundation-Repository
sentiment-network/Sentiment_Classification_Projects.ipynb
mit
def pretty_print_review_and_label(i): print(labels[i] + "\t:\t" + reviews[i][:80] + "...") g = open('reviews.txt','r') # What we know! reviews = list(map(lambda x:x[:-1],g.readlines())) g.close() g = open('labels.txt','r') # What we WANT to know! labels = list(map(lambda x:x[:-1].upper(),g.readlines())) g.close()...
ChildMindInstitute/HBN-wearable-analysis
analysis.ipynb
apache-2.0
%matplotlib inline %load_ext autoreload %autoreload 2 import readline # for R magics %load_ext rpy2.ipython import warnings from rpy2.rinterface import RRuntimeWarning warnings.filterwarnings("ignore", category=RRuntimeWarning) from utilities.chart_data import df_devices_qt, linechart, xcorr from config import config f...
sdpython/pyquickhelper
_unittests/ut_helpgen/notebooks_docx/td2a_TD5_Traitement_automatique_des_langues_en_Python.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() """ Explanation: Traitement automatique de la langue en Python End of explanation """ import httplib2 # pip install httplib2 import json # déjà installée, sinon : pip install json import apiclient.discovery # pip install google-api-python-client import...
bgroveben/python3_machine_learning_projects
introduction_to_ml_with_python/1_Introduction.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import pandas as pd import mglearn from IPython.display import display %matplotlib inline """ Explanation: Chapter 1: Introduction End of explanation """ import numpy as np x = np.array([[1,2,3],[4,5,6]]) print("x:\n{}".format(x)) """ Explanation: Essential Librar...
quantopian/research_public
notebooks/data/quandl.adp_empl_sec/notebook.ipynb
apache-2.0
# import the dataset from quantopian.interactive.data.quandl import adp_empl_sec # Since this data is public domain and provided by Quandl for free, there is no _free version of this # data set, as found in the premium sets. This import gets you the entirety of this data set. # import data operations from odo import ...
saketkc/notebooks
python/coursera-BayesianML/07_finding_suspect.ipynb
bsd-2-clause
%tensorflow_version 1.x """ Explanation: <a href="https://colab.research.google.com/github/saketkc/notebooks/blob/master/python/coursera-BayesianML/07_finding_suspect.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> First things first Click File -> ...
poppy-project/pypot
samples/notebooks/Record, Save, and Play Moves on a Poppy Creature.ipynb
gpl-3.0
from pypot.creatures import PoppyErgo poppy = PoppyErgo() for m in poppy.motors: m.compliant = False m.goal_position = 0.0 """ Explanation: Record, Save, and Play Moves on a Poppy Creature This notebook is still work in progress! Feedbacks are welcomed! In this tutorial we will show how to: * record moves by...
tensorflow/text
docs/guide/text_tf_lite.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...
giacomov/3ML
docs/notebooks/synthetic_spectra.ipynb
bsd-3-clause
from threeML import * import numpy as np %matplotlib inline jtplot.style(context="talk", fscale=1, ticks=True, grid=False) import matplotlib.pyplot as plt plt.style.use("mike") import warnings warnings.simplefilter("ignore") # Select an astromodels function to from which to simualte generating_function = Powerl...
jsignell/MpalaTower
inspection/inspect_raw_netcdf.ipynb
mit
usr = 'Julia' FILEDIR = 'C:/Users/%s/Dropbox (PE)/KenyaLab/Data/Tower/TowerData/'%usr NETCDFLOC = FILEDIR + 'raw_netcdf_output/' DATALOC = 'F:/towerdata/' """ Explanation: Inspect Raw Netcdf Playing around with efficient ways to merge and view netcdf data from the tower. This ipython notebook depends on the python sc...
seblabbe/MATH2010-Logiciels-mathematiques
NotesDeCours/13-boucle-for.ipynb
gpl-3.0
from __future__ import division, print_function # Python 3 from sympy import init_printing init_printing(use_latex='mathjax',use_unicode=False) # Affichage des résultats """ Explanation: $$ \def\CC{\bf C} \def\QQ{\bf Q} \def\RR{\bf R} \def\ZZ{\bf Z} \def\NN{\bf N} $$ Boucle for End of explanation """ for a in ran...
JackDi/phys202-2015-work
assignments/assignment08/InterpolationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import numpy as np from scipy.interpolate import interp1d """ Explanation: Interpolation Exercise 1 End of explanation """ # YOUR CODE HERE with np.load('trajectory.npz') as data: x = data['x'] t=data['t'] y=data['y'] plt.plo...
mne-tools/mne-tools.github.io
0.13/_downloads/plot_clickable_image.ipynb
bsd-3-clause
# Authors: Christopher Holdgraf <choldgraf@berkeley.edu> # # License: BSD (3-clause) from scipy.ndimage import imread import numpy as np from matplotlib import pyplot as plt from os import path as op import mne from mne.viz import ClickableImage, add_background_image # noqa from mne.channels import generate_2d_layout ...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/Introduction/1 - Introduction to Jupyter notebooks.ipynb
mit
## Example of a simple python code cell print "Hello little world" a = 1 ## The last statement in a cell prints its value a ## (this is sometimes a little confusing - add a pass statement to get rid of this !) #pass """ Explanation: Jupyter Notebooks We are going to be using jupyter notebooks for this course and ...
kitu2007/dl_class
dcgan-svhn/DCGAN_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat import tensorflow as tf !mkdir data """ Explanation: Deep Convolutional GANs In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De...
tensorflow/probability
tensorflow_probability/examples/jupyter_notebooks/TensorFlow_Probability_Case_Study_Covariance_Estimation.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
twhyntie/coding-challenges
01_particle_counting.ipynb
apache-2.0
# Import the data analysis tools we need from the Pandas toolkit. import pandas as pd ## Our pixel data stored as a Panda DataFrame. df000 = pd.read_table('./data/crookes/data000.txt', header=None, names=["x", "y", "C"]) # Show the first five rows of pixel data. df000.head() """ Explanation: Challenge 01: Particle C...
notenboomtest/MCDC_Graph
mcdc_algorithm.ipynb
bsd-3-clause
import graphviz as gv from IPython.display import display, Image import functools import re from datetime import datetime import os digraph = functools.partial(gv.Digraph, format='png') """ Explanation: Algorithm for MCDC with graph notation Description: This notebook converts a decision (a combination of predicates)...
scoaste/showcase
machine-learning/regression/week-5-lasso-assignment-2-completed.ipynb
mit
import graphlab """ Explanation: Regression Week 5: LASSO (coordinate descent) In this notebook, you will implement your very own LASSO solver via coordinate descent. You will: * Write a function to normalize features * Implement coordinate descent for LASSO * Explore effects of L1 penalty Fire up graphlab create Make...
QuantEcon/QuantEcon.notebooks
aiyagari_continuous_time.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import sparse from scipy.sparse.linalg import spsolve """ Explanation: Aiyagari (1994) in Continuous Time By SeHyoun Ahn and Benjamin Moll The material in this notebook is based on Achdou et al. (2015) "Heterogeneous Agent Models in Conti...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_artifacts_detection.ipynb
bsd-3-clause
import numpy as np import mne from mne.datasets import sample from mne.preprocessing import create_ecg_epochs, create_eog_epochs # getting some data ready data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif' raw = mne.io.read_raw_fif(raw_fname, preload=True) """ Explanation: In...
lionfish0/Classification_talk
ipython/.ipynb_checkpoints/Classification-checkpoint.ipynb
mit
from matplotlib import pyplot as plt #plotting library (lets us draw graphs) %matplotlib inline from sklearn import datasets #the datasets from sklearn digits = datasets.load_digits() #load the digits into the variable 'digits' """ Explanation: Classification The Digit Dataset For these classification examples we w...
batfish/pybatfish
jupyter_notebooks/Introduction to Route Analysis.ipynb
apache-2.0
# Import packages %run startup.py bf = Session(host="localhost") """ Explanation: Introduction to Route Computation and Analysis using Batfish Network engineers routinely need to validate routing and forwarding in the network. They often do that by connecting to multiple network devices and executing a series of show ...
MTG/essentia
src/examples/python/tutorial_rhythm_beatdetection.ipynb
agpl-3.0
import essentia.standard as es from tempfile import TemporaryDirectory # Loading an audio file. audio = es.MonoLoader(filename='../../../test/audio/recorded/dubstep.flac')() # Compute beat positions and BPM. rhythm_extractor = es.RhythmExtractor2013(method="multifeature") bpm, beats, beats_confidence, _, beats_interv...
bryantbiggs/movie_torrents
charts.ipynb
mit
# plotly validate with credentials with open('../_credentials/plotly.txt', 'r') as infile: user, pw = infile.read().strip().split(', ') plotly.tools.set_credentials_file(username=user, api_key=pw) text_color = 'rgb(107, 107, 107)' colors_dict = {'grey':'rgb(189, 195, 199)', 'aqua':'rgb( 54, 215, 183)', 'navy'...
ddandur/Twords
jupyter_example_notebooks/Examples of Tweet Collection.ipynb
mit
import sys sys.path.append('..') from twords.twords import Twords import matplotlib.pyplot as plt %matplotlib inline import pandas as pd # this pandas line makes the dataframe display all text in a line; useful for seeing entire tweets pd.set_option('display.max_colwidth', -1) twit_mars = Twords() # set path to fold...
tsivula/becs-114.1311
demos_pystan/diabetes.ipynb
gpl-3.0
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt # import stan interface import pystan # add utilities directory to path import os, sys util_path = os.path.abspath(os.path.join(os.path.pardir, 'utilities_and_data')) if util_path not in sys.path and os.path.exists(util_path): ...
jhprinz/openpathsampling
examples/tests/test_snapshot.ipynb
lgpl-2.1
import numpy as np import openpathsampling as paths import openpathsampling.engines.features as features from __future__ import print_function """ Explanation: Some testing and analysis of the new Snapshot implementation End of explanation """ from IPython.display import Markdown def code_to_md(snapshot_class): ...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-1/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-1', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-1 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balan...
mrustl/flopy
examples/Notebooks/flopy3_array_outputformat_options.ipynb
bsd-3-clause
%matplotlib inline import sys import os import platform import numpy as np import matplotlib.pyplot as plt import flopy #Set name of MODFLOW exe # assumes executable is in users path statement version = 'mf2005' exe_name = 'mf2005' if platform.system() == 'Windows': exe_name = 'mf2005.exe' mfexe = exe_name #Set...
jorisvandenbossche/DS-python-data-analysis
_solved/pandas_03a_selecting_data.ipynb
bsd-3-clause
import pandas as pd # redefining the example DataFrame data = {'country': ['Belgium', 'France', 'Germany', 'Netherlands', 'United Kingdom'], 'population': [11.3, 64.3, 81.3, 16.9, 64.9], 'area': [30510, 671308, 357050, 41526, 244820], 'capital': ['Brussels', 'Paris', 'Berlin', 'Amsterdam', 'Lo...
bcocanougher/errorbarjitter
errorbarjitter.ipynb
apache-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set_style('darkgrid') sns.set_context('talk') """ Explanation: Errorbarjitter Introduction The purpose of this script is to provide modular code for generating errorbarjitter plots using python and pan...
JarronL/pynrc
notebooks/Coronagraph_Basics.ipynb
mit
# Import the usual libraries import numpy as np import matplotlib import matplotlib.pyplot as plt # Enable inline plotting at lower left %matplotlib inline """ Explanation: Coronagraph Basics This set of exercises guides the user through a step-by-step process of simulating NIRCam coronagraphic observations of the HR...
quantopian/research_public
notebooks/data/eventvestor.mergers_and_acquisitions/notebook.ipynb
apache-2.0
# import the dataset from quantopian.interactive.data.eventvestor import mergers_and_acquisitions_free as dataset # or if you want to import the free dataset, use: #from quantopian.data.eventvestor import buyback_auth_free # import data operations from odo import odo # import other libraries we will use import pandas...
JJINDAHOUSE/deep-learning
weight-initialization/weight_initialization.ipynb
mit
%matplotlib inline import tensorflow as tf import helper from tensorflow.examples.tutorials.mnist import input_data print('Getting MNIST Dataset...') mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) print('Data Extracted.') """ Explanation: Weight Initialization In this lesson, you'll learn how to fin...
rdhyee/nypl50
build_all_gitenberg.ipynb
apache-2.0
from __future__ import print_function from itertools import (islice, izip) import arrow import github3 import requests from sqlalchemy import or_ from github_settings import (ry_username, ry_password, username, password, # token, ...
mlperf/training_results_v0.5
v0.5.0/google/cloud_v3.8/resnet-tpuv3-8/code/resnet/model/models/samples/outreach/demos/eager_execution.ipynb
apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/automaton.accessible.ipynb
gpl-3.0
import vcsn """ Explanation: automaton.accessible Create a new automaton from the accessible part of the input, i.e., the subautomaton whose states can be reached from an initial state. Preconditions: - None Postconditions: - Result.is_accessible() See also: - automaton.is_accessible - automaton.trim Examples End of e...
LimeeZ/phys292-2015-work
assignments/assignment04/TheoryAndPracticeEx02.ipynb
mit
from IPython.display import Image """ Explanation: Theory and Practice of Visualization Exercise 2 Imports End of explanation """ # Add your filename and uncomment the following line: Image(filename='StockPicture.png') """ Explanation: Violations of graphical excellence and integrity Find a data-focused visualizati...
gdsfactory/gdsfactory
docs/notebooks/00_geometry.ipynb
mit
import gdsfactory as gf # Create a blank component (essentially an empty GDS cell with some special features) c = gf.Component("myComponent") # Create and add a polygon from separate lists of x points and y points # (Can also be added like [(x1,y1), (x2,y2), (x3,y3), ... ] poly1 = c.add_polygon( [(-8, 6, 7, 9), (...
krosaen/ml-study
python-ml-book/ch04/ch04.ipynb
mit
import pandas as pd from io import StringIO csv_data = '''A,B,C,D 1.0,2.0,3.0,4.0 5.0,6.0,,8.0 10.0,11.0,12.0,''' df = pd.read_csv(StringIO(csv_data)) df """ Explanation: Chapter 4: building good training sets Handling missing values Let's start by constructing a simple dataset with some missing values. End of expla...
ericmjl/Network-Analysis-Made-Simple
notebooks/02-algorithms/03-structures.ipynb
mit
from IPython.display import YouTubeVideo YouTubeVideo(id="3DWSRCbPPJs", width="100%") """ Explanation: Introduction End of explanation """ from nams import load_data as cf G = cf.load_physicians_network() """ Explanation: If you remember, at the beginning of this book, we saw a quote from John Quackenbush that ess...
phanrahan/magmathon
notebooks/signal-generator/solutions/DDS.ipynb
mit
import math import numpy as np def sine(x): return np.sin(2 * math.pi * x) x = np.linspace(0., 1., num=256, endpoint=False) import magma as m m.set_mantle_target('ice40') import mantle def DefineDDS(n, has_ce=False): class _DDS(m.Circuit): name = f'DDS{n}' IO = ['I', m.In(m.UInt(n)), "O", m...
karlstroetmann/Algorithms
Python/Chapter-07/2-3-Trees-Frame.ipynb
gpl-2.0
import graphviz as gv """ Explanation: 2-3 Trees End of explanation """ class TwoThreeTree: sNodeCount = 0 def __init__(self): TwoThreeTree.sNodeCount += 1 self.mID = TwoThreeTree.sNodeCount def getID(self): return self.mID def isNil(self): retur...
briangoodwin/nd101_udacityDeepLearning
tv-script-generation/dlnd_tv_script_generation.ipynb
gpl-3.0
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scrip...
mne-tools/mne-tools.github.io
0.23/_downloads/fcc5782db3e2930fc79f31bc745495ed/60_ctf_bst_auditory.ipynb
bsd-3-clause
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr> # Eric Larson <larson.eric.d@gmail.com> # Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: BSD (3-clause) import os.path as op import pandas as pd import numpy as np import mne from mne import combine_evoked from mne.minimum_norm impor...
google/edward2
examples/notebooks/BayesianLSTM.ipynb
apache-2.0
import numpy as np import seaborn as sns import pandas as pd import tensorflow as tf import edward2 as ed import matplotlib.pyplot as plt from tqdm import tqdm from sklearn.model_selection import train_test_split, ParameterGrid from tensorflow.keras.preprocessing import sequence import embedded_reber_grammar as erg d...
bdestombe/flopy-1
examples/Notebooks/flopy3_uzf_example.ipynb
bsd-3-clause
%matplotlib inline import os import sys import glob import platform import shutil import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import flopy print(sys.version) print('numpy version: {}'.format(np.__version__)) print('matplotlib version: {}'.format(mpl.__version__)) pri...
smharper/openmc
examples/jupyter/unstructured-mesh-part-ii.ipynb
mit
import os from IPython.display import Image import openmc import openmc.lib assert(openmc.lib._dagmc_enabled()) """ Explanation: Unstructured Mesh Tallies with CAD Geometry in OpenMC In the first notebook on this topic, we looked at how to set up a tally using an unstructured mesh in OpenMC. In this notebook, we will...