repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
martinjrobins/hobo
examples/sampling/transformation-with-and-without-jacobian.ipynb
bsd-3-clause
import pints import numpy as np import matplotlib.pyplot as plt # Set some random seed so this notebook can be reproduced np.random.seed(10) """ Explanation: Need for Jacobian adjustment in parameter transformation This example illustrates the importance of including a Jacobian term when sampling from a transformed p...
jhnphm/xbs_xbd
Getting_Started.ipynb
gpl-3.0
# %load startup.ipy #! /usr/bin/env python3 import sys sys.path.append('./python') import logging.config import os import xbx.database as xbxdb import xbx.util as xbxu import xbx.config as xbxc import xbx.build as xbxb import xbx.run as xbxr logging.config.fileConfig("logging.ini", disable_existing_loggers=False) ...
shoyer/xray
examples/xarray_seasonal_means.ipynb
apache-2.0
%matplotlib inline import numpy as np import pandas as pd import xarray as xr from netCDF4 import num2date import matplotlib.pyplot as plt print("numpy version : ", np.__version__) print("pandas version : ", pd.__version__) print("xarray version : ", xr.__version__) """ Explanation: <h1>Table of Contents<span class...
ML4DS/ML4all
R_lab2_GP/Pract_regression_professor.ipynb
mit
# Import some libraries that will be necessary for working with data and displaying plots # To visualize plots in the notebook %matplotlib inline import matplotlib import matplotlib.pyplot as plt import numpy as np import scipy.io # To read matlab files from scipy import spatial import pylab pylab.rcParams['fi...
jaeoh2/self-driving-car-nd
CarND-LaneLines-P1/P1.ipynb
mit
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline """ Explanation: Self-Driving Car Engineer Nanodegree Project: Finding Lane Lines on the Road In this project, you will use the tools you learned about in the lesson to ide...
HUDataScience/StatisticalMethods2016
notebooks/Exo8_SNeIa_HubbleDiagram.ipynb
apache-2.0
import warnings # No annoying warnings warnings.filterwarnings('ignore') # Because we always need that # plot within the notebook %matplotlib inline import numpy as np import matplotlib.pyplot as mpl """ Explanation: Exercise 8 – Fit an Hubble Diagram The SN Ia Science in short The Type Ia Supernova event is the therm...
josealber84/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...
chemiskyy/simmit
Examples/ODF/.ipynb_checkpoints/ODF-checkpoint.ipynb
gpl-3.0
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt from simmit import smartplus as sim from simmit import identify as iden import os dir = os.path.dirname(os.path.realpath('__file__')) """ Explanation: Orientation density functions End of explanation """ x = np.arange(0,182,2...
arcyfelix/Courses
18-05-28-Complete-Guide-to-Tensorflow-for-Deep-Learning-with-Python/03-Convolutional-Neural-Networks/02-CNN-Project-Exercise.ipynb
apache-2.0
# Put file path as a string here CIFAR_DIR = './data./cifar-10-batches-py/' """ Explanation: CNN-Project-Exercise We'll be using the CIFAR-10 dataset, which is very famous dataset for image recognition! The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 500...
AllenDowney/ModSimPy
soln/chap03soln.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 library from modsim import * # set the random number generator np.ran...
darkomen/TFG
medidas/04082015/.ipynb_checkpoints/Untitled-checkpoint.ipynb
cc0-1.0
#Importamos las librerías utilizadas import numpy as np import pandas as pd import seaborn as sns #Mostramos las versiones usadas de cada librerías print ("Numpy v{}".format(np.__version__)) print ("Pandas v{}".format(pd.__version__)) print ("Seaborn v{}".format(sns.__version__)) #Abrimos el fichero csv con los datos...
tpin3694/tpin3694.github.io
python/functions_vs_generators.ipynb
mit
# Create a function that def function(names): # For each name in a list of names for name in names: # Returns the name return name # Create a variable of that function students = function(['Abe', 'Bob', 'Christina', 'Derek', 'Eleanor']) # Run the function students """ Explanation: Title: Func...
MedievalSure/ToStudy
notebook/02_01_1DConvection.ipynb
mit
import numpy from matplotlib import pyplot %matplotlib inline from matplotlib import rcParams rcParams['font.family'] = 'serif' rcParams['font.size'] = 16 """ Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2014 L.A. Barba, G....
amandalouparker/graphviz-sitemaps
Notebook/sitemap_visualization_tool.ipynb
mpl-2.0
url = 'https://www.sportchek.ca/sitemap.xml' page = requests.get(url) print('Loaded page with: %s' % page) sitemap_index = BeautifulSoup(page.content, 'html.parser') print('Created %s object' % type(sitemap_index)) """ Explanation: How to visualize an XML sitemap using Python <img src="static/sitemap_graph_2_layer.pn...
ml4a/ml4a-guides
examples/info_retrieval/audio-tsne.ipynb
gpl-2.0
%matplotlib inline from matplotlib import pyplot as plt import matplotlib.cm as cm import fnmatch import os import numpy as np import librosa import matplotlib.pyplot as plt import librosa.display from sklearn.manifold import TSNE import json """ Explanation: Audio t-SNE This notebook will show you how to create a t-S...
ttesileanu/twostagelearning
spiking_simulations.ipynb
mit
%matplotlib inline import matplotlib as mpl import matplotlib.ticker as mtick import matplotlib.pyplot as plt import seaborn as sns sns.set_style('white') plt.rc('text', usetex=True) plt.rc('font', family='serif', serif='cm') plt.rcParams['figure.titlesize'] = 10 plt.rcParams['axes.labelsize'] = 8 plt.rcParams['axes....
bert9bert/statsmodels
examples/notebooks/distributed_estimation.ipynb
bsd-3-clause
import numpy as np from statsmodels.base.distributed_estimation import DistributedModel def _exog_gen(exog, partitions): """partitions exog data""" n_exog = exog.shape[0] n_part = np.ceil(n_exog / partitions) ii = 0 while ii < n_exog: jj = int(min(ii + n_part, n_exog)) yield exog[...
vsporeddy/bigbang
examples/Auditing Fernando.ipynb
gpl-2.0
from bigbang.archive import Archive import matplotlib.pyplot as plt import numpy as np import pandas as pd """ Explanation: This note will show you how to use BigBang to investigate a particular project participant's activity. We will focus on Fernando Perez's role within the IPython community. First, imports. End of ...
aidiary/notebooks
pytorch/180212-dqn-tutorial.ipynb
mit
import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import namedtuple from itertools import count from copy import deepcopy from PIL import Image import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from to...
woobe/h2o_tutorials
introduction_to_machine_learning/py_02_data_manipulation.ipynb
mit
# Start and connect to a local H2O cluster import h2o h2o.init(nthreads = -1) """ Explanation: Machine Learning with H2O - Tutorial 2: Basic Data Manipulation <hr> Objective: This tutorial demonstrates basic data manipulation with H2O. <hr> Titanic Dataset: Source: https://www.kaggle.com/c/titanic/data <hr> Ful...
chapmanbe/utah_highschool_airquality
introducing_python/working_with_air_quality_data.ipynb
apache-2.0
%matplotlib inline import os import pandas as pd import datetime import numpy as np import matplotlib.pyplot as plt from IPython.display import YouTubeVideo #!pip install xlrd """ Explanation: Examining Weather Data and Air Quality Data In this notebook we are going to learn how to read tabular data (e.g. spreadshee...
markovmodel/adaptivemd
examples/tutorial/4_example_advanced_tasks.ipynb
lgpl-2.1
from adaptivemd import Project, File, PythonTask, Task """ Explanation: AdaptiveMD Example 4 - Custom Task objects 0. Imports End of explanation """ project = Project('tutorial') """ Explanation: Let's open our test project by its name. If you completed the first examples this should all work out of the box. Open a...
qinjian623/dlnotes
cs231n/assignments/assignment1/.ipynb_checkpoints/svm-checkpoint.ipynb
gpl-3.0
# Run some setup code for this notebook. import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt # This is a bit of magic to make matplotlib figures appear inline in the # notebook rather than in a new window. %matplotlib inline plt.rcParams['figure.figsize'] = (10....
lowks/micromeritics
documentation/BET.ipynb
gpl-3.0
%matplotlib inline from micromeritics import bet, util, isotherm_examples as ex, plots s = ex.carbon_black() # example isotherm of Carbon Black with N2. min = 0.05 # 0.05 to 0.30 range for BET max = 0.3 Q,P = util.restrict_isotherm(s.Qads, s.Prel, min, max) plots.plotIsotherm(s.Qads, s.Prel, s.descr[...
barronh/GCandPython
PNC_03DC3Eval.ipynb
gpl-3.0
# Prepare my slides %pylab inline %cd working """ Explanation: ICARTT Evaluation Author: Barron H. Henderson This presentation will teach basics of spatial interpolation and statistical evaluation using Python with PseudoNetCDF, numpy, and scipy. End of explanation """ from PseudoNetCDF import PNC """ Explanation: ...
ueapy/ueapy.github.io
content/notebooks/2017-05-05-matplotlib-subplots.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt """ Explanation: Today we covered a very important part of matplotlib - how to create multiple subplots in one figure. We touched upon the following topics: <p><div class="lev1 toc-item"><a href="#Matplotlib-Axes" data-toc-modified-id="Matplotlib-A...
mne-tools/mne-tools.github.io
0.21/_downloads/20f35983ef279d1b30aa970c81aafe26/plot_read_events.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Chris Holdgraf <choldgraf@berkeley.edu> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname = data_path + '/MEG/sample/sample_audvis_raw-eve.fi...
ES-DOC/esdoc-jupyterhub
notebooks/fio-ronm/cmip6/models/sandbox-1/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'fio-ronm', 'sandbox-1', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: FIO-RONM Source ID: SANDBOX-1 Topic: Ocean Sub-Topics: Timestepping Framework, A...
teoguso/sol_1116
cumulant-to-pdf.ipynb
mit
!gvim data/SF_Si_bulk/invar.in """ Explanation: Best report ever Everything you see here is either markdown, LaTex, Python or BASH. The spectral function It looks like this: \begin{equation} A(\omega) = \mathrm{Im}|G(\omega)| \end{equation} GW vs Cumulant Mathematically very different: \begin{equation} G^{GW} (\omeg...
ES-DOC/esdoc-jupyterhub
notebooks/ec-earth-consortium/cmip6/models/ec-earth3-aerchem/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-aerchem', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: EC-EARTH-CONSORTIUM Source ID: EC-EARTH3-AERCHEM Topic: Land Su...
retnuh/deep-learning
tensorboard/Anna_KaRNNa.ipynb
mit
import time from collections import namedtuple import numpy as np import tensorflow as tf """ Explanation: Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is base...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/besm-2-7/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'besm-2-7', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: INPE Source ID: BESM-2-7 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radiat...
ethen8181/machine-learning
projects/kaggle_rossman_store_sales/rossman_data_prep.ipynb
mit
from jupyterthemes import get_themes from jupyterthemes.stylefx import set_nb_theme themes = get_themes() set_nb_theme(themes[3]) # 1. magic for inline plot # 2. magic to print version # 3. magic so that the notebook will reload external python modules # 4. magic to enable retina (high resolution) plots # https://gist...
pyqg/pyqg
docs/examples/barotropic.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline import pyqg """ Explanation: Barotropic Model Here will will use pyqg to reproduce the results of the paper: <br /> J. C. Mcwilliams (1984). The emergence of isolated coherent vortices in turbulent flow. Journal of Fluid Mechanics, 146, pp 21-43 do...
GoogleCloudPlatform/asl-ml-immersion
notebooks/time_series_prediction/solutions/1_optional_data_exploration.ipynb
apache-2.0
import os PROJECT = !(gcloud config get-value core/project) PROJECT = PROJECT[0] BUCKET = PROJECT os.environ["PROJECT"] = PROJECT os.environ["BUCKET"] = BUCKET import numpy as np import pandas as pd import seaborn as sns from google.cloud import bigquery from IPython import get_ipython from IPython.core.magic import...
5hubh4m/CS231n
Assignment2/ConvolutionalNetworks.ipynb
mit
# As usual, a bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.cnn import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient_array, eval_numerical_gradient from cs231n.layers import * from cs231n.fast_layers import * from cs...
ptosco/rdkit
Docs/Notebooks/MolStandardize.ipynb
bsd-3-clause
import rdkit from rdkit import Chem from rdkit.Chem.Draw import IPythonConsole from rdkit.Chem.MolStandardize import rdMolStandardize """ Explanation: MolStandardize This is a demonstration on how to use the rdMolStandardize module within RDKit. The structure and capabilities remain largely the same as MolVS (https://...
materialsvirtuallab/matgenb
notebooks/2019-01-11-How to plot and evaluate output files from Lobster.ipynb
bsd-3-clause
from pymatgen.electronic_structure.plotter import CohpPlotter from pymatgen.electronic_structure.cohp import CompleteCohp %matplotlib inline """ Explanation: Introduction This notebook was written by Janine George (E-mail: janine.george@uclouvain.be Université catholique de Louvain, https://jageo.github.io/). This no...
windj007/tablex-dataset
dataset_from_latex.ipynb
apache-2.0
# frequent_errors = collections.Counter(err # for f in glob.glob('./data/arxiv/err_logs/*.log') # for err in {line # for line in open(f, 'r', errors='replace') # ...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/stationarity_detrending_adf_kpss.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm """ Explanation: Stationarity and detrending (ADF/KPSS) Stationarity means that the statistical properties of a time series i.e. mean, variance and covariance do not change over time. Many statistical...
ibmkendrick/streamsx.health
samples/HealthcareJupyterDemo/notebooks/HealthcareDemo-Distributed.ipynb
apache-2.0
!pip install --upgrade streamsx !pip install --upgrade "git+https://github.com/IBMStreams/streamsx.health.git#egg=healthdemo&subdirectory=samples/HealthcareJupyterDemo/package" """ Explanation: Healthcare Python Streaming Application Demo This application demonstrates how users can develop Python Streaming Application...
tensorflow/docs-l10n
site/zh-cn/tutorials/load_data/unicode.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...
datosgobar/pydatajson
samples/caso-uso-1-pydatajson-xlsx-justicia-valido.ipynb
mit
import arrow import os, sys sys.path.insert(0, os.path.abspath("..")) from pydatajson import DataJson #lib y clase from pydatajson.readers import read_catalog # lib, modulo ... metodo Lle el catalogo -json o xlsx o (local o url) dicc- y lo transforma en un diccionario de python from pydatajson.writers import write_json...
nd1/women_in_tech_summit_DC2017
workshop_notebooks/workshop_api_notebook.ipynb
mit
import json import urllib.request data = json.loads(urllib.request.urlopen('http://www.omdbapi.com/?t=Game%20of%20Thrones&Season=1').read().\ decode('utf8')) """ Explanation: APIs Let's start by looking at OMDb API. The OMDb API is a free web service to obtain movie information, all content and imag...
evanmiltenburg/python-for-text-analysis
Chapters/Chapter 07 - Sets.ipynb
apache-2.0
a_set = {1, 2, 3} a_set empty_set = set() # you have to use set() to create an empty set! (we will see why later) print(empty_set) """ Explanation: Chapter 7 - Sets This chapter will introduce a different kind of container: sets. Sets are unordered lists with no duplicate entries. You might wonder why we need differe...
bourneli/deep-learning-notes
DAT236x Deep Learning Explained/.ipynb_checkpoints/Lab1_MNIST_DataLoader-checkpoint.ipynb
mit
# Import the relevant modules to be used later from __future__ import print_function import gzip import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import os import shutil import struct import sys try: from urllib.request import urlretrieve except ImportError: from urllib im...
jni/aspp2015
Introduction to Cython.ipynb
bsd-3-clause
def f(x): y = x**4 - 3*x return y def integrate_f(a, b, n): dx = (b - a) / n dx2 = dx / 2 s = f(a) * dx2 for i in range(1, n): s += f(a + i * dx) * dx s += f(b) * dx2 return s """ Explanation: Intro to Cython Why Cython Outline: Speed up Python code Interact with NumPy ar...
ES-DOC/esdoc-jupyterhub
notebooks/nuist/cmip6/models/sandbox-1/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-1', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: NUIST Source ID: SANDBOX-1 Topic: Ocean Sub-Topics: Timestepping Framework, Advecti...
PmagPy/2017_MagIC_Workshop_PmagPy_Tutorial
PmagPy_structure_notebook.ipynb
bsd-3-clause
def fshdev(k): """ Generate a random draw from a Fisher distribution with mean declination of 0 and inclination of 90 with a specified kappa. Parameters ---------- k : kappa (precision parameter) of the distribution Returns ---------- dec, inc : declination and inclination of rand...
honux77/practice
python/csvgen/simple csv generator.ipynb
mit
import random import string def genID(n): str = ''.join(random.choices(string.ascii_uppercase + string.digits, k=n)) return str l = "김이박정최정강조윤장임한호서신권황" m = "동해물과백두산이마르고도록하느님이보우하사우리나라만세무궁화삼천리화려강산대한사람" def genName(): return random.choice(l) + "".join(random.choices(m, k=2)) import random import time def s...
INM-6/elephant
doc/tutorials/granger_causality.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np from elephant.causality.granger import pairwise_granger, conditional_granger fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2) # Indirect causal influence diagram node1 = plt.Circle((0.2, 0.2), 0.1, color='red') node2 = plt.Circle((0.5, 0.6), 0.1, color='red') node3 = ...
dbouquin/AstroHackWeek2015
day3-machine-learning/05 - Cross-validation.ipynb
gpl-2.0
from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target from sklearn.cross_validation import cross_val_score from sklearn.svm import LinearSVC cross_val_score(LinearSVC(), X, y, cv=5) cross_val_score(LinearSVC(), X, y, cv=5, scoring="f1_macro") """ Explanation: Cross-Validation <img...
mne-tools/mne-tools.github.io
dev/_downloads/ed1a04dd775648ca869bfcffae26faca/30_mne_dspm_loreta.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.minimum_norm import make_inverse_operator, apply_inverse """ Explanation: Source localization with MNE, dSPM, sLORETA, and eLORETA The aim of this tutorial is to teach you how to compute and apply a linear minimum-n...
phanrahan/magmathon
notebooks/advanced/coreir.ipynb
mit
import magma as m # default mantle target is coreir, so no need to do this unless you want to be explicit # m.set_mantle_target("coreir") from mantle import Counter from loam.boards.icestick import IceStick icestick = IceStick() icestick.Clock.on() icestick.D5.on() N = 22 main = icestick.main() counter = Counter(N)...
Aniruddha-Tapas/Applied-Machine-Learning
Machine Learning using GraphLab/Document Retrieval using GraphLab Create.ipynb
mit
import graphlab """ Explanation: Document retrieval from wikipedia data Import GraphLab Create End of explanation """ people = graphlab.SFrame('people_wiki.gl/') """ Explanation: Load some text data - from wikipedia, pages on people End of explanation """ people.head() len(people) """ Explanation: Data contain...
phoebe-project/phoebe2-docs
2.3/tutorials/pblum.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" import phoebe from phoebe import u # units import numpy as np logger = phoebe.logger() b = phoebe.default_binary() """ Explanation: Passband Luminosity Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online note...
IS-ENES-Data/submission_forms
test/prov/old/prov-test1.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 from prov.model import ProvDocument d1 = ProvDocument() d1.deserialize? """ Explanation: Representation of data submission workflow components based on W3C-PROV End of explanation """ from IPython.display import display, Image Image(filename='key-concepts.png') from dkrz_forms ...
dnc1994/MachineLearning-UW
ml-classification/module-6-decision-tree-practical-assignment-solution.ipynb
mit
import graphlab """ Explanation: Decision Trees in Practice In this assignment we will explore various techniques for preventing overfitting in decision trees. We will extend the implementation of the binary decision trees that we implemented in the previous assignment. You will have to use your solutions from this pr...
Olsthoorn/TransientGroundwaterFlow
exercises_notebooks/Strip-of-land-both-sides-equal-rise.ipynb
gpl-3.0
# import modules we need import matplotlib.pyplot as plt import numpy as np from scipy.special import erfc """ Explanation: <figure> <IMG SRC="../logo/logo.png" WIDTH=250 ALIGN="right"> </figure> Strip of land with same rise at both sides @Theo Olsthoorn 2019-12-21 This exercise was done in class on 2019-01-10 End ...
AllenDowney/ThinkStats2
solutions/chap03soln.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
yangliuy/yangliuy.github.io
markdown_generator/talks.ipynb
mit
import pandas as pd import os """ Explanation: Talks markdown generator for academicpages Takes a TSV of talks with metadata and converts them for use with academicpages.github.io. This is an interactive Jupyter notebook (see more info here). The core python code is also in talks.py. Run either from the markdown_gener...
vitojph/kschool-nlp
notebooks-py2/nltk-pos.ipynb
gpl-3.0
from __future__ import print_function from __future__ import division 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ógic...
ComputationalPhysics2015-IPM/Python-01
Python-01.ipynb
gpl-2.0
3 + 4 3 * 5 4 / 3 4 // 3 4 % 3 abs(-3) 2**2024+2**1024 2.0**1024 1.0+2 2**-30 1.0e-10 """ Explanation: Python as a calculator Python can be used as calculator + - * / () ** // % abs min max, int and float End of explanation """ True False 2 == 3 3<5 3 < 6 and 2 == 3 True + 2 True * 10 """ Explanati...
jdvelasq/ingenieria-economica
07-impuestos.ipynb
mit
import cashflows as cf # representación del flujo de fondos cflo = cf.cashflow(const_value=[1000]*5+[-500]*5, start='2016', freq='A') cf.textplot(cflo) ## cómputo del impuesto tax_rate = cf.interest_rate(const_value=[30]*10, start=2016, freq='A') x = cf.after_tax_cashflow(cfl...
rhiever/crowd-machines
Crowd machines demo.ipynb
mit
import pandas as pd import numpy as np breast_cancer_data = pd.read_csv('data/breast-cancer-wisconsin.tsv.gz', sep='\t', compression='gzip') """ Explanation: Breast cancer data set End of explanation """ from collections import Counter Counter(breas...
PyPSA/PyPSA
examples/notebooks/spatial-clustering.ipynb
mit
import pypsa import re import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs import pandas as pd from pypsa.networkclustering import get_clustering_from_busmap, busmap_by_kmeans n = pypsa.examples.scigrid_de() n.lines["type"] = np.nan # delete the 'type' specifications to make this example eas...
atcemgil/notes
BayesianNetworks.ipynb
mit
import numpy as np import scipy as sc from scipy.special import gammaln from scipy.special import digamma %matplotlib inline from itertools import combinations import pygraphviz as pgv from IPython.display import Image from IPython.display import display def normalize(A, axis=None): """Normalize a probability t...
jdvelasq/ingenieria-economica
2016-03/IE-01-calculos-basicos.ipynb
mit
## cálculo manual -450 * (1 + 0.07 * 60 / 360) """ Explanation: Modelos de Valor del Dinero en el Tiempo Notas de clase sobre ingeniería economica avanzada usando Python Juan David Velásquez Henao jdvelasq@unal.edu.co Universidad Nacional de Colombia, Sede Medellín Facultad de Minas Medellín, Colombia Software utili...
suresh/notebooks
Intro to Data Science - Seattle Fremont Bridge.ipynb
mit
url = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD' df = pd.read_csv(url, parse_dates=True) df.head() df.shape df.index = pd.DatetimeIndex(df.Date) df.head() df.drop(columns=['Date'], inplace=True) df.head() df['total'] = df['Fremont Bridge East Sidewalk'] + df['Fremont Bridge West S...
KECB/learn
BAMM.101x/Networks_new.ipynb
mit
import networkx as nx %matplotlib inline import numpy as np import matplotlib.pyplot as plt simple_network = nx.Graph() nodes = [1,2,3,4,5,6,7,8] edges = [(1,2),(2,3),(1,3),(4,5),(2,7),(1,9),(3,4),(4,5),(4,9),(5,6),(7,8),(8,9)] simple_network.add_nodes_from(nodes) simple_network.add_edges_from(edges) nx.draw(simple_ne...
abhipr1/DATA_SCIENCE_INTENSIVE
Data_Story_1/Adv_vs_Trade.ipynb
apache-2.0
est_m=smf.ols(formula='Sales ~ TV', data=adv).fit() est_m.summary() """ Explanation: Determine if TV advertisement has any impact on sell. End of explanation """ # Plot the data and fitted line x_prime = pd.DataFrame({'TV': np.linspace(adv.TV.min(), adv.TV.max(), ...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session02/Day2/ModelSelection_ExerciseSolutions.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt # comment out this line if you don't have seaborn installed import seaborn as sns sns.set_palette("colorblind") import numpy as np """ Explanation: Model Selection For Machine Learning In this exercise, we will explore methods to do model selection in a machine lear...
amitkaps/machine-learning
RF_GBM/notebook/Bank Marketing.ipynb
mit
#Import the necessary libraries import numpy as np import pandas as pd #Read the train and test data train = pd.read_csv("../data/train.csv") test = pd.read_csv("../data/test.csv") """ Explanation: Frame The client bank XYZ is running a direct marketing campaign. It wants to identify customers who would potentially b...
bramacchino/numberSense
GraphStructure.ipynb
mit
from igraph import Graph, summary g = Graph() g.add_vertices(3) #0,1,2 #g.add_vertices([0,1,2]) g.add_edges([(0,1), (1,2)]) g.add_vertices(3) #g.delete_vertices([1,2]) try out, deleting vertices delete also the incident edges g.add_edges([(2,3),(3,4),(4,5),(5,3)]) g.delete_edges(g.get_eid(2,3)) #Note that edges and...
sbalanovich/APM115Proj1
src/Serguei Workspace.ipynb
mit
%matplotlib inline import csv import numpy as np from scipy import interp import matplotlib.pyplot as plt from sklearn import svm, datasets from sklearn.cross_validation import train_test_split from sklearn.metrics import roc_curve, auc from sklearn.cross_validation import StratifiedKFold from sklearn import preprocess...
statsmodels/statsmodels.github.io
v0.13.2/examples/notebooks/generated/distributed_estimation.ipynb
bsd-3-clause
import numpy as np from scipy.stats.distributions import norm from statsmodels.base.distributed_estimation import DistributedModel def _exog_gen(exog, partitions): """partitions exog data""" n_exog = exog.shape[0] n_part = np.ceil(n_exog / partitions) ii = 0 while ii < n_exog: jj = int(m...
amitkaps/applied-machine-learning
Module-05a-ML-Pipeline.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.style.use("ggplot") %matplotlib` inline """ Explanation: Machine Learning Supervised Pipeline Frame Supervised Learning - Regression y: Predict Sale Price X: Features about the house score: Mean Squared Error End of explanation """ data = ...
ScienceStacks/jupyter_scisheets_widget
test_notebooks/20171017_scisheets_widget.ipynb
bsd-3-clause
import json import numpy as np import pandas as pd from jupyter_scisheets_widget import scisheets_widget """ Explanation: Demonstration of Use Case Users can enter step by step explanations of changes made to a SciSheet in a Jupyter notebook Load necessary packages End of explanation """ income_data = pd.read_cs...
ml4a/ml4a-guides
examples/fundamentals/convolutional_neural_networks.ipynb
gpl-2.0
import random import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") """ Explanation: Convolutional networks This is an...
materialsvirtuallab/matgenb
notebooks/2018-03-09-Computing the Reaction Diagram between Two Compounds.ipynb
bsd-3-clause
from pymatgen import MPRester, Composition from pymatgen.analysis.phase_diagram import PhaseDiagram from pymatgen.entries.computed_entries import ComputedEntry from pymatgen.apps.borg.hive import VaspToComputedEntryDrone from pymatgen.entries.compatibility import MaterialsProjectCompatibility from pymatgen.analysis.pha...
PLBMR/cmuDSCWorkshopNotebooks
okCupidInitialAnalysis.ipynb
mit
#imports import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from IPython.display import display, HTML #constants %matplotlib inline sns.set_style("dark") sigLev = 3 figWidth = figHeight = 5 """ Explanation: OkCupid: Dataset Analysis This is a notebook I am using to test out t...
JanetMatsen/bacteriopop
depreciated/dmd_demo.ipynb
apache-2.0
import matplotlib as mpl mpl.use('TkAgg') import matplotlib.pyplot as plt %matplotlib inline import bacteriopop_utils import feature_selection_utils import load_data loaded_data = data = load_data.load_data() loaded_data.shape """ Explanation: for some reason Janet's virtualenv is much happier with this TkAgg thing...
DJCordhose/ai
notebooks/sklearn/knn.ipynb
mit
import warnings warnings.filterwarnings('ignore') %matplotlib inline %pylab inline import pandas as pd print(pd.__version__) """ Explanation: ML using KNN End of explanation """ df = pd.read_csv('./insurance-customers-300.csv', sep=';') y=df['group'] df.drop('group', axis='columns', inplace=True) X = df.as_matr...
ebellm/ztf_summerschool_2015
notebooks/Period_Finding.ipynb
bsd-3-clause
# point to our previously-saved data reference_catalog = '../data/PTF_Refims_Files/PTF_d022683_f02_c06_u000114210_p12_sexcat.ctlg' outfile = reference_catalog.split('/')[-1].replace('ctlg','shlv') """ Explanation: Hands-On Exercise 3: Period Finding One of the fundamental tasks of time-domain astronomy is determining...
huangziwei/pyMF3
pymf3/examples/01_using_nmf_to_factorize_face_images.ipynb
mit
import seaborn as sns import matplotlib.pyplot as plt import numpy as np %matplotlib inline import sys sys.path.append('/home/Repos/pyMF3/') import pymf3 from pymf3.datasets import CBCL_faces from matplotlib import rcParams rcParams['font.family'] = 'DejaVu Sans' faces = CBCL_faces.get_CBCL_faces(scale_images=True...
ktmud/deep-learning
tv-script-generation/dlnd_tv_script_generation.ipynb
mit
""" 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...
csadorf/signac
doc/signac_104_Modifying_the_Data_Space.ipynb
bsd-3-clause
import numpy as np def V_vdW(p, kT, N, a=0, b=0): """Solve the van der Waals equation for V.""" coeffs = [p, - (kT * N + p * N *b), a * N**2, - a * N**3 * b] V = sorted(np.roots(coeffs)) return np.real(V).tolist() """ Explanation: 1.4 Modifying the Data Space It is very common that we discover at a la...
fastai/course-v3
zh-nbs/Lesson2_download.ipynb
apache-2.0
from fastai.vision import * """ Explanation: Practical Deep Learning for Coders, v3 Lesson 2_download Creating your own dataset from Google Images 从Google Images创建你自己的数据集 作者: Francisco Ingham 和 Jeremy Howard. 灵感来源于Adrian Rosebrock In this tutorial we will see how to easily create an image dataset through Google Images...
analysiscenter/dataset
examples/experiments/stochastic_depth/stochastic_depth.ipynb
apache-2.0
import sys import matplotlib.pyplot as plt from tqdm import tqdm_notebook as tqn %matplotlib inline sys.path.append('../../..') sys.path.append('../../utils') import utils from resnet_with_stochastic_depth import StochasticResNet from batchflow import B,V,F from batchflow.opensets import MNIST from batchflow.models.t...
UCSBarchlab/PyRTL
ipynb-examples/example8-verilog.ipynb
bsd-3-clause
import random import io import pyrtl pyrtl.reset_working_block() """ Explanation: Example 8: Interfacing with Verilog. While there is much more about PyRTL design to discuss, at some point somebody might ask you to do something with your code other than have it print pretty things out to the terminal. We provide im...
diging/tethne-notebooks
2. Working with data from JSTOR Data-for-Research.ipynb
gpl-3.0
from tethne.readers import dfr """ Explanation: Introduction to Tethne: Working with data from the Web of Science Now that we have the basics down, in this notebook we'll begin working with data from the JSTOR Data-for-Research (DfR) portal. The JSTOR DfR portal gives researchers access to bibliographic data and N-gra...
campagnucci/api_sof
.ipynb_checkpoints/SOF_Execucao_Orcamentaria_PMSP-checkpoint.ipynb
gpl-3.0
import pandas as pd import requests import json import numpy as np TOKEN = '198f959a5f39a1c441c7c863423264' base_url = "https://gatewayapi.prodam.sp.gov.br:443/financas/orcamento/sof/v2.1.0" headers={'Authorization' : str('Bearer ' + TOKEN)} """ Explanation: Explorando as despesas da cidade de São Paulo Um tutorial d...
tensorflow/docs-l10n
site/ko/agents/tutorials/8_networks_tutorial.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...
computational-class/cjc2016
code/tba/DeepLearningMovies/Kaggle tutorial Part 1 Natural Language Processing.ipynb
mit
import os from sklearn.feature_extraction.text import CountVectorizer from sklearn.ensemble import RandomForestClassifier from KaggleWord2VecUtility import KaggleWord2VecUtility # in the same folader import pandas as pd import numpy as np """ Explanation: Deep learning goes to the movies Kaggle tutorial Part 1: Natu...
tensorflow/docs-l10n
site/zh-cn/tutorials/distribute/multi_worker_with_keras.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...
eds-uga/csci1360-fa16
lectures/L13.ipynb
mit
li = ["this", "is", "a", "list"] print(li) print(li[1:3]) # Print element 1 (inclusive) to 3 (exclusive) print(li[2:]) # Print element 2 and everything after that print(li[:-1]) # Print everything BEFORE element -1 (the last one) """ Explanation: Lecture 13: Array Indexing, Slicing, and Broadcasting CSCI 1360: Fou...
zaqwes8811/micro-apps
self_driving/deps/Kalman_and_Bayesian_Filters_in_Python_master/11-Extended-Kalman-Filters.ipynb
mit
from __future__ import division, print_function %matplotlib inline #format the book import book_format book_format.set_style() """ Explanation: Table of Contents The Extended Kalman Filter End of explanation """ import kf_book.ekf_internal as ekf_internal ekf_internal.show_linearization() """ Explanation: We have ...
OceanPARCELS/parcels
parcels/examples/tutorial_timestamps.ipynb
mit
from parcels import Field from glob import glob import numpy as np """ Explanation: Tutorial on how to use timestaps in Field construction End of explanation """ # tempfield = Field.from_netcdf(glob('WOA_data/woa18_decav_*_04.nc'), 't_an', # {'lon': 'lon', 'lat': 'lat', 'time': 'time'}...
bgroveben/python3_machine_learning_projects
introduction_to_ml_with_python/4_Data_and_Features.ipynb
mit
import os # The file has no headers naking the columns, so we pass # header=None and provide the column names explicitly in "names". adult_path = os.path.join(mglearn.datasets.DATA_PATH, "adult.data") print(adult_path) data = pd.read_csv(adult_path, header=None, index_col=False, names=['age', 'workclass', 'fnl...
GoogleCloudPlatform/asl-ml-immersion
notebooks/text_models/solutions/reusable_embeddings_vertex.ipynb
apache-2.0
import os import pandas as pd from google.cloud import bigquery """ Explanation: Reusable Embeddings Learning Objectives 1. Learn how to use a pre-trained TF Hub text modules to generate sentence vectors 1. Learn how to incorporate a pre-trained TF-Hub module into a Keras model 1. Learn how to deploy and use a text m...