repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
kunaltyagi/SDES
notes/python/Python_Batteries.ipynb
gpl-3.0
x = range(1, 20) y = "The quick brown fox jumps over the lazy dog." # print elements 2 to 4 print(x[2:5]) print(y[2:5]) # Print every third element starting from the first element print(x[::3]) print(y[::3]) # Print the second last element print(x[-2]) print(y[-2]) """ Explanation: Subsets of elements For lists and ...
gena/earthengine-api
python/examples/ipynb/authorize_notebook_server.ipynb
apache-2.0
import ee """ Explanation: Overview This notebook guides you through process of testing if the Jupyter Notebook server is authorized to access the Earth Engine servers, and provides a way to authorize the server, if needed. Testing if the Jupyter Notebook server is authorized to access Earth Engine To begin, first ver...
biof-309-python/BIOF309-2016-Fall
Week_06/Week 06 - 02 - Conditionals.ipynb
mit
print(3 == 5) print(3 > 5) print(3 <= 5) print(len("ATGC") > 5) print("GAATTC".count("T") > 1) print("ATGCTT".startswith("ATG")) print("ATGCTT".endswith("TTT")) print("ATGCTT".isupper()) print("ATGCTT".islower()) print("V" in ["V", "W", "L"]) """ Explanation: Conditions Source: This material adapted from the ...
JVillella/ml-playground
wiki2vec/wiki2vec.ipynb
mit
WIKIPEDIA_DUMP_PATH = './data/wiki-corpuses/enwiki-latest-pages-articles.xml.bz2' # Choose a path that the word2vec model should be saved to # (during training), and read from afterwards. WIKIPEDIA_W2V_PATH = './data/enwiki.model' """ Explanation: Wiki2vec Jupyter notebook for creating a Word2vec model from a Wikiped...
ShubhamDebnath/Coursera-Machine-Learning
Course 4/Autonomous driving application - Car detection - v3.ipynb
mit
import argparse import os import matplotlib.pyplot as plt from matplotlib.pyplot import imshow import scipy.io import scipy.misc import numpy as np import pandas as pd import PIL import tensorflow as tf from keras import backend as K from keras.layers import Input, Lambda, Conv2D from keras.models import load_model, Mo...
kubeflow/examples
pipelines/simple-notebook-pipeline/Simple Notebook Pipeline.ipynb
apache-2.0
# You may need to restart your notebook kernel after updating the kfp sdk !python3 -m pip install kfp --upgrade --user """ Explanation: Simple notebook pipeline Welcome to your first steps with Kubeflow Pipelines (KFP). This notebook demos: Defining a Kubeflow pipeline with the KFP SDK Creating an experiment and sub...
edosedgar/xs-pkg
deep_learning/hw3/homework03_part3b_prd_score_advanced.ipynb
gpl-2.0
import math import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as mlines import matplotlib import torch import sklearn CHANNEL_NUM = 3 PICTURE_SIZE = 36 class ParticleDataset(): def __init__(self, file): self.data = np.load(file) self.image = self.data['Pictures'].reshape(-...
diegocavalca/Studies
deep-learnining-specialization/4. Convolutional Neural Networks/resources/Residual Networks - v1.ipynb
cc0-1.0
import numpy as np from keras import layers from keras.layers import Input, Add, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D, AveragePooling2D, MaxPooling2D, GlobalMaxPooling2D from keras.models import Model, load_model from keras.preprocessing import image from keras.utils import layer_utils ...
rvm-segfault/edx
python_for_data_sci_dse200x/week3/Satellite Image Analysis using numpy.ipynb
apache-2.0
%matplotlib inline import numpy as np from scipy import misc import matplotlib.pyplot as plt """ Explanation: <p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"><br> Satellite Image Data <br><br><br>Analysis using numpy</p> <p style="font-family: Arial; font-size:1.75em;color:#2462C0; font-...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/SolveMathProblems/0 - IntroductionToNumericalSolutions.ipynb
mit
%pylab inline import numpy as np theta_0 = 1.0 time_values = np.linspace(0,1.0,1000) for const_k in [1.0, 3.1, 10.0, 31, 100.0]: exact_theta_values = theta_0 * np.exp(-const_k * time_values) plot(time_values, exact_theta_values) pass """ Explanation: Numerical models We start with the numerical solution...
ssunkara1/bqplot
examples/Marks/Object Model/Pie.ipynb
apache-2.0
data = np.random.rand(3) pie = Pie(sizes=data, display_labels='outside') # Set `animation_duration` (in milliseconds) to have smooth transitions fig = Figure(marks=[pie], animation_duration=1000) fig """ Explanation: Basic Pie Chart End of explanation """ n = np.random.randint(1, 10) pie.sizes = np.random.rand(n) "...
harish-garg/Machine-Learning
udacity/enron/ud120-projects-master/final_project/.ipynb_checkpoints/Data Exploration and Cleanup-checkpoint.ipynb
mit
print "print out some values of the observation 'TOTAL'" for name, person in data_dict.iteritems(): if name == 'TOTAL': print person salary = [] for name, person in data_dict.iteritems(): if float(person['salary']) > 0: salary.append(float(person['salary'])) print "the sum of salary of all other person...
tpin3694/tpin3694.github.io
python/matplotlib_pie_chart.ipynb
mit
%matplotlib inline import pandas as pd import matplotlib.pyplot as plt """ Explanation: Title: Pie Chart In MatPlotLib Slug: matplotlib_pie_chart Summary: Pie Chart In MatPlotLib Date: 2016-05-01 12:00 Category: Python Tags: Data Visualization Authors: Chris Albon Based on: Sebastian Raschka. Preliminaries End of ex...
ereodeereigeo/dataTritiumWS22
.ipynb_checkpoints/numero_de_datos_perdidos_slide-checkpoint.ipynb
gpl-2.0
import pandas as pd """ Explanation: Número de datos obtenidos y perdidos Importamos las librerías necesarias End of explanation """ import ext_datos as ext import procesar as pro import time_plot as tplt """ Explanation: Importamos las librerías creadas para trabajar End of explanation """ dia1 = ext.extraer_da...
probml/pyprobml
notebooks/book1/15/kernel_regression_attention.ipynb
mit
import numpy as np import matplotlib.pyplot as plt np.random.seed(seed=1) import math import collections try: import torch except ModuleNotFoundError: %pip install -qq torch import torch from torch import nn from torch.nn import functional as F try: from probml_utils import d2l except ModuleNotFoundE...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-veg-lr/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-veg-lr', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-VEG-LR Topic: Land Sub-...
nadvamir/deep-learning
sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
brian-rose/ClimateModeling_courseware
Lectures/Lecture17 -- Heat transport.ipynb
mit
# Ensure compatibility with Python 2 and 3 from __future__ import print_function, division """ Explanation: ATM 623: Climate Modeling Brian E. J. Rose, University at Albany Lecture 17: Heat transport Warning: content out of date and not maintained You really should be looking at The Climate Laboratory book by Brian R...
jenshnielsen/HJCFIT
exploration/CH82 -- optimization.ipynb
gpl-3.0
from dcprogs import read_idealized_bursts from dcprogs.likelihood import QMatrix name = "CH82.scn" tau = 1e-4 tcrit = 4e-3 graph = [["V", "V", "V", 0, 0], ["V", "V", 0, "V", 0], ["V", 0, "V", "V", "V"], [ 0, "V", "V", "V", 0], [ 0, 0, "V", 0, "V"]] nop...
mne-tools/mne-tools.github.io
stable/_downloads/f47934a488455dcef7b3567776837d1a/limo_data.ipynb
bsd-3-clause
# Authors: Jose C. Garcia Alanis <alanis.jcg@gmail.com> # # License: BSD-3-Clause import numpy as np import matplotlib.pyplot as plt from mne.datasets.limo import load_data from mne.stats import linear_regression from mne.viz import plot_events, plot_compare_evokeds from mne import combine_evoked print(__doc__) # ...
MRod5/pyturb
notebooks/ISA examples.ipynb
mit
# Import isa library from pyturb.gas_models import isa import numpy as np from matplotlib import pyplot as plt """ Explanation: ISA: Example of usage This Notebook serves as an example on how to use the Standard Atmosphere model provided with pyTurb. The isa functions can be found in the gas_models folder: pyturb ga...
wbinventor/openmc
examples/jupyter/pincell.ipynb
mit
%matplotlib inline import openmc """ Explanation: This notebook is intended to demonstrate the basic features of the Python API for constructing input files and running OpenMC. In it, we will show how to create a basic reflective pin-cell model that is equivalent to modeling an infinite array of fuel pins. If you have...
dvirsamuel/MachineLearningCourses
Visual Recognision - Stanford/assignment2/.ipynb_checkpoints/FullyConnectedNets-checkpoint.ipynb
gpl-3.0
# As usual, a bit of setup import time import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n...
weiquan/notebook
notebook/BWT.ipynb
mit
seq = 'ACAGGAGAGATACCCAGG' seq += '$' suffixes = [seq[i:] for i in xrange(len(seq))] suffixes SA = range(len(seq)) print SA SA.sort(key=lambda x:seq[x:]) SA print 'suffix'.ljust(20), 'SA' for i in SA: print seq[i:].ljust(20), i """ Explanation: 2BWT 1. Suffix Array End of explanation """ bwt = ''.join([seq...
mohanprasath/Course-Work
coursera/python_for_data_science/2.2_Lists.ipynb
gpl-3.0
L = ["Michael Jackson" , 10.1,1982] L """ Explanation: <a href="http://cocl.us/topNotebooksPython101Coursera"><img src = "https://ibm.box.com/shared/static/yfe6h4az47ktg2mm9h05wby2n7e8kei3.png" width = 750, align = "center"></a> <a href="https://www.bigdatauniversity.com"><img src = "https://ibm.box.com/shared/static/...
CAChemE/curso-python-datos
notebooks/071-AEMET-Santander-weather.ipynb
bsd-3-clause
import requests # Cargamos la api key api_key = open("../../apikey-aemet.txt").read().rstrip() querystring = {"api_key": api_key} """ Explanation: API-REST: AEMET OPEN DATA En este notebook veremos otro ejemplo de uso de la api open data de AEMET. En este caso obtendremos parámetros medidos por una estación meteorol...
kuo77122/deep-learning-nd
Lesson15-TFLearn/Handwritten Digit Recognition with TFLearn.ipynb
mit
# Import Numpy, TensorFlow, TFLearn, and MNIST data import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist """ Explanation: Handwritten Number Recognition with TFLearn and MNIST In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9. This...
ES-DOC/esdoc-jupyterhub
notebooks/test-institute-2/cmip6/models/sandbox-2/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-2', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: TEST-INSTITUTE-2 Source ID: SANDBOX-2 Topic: Atmoschem Sub-Topic...
ueapy/ueapy.github.io
content/notebooks/2021-02-11-python-reuse.ipynb
mit
import numpy as np import matplotlib.pyplot as plt """ Explanation: This tutorial shows various methods of reusing your Python code. The follow up tutorial on packaging code will explore ways to make code reusable by others. End of explanation """ def go_figure(): figure, axes = plt.subplots(2, 2, figsize=(10,6)...
quantopian/research_public
notebooks/lectures/Beta_Hedging/notebook.ipynb
apache-2.0
# Import libraries import numpy as np from statsmodels import regression import statsmodels.api as sm import matplotlib.pyplot as plt import math # Get data for the specified period and stocks start = '2014-01-01' end = '2015-01-01' asset = get_pricing('TSLA', fields='price', start_date=start, end_date=end) benchmark ...
ES-DOC/esdoc-jupyterhub
notebooks/bnu/cmip6/models/sandbox-1/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bnu', 'sandbox-1', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: BNU Source ID: SANDBOX-1 Sub-Topics: Radiative Forcings. Properties: 85 (42 re...
HUDataScience/StatisticalMethods2016
notebooks/Basic_Python.ipynb
apache-2.0
for i in range(10): y = i*40 +i**2 + 2 print(y) i = i+2 range(10) for i in ["a","b","tt"]: print i x = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],[2, 1, 2, 3, 4, 5, 6, 7, 8, 9],[0,5, 2, 3, 4, 5, 6, 7, 8, 9]] print(x) np.mean(x) x= np.linspace(-1,1,100) x x[[34,67]] x[45:90] x[::3] x[10::3] x[::-1] x= [0...
Kapani/BDDoctor
BMA data extraction notebook.ipynb
gpl-3.0
#Load the necessary modules from mechanize import Browser import pandas as pd from IPython.core.display import HTML import requests """ Explanation: Bangladesh Medical Association(BMA) member data extraction Version : 1.0<br> Date : 2015-05-21 This notebook will illustrate the approach undertaken to extract the BMA do...
daviddesancho/MasterMSM
examples/mueller_potential/mueller_potential.ipynb
gpl-2.0
%matplotlib inline %load_ext autoreload %autoreload 2 import time import numpy as np import scipy.stats import matplotlib.pyplot as plt import seaborn as sns sns.set(style="ticks", color_codes=True, font_scale=1.5) sns.set_style({"xtick.direction": "in", "ytick.direction": "in"}) from collections import OrderedDict ""...
ramseylab/networkscompbio
class04_storage_python3_template.ipynb
apache-2.0
import numpy as np import igraph import timeit import itertools """ Explanation: Class Session 4 Exercise: Comparing asymptotic running time for enumerating neighbors of all vertices in a graph We will measure the running time for enumerating the neighbor vertices for three different data structures for representing a...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_corrmap_detection.ipynb
bsd-3-clause
# Authors: Jona Sassenhagen <jona.sassenhagen@gmail.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import mne from mne.io import Raw from mne.preprocessing import ICA from mne.preprocessing.ica import corrmap from mne.datasets import sample print(__doc__) """ Explanation: Iden...
DB2-Samples/db2jupyter
Db2 Regular Expressions.ipynb
apache-2.0
%run db2.ipynb """ Explanation: <a id='top'></a> Db2 Regular Expressions Db2 11.1 introduced extended support for regular expressions. Regular expressions allow you to do very complex pattern matching in character strings. Normal SQL LIKE searches are limited to very specific patterns, but Regular expression have a ri...
eaton-lab/toytree
sandbox/26-highlight-clades.ipynb
bsd-3-clause
import toytree import toyplot # generate a random tree tre = toytree.rtree.unittree(ntips=10, treeheight=100, seed=123) """ Explanation: Issue 26: highlight clades I've created an early form of an Annotator class object that can be used to add highlights to a toytree drawing. Possible extensions: - apply linear gr...
amitkaps/hackermath
Module_1b_linear_regression_ols.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.style.use('fivethirtyeight') plt.rcParams['figure.figsize'] = (10, 6) import ipywidgets as widgets from ipywidgets import interact, interactive price = np.array([199, 248, 302, 363, 418, 462, 523]) kmpl = np.array([23.9, 22.7, 21.1, 20.5, 19....
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-hr/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-hr', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-HR Topic: Seaice Sub-To...
DawesLab/LabNotebooks
Variable pitch solenoid design-Copy1.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import matplotlib as mpl mpl.rcParams['legend.fontsize'] = 10 from mpl_toolkits.mplot3d import Axes3D from scipy.optimize import leastsq from math import acos, atan2, cos, sin from numpy import array, float64, zeros from numpy.linalg import norm #%matplotlib inline "...
michimichi/compartmentmodels
PracticalModelFitting.ipynb
bsd-3-clause
import numpy as np # plotting and graphics settings import matplotlib.pyplot as plt %pylab inline try: import seaborn as sns # pretty graphics. not strictly necessary. sns.set_context("notebook") sns.set_style("whitegrid") except: pass # with less pretty graphics """ Explanation: Practical model f...
pyro-ppl/numpyro
notebooks/source/ordinal_regression.ipynb
apache-2.0
# !pip install -q numpyro@git+https://github.com/pyro-ppl/numpyro from jax import numpy as np, random import numpyro from numpyro import sample, handlers from numpyro.distributions import ( Categorical, Dirichlet, ImproperUniform, Normal, OrderedLogistic, TransformedDistribution, constraint...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/deep-learning/theano-tutorial/scan_tutorial/scan_tutorial.ipynb
mit
import theano import theano.tensor as T import numpy as np vector1 = T.vector('vector1') vector2 = T.vector('vector2') """ Explanation: Introduction to Scan in Theano Credits: Forked from summerschool2015 by mila-udem In short Mechanism to perform loops in a Theano graph Supports nested loops and reusing results fro...
marioberges/F16-12-752
homeworks/homework3/homework3_solution_henningl.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import pandas as pd import pickle %matplotlib inline """ Explanation: 12-752: Data-Driven Building Energy Management Fall 2016, Carnegie Mellon University Assignment #3 We will begin by unpickling the dataset containing the loadCurves that we had used in Assignment #...
maxis42/ML-DA-Coursera-Yandex-MIPT
1 Mathematics and Python/Homework/3 central limit theorem/Central limit theorem.ipynb
mit
#импортирование необходимых библиотек import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy.stats as sts from math import sqrt %matplotlib inline """ Explanation: Центральная предельная теорема Для своего домашнего задания я выбрал распределение Парето, которое присутствует в scipy.stats....
wgm2111/wgm-optimization-sandbox
examples/radon_transform/plot_radon_transform.ipynb
gpl-2.0
from __future__ import print_function, division import numpy as np import matplotlib.pyplot as plt from skimage.io import imread from skimage import data_dir from skimage.transform import radon, rescale image = imread(data_dir + "/phantom.png", as_grey=True) print(image.shape) image = rescale(image, scale=0.4) fi...
srcole/qwm
sfn/.ipynb_checkpoints/Poster viewer distribution by country-checkpoint.ipynb
mit
%config InlineBackend.figure_format = 'retina' %matplotlib inline import numpy as np import scipy as sp import matplotlib.pyplot as plt import seaborn as sns sns.set_style('white') import pandas as pd # Load data df = pd.DataFrame.from_csv('./posterviewers_by_country.csv') key_N = 'Number of people' """ Explanatio...
uranc/locmea
tutorials/Data_Analysis.ipynb
gpl-3.0
# Data path/filename t_ind = 38 data_path = '../data/' file_name = data_path + 'data_sim_low.hdf5' data_options = {'flag_cell': True, 'flag_electode': False} data = data_in(file_name, **data_options) """ Explanation: The task in this tutorial is to load some data, visualize, and analyze it. Let's start by adding the ...
Faris137/MachineLearningArabic
Pima Project/Pima Project.ipynb
mit
import numpy as np import pandas as pd df = pd.read_csv('diabetes.csv') df.head() #لاستعراض ال5 السجلات الاولى من إطار البيانات """ Explanation: Loading the dataset into a pandas dataframe تحميل قاعدة البيانات من ملف سي اس في الى إطاربيانات بانداس End of explanation """ columns = ['Pregnancies', 'Glucose', 'BloodPr...
ageron/ml-notebooks
05_support_vector_machines.ipynb
apache-2.0
# To support both python 2 and python 3 from __future__ import division, print_function, unicode_literals # Common imports import numpy as np import os # to make this notebook's output stable across runs np.random.seed(42) # To plot pretty figures %matplotlib inline import matplotlib as mpl import matplotlib.pyplot ...
hugues-talbot/optimization_textbook
Scripts/EEG.ipynb
cc0-1.0
%matplotlib inline # standard signal processing packages import numpy as np import scipy as sp import scipy.signal as sig import matplotlib.pyplot as plt ## learning from sklearn.svm import SVC sampling = 20 # Sampling rate in Hz """ Explanation: Electro-encephalogram simulation and analysis Hugues Talbot, 17 Dec...
NathanYee/ThinkBayes2
code/.ipynb_checkpoints/chap07mine-checkpoint.ipynb
gpl-2.0
from __future__ import print_function, division % matplotlib inline import warnings warnings.filterwarnings('ignore') import math import numpy as np from thinkbayes2 import Pmf, Cdf, Suite, Joint import thinkplot """ Explanation: Think Bayes: Chapter 7 This notebook presents code and exercises from Think Bayes, sec...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session09/Day3/LIGO_data_visualization.ipynb
mit
#! python3 -m pip install gwpy """ Explanation: Welcome to the LIGO data visualization tutorial! Installation Please make sure you have GWpy installed before you begin! Only execute the below cell if you have not already installed GWpy End of explanation """ from gwosc.datasets import find_datasets find_datasets() ...
CSB-book/CSB
regex/solutions/MapOfScience_solution.ipynb
gpl-3.0
import re import csv """ Explanation: Solution of 5.9.2, Map of Science Read the file pubmed_results.txt, and extract all the US ZIP codes. First, import the modules we'll need. End of explanation """ with open('../data/MapOfScience/pubmed_results.txt') as f: my_text = f.read() len(my_text) """ Explanation: No...
joshspeagle/dynesty
demos/Examples -- Gaussian Shells.ipynb
mit
# system functions that are always useful to have import time, sys, os # basic numeric setup import numpy as np import math # inline plotting %matplotlib inline # plotting import matplotlib from matplotlib import pyplot as plt # seed the random number generator rstate = np.random.default_rng(715) # re-defining pl...
tmm/DS501
lectures/05 Basic Statistics, Probability, and Linear Algebra/BaseRateFallacy.ipynb
mit
FailAndHasDisease = 1.0 NotFailAndHasDisease = 0.0 FailAndNotHasDisease = 0.01 NotFailAndNotHasDisease = 0.99 HasDisease = 1./1000 """ Explanation: Base rate fallacy example In this notenook we work an example of the base rate fallacy using Bayes Theorem. Assume that we have two random variables $HasDisease$ and $Fa...
phoebe-project/phoebe2-docs
2.0/tutorials/l3.ipynb
gpl-3.0
!pip install -I "phoebe>=2.0,<2.1" """ Explanation: "Third" Light 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 inline import...
vanessajurtz/lasagne4bio
subcellular_localization/notebook tutorial/CNN.ipynb
gpl-3.0
# Import all the necessary modules import os os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,optimizer=None,device=cpu,floatX=float32" import sys sys.path.insert(0,'..') import numpy as np import theano import theano.tensor as T import lasagne from confusionmatrix import ConfusionMatrix from utils import iterate_minibatche...
CPernet/LanguageDecision
notebooks/individuals/analysis_controls.ipynb
gpl-3.0
""" Environment setup """ %matplotlib inline %cd /lang_dec import warnings; warnings.filterwarnings('ignore') import hddm import numpy as np import matplotlib.pyplot as plt from utils import model_tools # Import control subject data (as pandas dataframe) controls_data = hddm.load_csv('/lang_dec/data/controls_clean.cs...
QInfer/qinfer-examples
Noisy Coin Example.ipynb
agpl-3.0
from __future__ import division, print_function """ Explanation: Noisy Coin Example License Introduction Preamble We turn on the division feature first of all, since this is just a plain good idea when working in Python 2.x, as it is a more sensible default for scientific computing and is the default in Python 3.x any...
yl565/statsmodels
examples/notebooks/mixed_lm_example.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import statsmodels.api as sm import statsmodels.formula.api as smf %load_ext rpy2.ipython %R library(lme4) """ Explanation: Linear Mixed Effects Models End of explanation """ data = sm.datasets.get_rdataset('dietox', 'geepack').data md = smf.mixedlm("Weight ~ Time", data, gro...
azubiolo/itstep
it_step/intro_ml/lab_3/regression_lab.ipynb
mit
%matplotlib inline import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) """ Explanation: Introduction to Machine Learning with scikit-learn Lab 3: Regression The goal of this lab session is to discover a few regression tools from scikit-learn. As for the classification lab, we will start wit...
opesci/tutorial-hands-on
01_introduction.ipynb
mit
from devito import * from sympy import init_printing, symbols, solve init_printing(use_latex=True) """ Explanation: Automated finite difference operators from symbolic equations This notebook is the first in a series of hands-on tutorial notebooks that are intended to give a brief practical overview of the Devito fini...
tensorflow/probability
tensorflow_probability/examples/jupyter_notebooks/Linear_Mixed_Effects_Models.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...
TangqiFeng/Jupyter_numpy_pyplot
Fisher's_Iris.ipynb
apache-2.0
# numpy efficiently deals with numerical multi-dimensional arrays. import numpy as np # matplotlib is a plotting library, and pyplot is its easy-to-use module. import matplotlib.pyplot as pl # This just sets the default plot size to be bigger. pl.rcParams['figure.figsize'] = (16.0, 8.0) """ Explanation: Fisher's Iri...
dani-lbnl/2017_ucberkeley_course
code/ZeissMicroscopyCenter2017_DaniUshizima_lecture.ipynb
gpl-3.0
%matplotlib inline import numpy as np from matplotlib import pyplot as plt from skimage import data, io fname = 'http://crl.berkeley.edu/files/2014/04/Holly-226x300.jpg' imageFromWeb = data.imread(fname, as_grey=False, plugin=None, flatten=None) plt.imshow(imageFromWeb) """ Explanation: Image exploration using Pytho...
sisnkemp/deep-learning
sentiment-rnn/Sentiment_RNN.ipynb
mit
import numpy as np import tensorflow as tf with open('../sentiment-network/reviews.txt', 'r') as f: reviews = f.read() with open('../sentiment-network/labels.txt', 'r') as f: labels = f.read() reviews[:2000] """ Explanation: Sentiment Analysis with an RNN In this notebook, you'll implement a recurrent neural...
phoebe-project/phoebe2-docs
development/examples/extinction_eclipse_depth_v_teff.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Extinction: Eclipse Depth Difference as Function of Temperature In this example, we'll reproduce Figure 3 in the extinction release paper (Jones et al. 2020). NOTE: this script takes a long time to run. <img src="jones+20_fig3.png" alt="Figure 3" width="800px"/> Set...
chemelnucfin/tensorflow
tensorflow/contrib/autograph/examples/notebooks/rnn_keras_estimator.ipynb
apache-2.0
def parse(line): """Parses a line from the colors dataset.""" items = tf.string_split([line], ",").values rgb = tf.string_to_number(items[1:], out_type=tf.float32) / 255.0 color_name = items[0] chars = tf.one_hot(tf.decode_raw(color_name, tf.uint8), depth=256) length = tf.cast(tf.shape(chars)[0], dtype=tf.i...
Fifth-Cohort-Awesome/NightThree
three_agd.ipynb
mit
with open('tmdb_5000_movies.csv','r') as f: rtext='' for line in f: rtext += line rtext[:500] """ Explanation: Goal One Injest a csv file as pure text... (just 500 chars) End of explanation """ with open('tmdb_5000_movies.csv','r') as f: lines = [line for line in f] lines[0] """ Explanation: The...
snbhanja/A-Z-Machine-Learning---Udemy-
Part-2-Regression/P2-Multiple_Linear_Regression.ipynb
mit
# Import the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd #importing the datset dataset = pd.read_csv('datasets/50_Startups.csv') dataset.head() X = dataset.iloc[:, :-1].values Y = dataset.iloc[:, 4].values X Y # But there is categorical variable. i.e. independent varaible Stat...
tensorflow/docs-l10n
site/ko/probability/examples/Bayesian_Switchpoint_Analysis.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...
csdms/pymt
notebooks/hydrotrend.ipynb
mit
# To start, import numpy and matplotlib. import matplotlib.pyplot as plt import numpy as np # Then we import the package import pymt.models hydrotrend = pymt.models.Hydrotrend() import pymt pymt.__version__ """ Explanation: HydroTrend Link to this notebook: https://github.com/csdms/pymt/blob/master/notebooks/hydr...
gjwo/nilm_gjw_data
notebooks/disaggregation-hart-active_only.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...
marco-olimpio/ufrn
IMD0104 - PROGRAMAÇÃO ORIENTADA A OBJETOS E MAPEAMENTO OBJETO-RELACIONAL/assignments/3/IMD0104 - TerceiraUnidade.ipynb
gpl-3.0
!pip install cufflinks import pandas as pd import numpy as np from matplotlib import pyplot as plt plt.style.use('ggplot') import seaborn as sns # for making plots with seaborn color = sns.color_palette() sns.set(rc={'figure.figsize':(25,15)}) import plotly plotly.offline.init_notebook_mode(connected=True) import pl...
swirlingsand/deep-learning-foundations
gans/batch-norm/Batch_Normalization_Lesson.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) "...
rbberger/lammps
python/examples/pylammps/simple.ipynb
gpl-2.0
from lammps import IPyLammps L = IPyLammps() """ Explanation: Example 1: Using LAMMPS with PyLammps The LAMMPS Python package provides multiple interfaces. The PyLammps interface is a high-level abstration of the low-level lammps interface. IPyLammps further extends this interface with functions that are useful for Ju...
dipanjank/ml
tensorflow/introduction.ipynb
gpl-3.0
import tensorflow as tf one = tf.constant(1, dtype=np.float64) two = tf.constant(2, dtype=np.float64) print(one) print(two) three = one + two print(three) three.op """ Explanation: The TensorFlow API TensorFlow provides multiple APIs. The lowest level API, TensorFlow Core, provides you with complete programmi...
joelgrus/codefellows-data-science-week
ipynb/pandas bikes.ipynb
unlicense
from pandas import DataFrame, Series import pandas as pd import numpy as np """ Explanation: Standard pandas imports End of explanation """ weather = pd.read_table('daily_weather.tsv', parse_dates=['date']) stations = pd.read_table('stations.tsv') usage = pd.read_table('usage_2012.tsv', parse_dates=['time_start', 't...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch1-Problem_1-08.ipynb
unlicense
%pylab notebook %precision 4 from scipy import constants as c # we like to use some constants """ Explanation: Excercises Electric Machinery Fundamentals Chapter 1 Problem 1-8 End of explanation """ mu_r = 2000 mu = mu_r * c.mu_0 """ Explanation: Description A core with three legs is shown in Figure P1-5 below: <...
pdwyys20/deep-learning
intro-to-tflearn/TFLearn_Sentiment_Analysis_Solution.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
AllenDowney/ModSimPy
notebooks/jump.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * """ Explanation: Modeling and Simulati...
phockett/ePSproc
notebooks/LF_AF_verification_tests_260620_tidy.ipynb
gpl-3.0
# Imports import numpy as np import pandas as pd import xarray as xr # Special functions # from scipy.special import sph_harm import spherical_functions as sf import quaternion # Performance & benchmarking libraries # from joblib import Memory # import xyzpy as xyz import numba as nb # Timings with ttictoc or time #...
deimagjas/qubits.cloud.AI
dlnd_image_classification.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ from urllib.request import urlretrieve from os.path import isfile, isdir from tqdm import tqdm import problem_unittests as tests import tarfile cifar10_dataset_folder_path = 'cifar-10-batches-py' class DLProgress(tqdm): last_block = 0 def hoo...
gboeing/pynamical
examples/pynamical-demo-phase-diagrams.ipynb
mit
import IPython.display as IPdisplay import matplotlib.pyplot as plt import numpy as np import pandas as pd import pynamical from pynamical import simulate, save_fig, phase_diagram, phase_diagram_3d %matplotlib inline title_font = pynamical.get_title_font() label_font = pynamical.get_label_font() """ Explanation: Pyna...
machinelearningdeveloper/lc101-kc
October 23, 2016/Studio Solution.ipynb
unlicense
days_of_week = [ # 0 1 2 'Sunday', 'Monday', 'Tuesday', # 3 4 5 'Wednesday', 'Thursday', 'Friday', # 6 'Saturday', ] # Gather user input # Need to use the `int` call so that it'll correctly be # an integer for mathmatical operations leaving_day = int(inp...
qutip/qutip-notebooks
examples/photon-emission.ipynb
lgpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from qutip import * """ Explanation: QuTiP Lecture: Particle emission from a photon cascade D. Lukin, Stanford University In this Jupyter notebook, we use QuTiP: The Quantum Toolbox in Python to study a cascaded three level system excited by a clas...
qwertzuhr/2015_Data_Analyst_Project_3
.ipynb_checkpoints/Data Analysis Project 3 - Data Wrangle OpenStreetMaps Data-checkpoint.ipynb
agpl-3.0
from Project.notebook_stub import project_coll import pprint # Query used - see function Project.audit_stats_map.stats_general pipeline = [ {"$group": {"_id": "$type", "count": {"$sum": 1}}}, {"$match": {"_id": {"$in": ["node", "way"]}}} ] l = list(project_coll.aggregate(pipeline)) pprint.pprint(l)...
InsightLab/data-science-cookbook
2019/09-clustering/cl_Franklyn.ipynb
mit
# import libraries # linear algebra import numpy as np # data processing import pandas as pd # data visualization from matplotlib import pyplot as plt # load the data with pandas dataset = pd.read_csv('dataset.csv', header=None) dataset = np.array(dataset) plt.scatter(dataset[:,0], dataset[:,1], s=10) plt.show() ...
zunio/python-recipes
00-BestPractices/Iterator.ipynb
apache-2.0
numbers = [1, 2, 3] for n in numbers: print(n) iterator=iter(numbers) next(iterator) next(iterator) next(iterator) next(iterator) """ Explanation: iterable is an object that it can be used in iteration (with a for loop) by using iterator iterator is an object that define how actually do the iteration: specifi...
ignaciomsarmiento/ignaciomsarmiento.github.io
teaching/BDML/Lecture08_example.ipynb
mit
#cargar librerias import pandas as pd import numpy as np """ Explanation: Clase 8: Big Data and Machine Learning en el Mercado Inmobiliario. Educación Continua El siguiente cuaderno limpia los datos que use durante la clase teórica e implementa lo mostrado en clase. End of explanation """ df = pd.read_csv('co_prop...
tensorflow/docs-l10n
site/en-snapshot/probability/examples/Linear_Mixed_Effects_Model_Variational_Inference.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...
SheffieldML/GPyOpt
manual/GPyOpt_integrating_model_hyperparameters.ipynb
bsd-3-clause
%pylab inline import GPyOpt """ Explanation: GPyOpt: Integrating the model hyperparameters Written by Javier Gonzalez and Zhenwen Dai, University of Sheffield. Reference Manual index Last updated Friday, 11 March 2016. Integrating the model hyperparameters of a GP is easy with GPyOpt. To see how to use this feature ...
tranlyvu/autonomous-vehicle-projects
Finding Lane Lines/notebook/Fiding_Lane_Lines.ipynb
apache-2.0
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 import math import os %matplotlib inline # Import everything needed to edit/save/watch video clips from moviepy.editor import VideoFileClip from IPython.display import HTML """ Explanation: Se...
atlury/deep-opencl
DL0110EN/4.3.2mist1layer.ipynb
lgpl-3.0
!conda install -y torchvision import torch import torch.nn as nn import torchvision.transforms as transforms import torchvision.datasets as dsets import torch.nn.functional as F import matplotlib.pylab as plt import numpy as np """ Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px"> <a h...
chetan51/nupic.research
projects/dynamic_sparse/notebooks/kWinners.ipynb
gpl-3.0
dataset = Dataset(config=dict(dataset_name='MNIST', data_dir='~/nta/datasets', batch_size_train=256, batch_size_test=1024)) # torch cross_entropy is log softmax activation + negative log likelihood loss_func = F.cross_entropy # a custom Lambda module class Lambda(nn.Module): def __ini...
GoogleCloudPlatform/asl-ml-immersion
notebooks/image_models/labs/2_mnist_models.ipynb
apache-2.0
import os from datetime import datetime REGION = "us-central1" PROJECT = !(gcloud config get-value core/project) PROJECT = PROJECT[0] BUCKET = PROJECT MODEL_TYPE = "cnn" # "linear", "dnn", "dnn_dropout", or "cnn" # Do not change these os.environ["PROJECT"] = PROJECT os.environ["BUCKET"] = BUCKET os.environ["REGION"]...
phoebe-project/phoebe2-docs
development/examples/binary_spots.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Binary with Spots 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 session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as np impo...
g-weatherill/oq-risklib
doc/lite-course.ipynb
agpl-3.0
import os; print os.getcwd() print [f for f in os.listdir('.') if f.endswith(('.py', '.ini', '.xml'))] print open('job.ini').read() from openquake.baselib.general import import_all; import_all('my_calculators') from openquake.commonlib import readinput oqparam = readinput.get_oqparam('job.ini'); oqparam for name, ...