repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
kgrodzicki/machine-learning-specialization
course-3-classification/module-3-linear-classifier-learning-assignment-blank.ipynb
mit
import graphlab """ Explanation: Implementing logistic regression from scratch The goal of this notebook is to implement your own logistic regression classifier. You will: Extract features from Amazon product reviews. Convert an SFrame into a NumPy array. Implement the link function for logistic regression. Write a f...
ajgpitch/qutip-notebooks
development/development-ssesolve-tests.ipynb
lgpl-3.0
%matplotlib inline import matplotlib.pyplot as plt from qutip import * import numpy as np """ Explanation: Development notebook: Tests for QuTiP's stochastic Schrödinger equation solver Copyright (C) 2011 and later, Paul D. Nation & Robert J. Johansson In this notebook we test the qutip stochastic Schrödinger equatio...
aba1476/ds-for-wall-street
ds-for-ws-solutions.ipynb
apache-2.0
%matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.dates as mdates import seaborn as sns """ Explanation: Loading and Cleaning the Data Turn on inline matplotlib plotting and import plotting dependencies. End of explanation """ import numpy as np import pandas as pd import...
mcocdawc/chemcoord
Tutorial/Transformation.ipynb
lgpl-3.0
import chemcoord as cc import time import pandas as pd water = cc.Cartesian.read_xyz('water_dimer.xyz', start_index=1) zwater = water.get_zmat() small = cc.Cartesian.read_xyz('MIL53_small.xyz', start_index=1) """ Explanation: Transformation between internal and cartesian coordinates End of explanation """ zwater.lo...
NathanYee/ThinkBayes2
code/chap05mine.ipynb
gpl-2.0
% matplotlib inline import warnings warnings.filterwarnings('ignore') import numpy as np from thinkbayes2 import Pmf, Cdf, Suite, Beta import thinkplot """ Explanation: Think Bayes: Chapter 5 This notebook presents code and exercises from Think Bayes, second edition. Copyright 2016 Allen B. Downey MIT License: https...
akchinSTC/systemml
projects/breast_cancer/MachineLearning.ipynb
apache-2.0
%load_ext autoreload %autoreload 2 %matplotlib inline import os import matplotlib.pyplot as plt import numpy as np from pyspark.sql.functions import col, max import systemml # pip3 install systemml from systemml import MLContext, dml plt.rcParams['figure.figsize'] = (10, 6) ml = MLContext(sc) """ Explanation: Pre...
mahieke/maschinelles_lernen
a1/excercise1.ipynb
mit
import pandas as pd import numpy as np %matplotlib inline """ Explanation: Aufgabe 1: Explorative Analyse und Vorverarbeitung End of explanation """ url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data' cols =["CRIM","ZN","INDUS","CHAS","NOX","RM","AGE","DIS","RAD","TAX","PTRATIO","B...
kunalj101/scipy2015-blaze-bokeh
1.2 Plotting - Timeseries.ipynb
mit
import pandas as pd from bokeh.plotting import figure, show, output_notebook # Get data # Process data # Output option # Create your plot # Show plot """ Explanation: <img src=images/continuum_analytics_b&w.png align="left" width="15%" style="margin-right:15%"> <h1 align='center'>Bokeh tutorial</h1> 1.2 Plotting...
herberthamaral/curso-python-sec2015
Mini curso Python - SEC 2015.ipynb
mit
print "Olá Mundo!" #Este é o nosso hello world e este é um comentário :) """ Explanation: Mini-curso de Python - SEC 2015 Autor: Herberth Amaral - herberthamaral@gmail.com Montando o ambiente para este mini-curso $ sudo apt-get install build-essential python-dev libblas-dev liblapack-dev gfortran python-pip git libzmq...
ML4DS/ML4all
U_lab1.Clustering/Lab_ShapeSegmentation_draft/LabSessionClustering_student.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy.misc import imread """ Explanation: Lab Session: Clustering algorithms for Image Segmentation Author: Jesús Cid Sueiro Jan. 2017 End of explanation """ name = "birds.jpg" name = "Seeds.jpg" birds = imread("Images/" + name) birdsG = np....
JarronL/pynrc
notebooks/Exoplanet_Filter_Selection.ipynb
mit
def get_planet_counts(bp, age, masses=[0.1,1,10], dist=10, model='linder', file=None, return_mags=False): if 'linder' in model.lower(): tbl = nrc_utils.linder_table(file) res = nrc_utils.linder_filter(tbl, bp.name, age, dist=dist, con...
bdestombe/flopy-1
examples/Notebooks/flopy3_WatertableRecharge_example.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function import os import sys import platform import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import flopy print(sys.version) print('numpy version: {}'.format(np.__version__)) print('matplotlib version: {}'.format(mpl.__version__)) print('flop...
jhillairet/scikit-rf
doc/source/examples/metrology/SOLT Calibration Standards Creation.ipynb
bsd-3-clause
import skrf from skrf.media import DefinedGammaZ0 import numpy as np freq = skrf.Frequency(1, 9000, 1001, "MHz") ideal_medium = DefinedGammaZ0(frequency=freq, z0=50) """ Explanation: SOLT Calibration Standards Creation Introduction In scikit-rf, a calibration standard is treated just as a regular one-port or two-port...
jobovy/misc-notebooks
inference/open-cluster-ABC-w-lack-of-CCSNe.ipynb
bsd-3-clause
def sftime_ABC(n=100,K=1,tccsn=4.,tmax=20.): out= [] for ii in range(n): while True: # Sample from prior tsf= numpy.random.uniform()*tmax # Sample K massive-star formation times stars= numpy.random.uniform(size=K)*tsf # Only accept if all go CC...
JanetMatsen/plotting_python
plot_groupby_and_subplots.ipynb
apache-2.0
df = pd.DataFrame({'age':[1.,2,3,4,5,6,7,8,9], 'height':[4, 4.5, 5, 6, 7, 8, 9, 9.5, 10], 'gender':['M','F', 'F','M','M','F', 'F','M', 'F'], #'hair color':['brown','black', 'brown', 'blonde', 'brown', 'red', # 'brown', 'brown', 'b...
CityofToronto/bdit_congestion
here_map_change/hereanalysis.ipynb
gpl-3.0
%sql select count(*) from (select distinct(link_dir) from here.ta_201710) oct """ Explanation: Total distinct link_dir in Oct: End of explanation """ %sql select count(*) from (select distinct(link_dir) from here.ta_201711) nov """ Explanation: Total distinct link_dir in Nov: End of explanation """ %%sql select ...
google-aai/sc17
cats/step_5_to_6_part1.ipynb
apache-2.0
# Enter your username: YOUR_GMAIL_ACCOUNT = '******' # Whatever is before @gmail.com in your email address import cv2 import numpy as np import os import pickle import shutil import sys import matplotlib.pyplot as plt import matplotlib.image as mpimg from random import random from scipy import stats from sklearn impor...
sfegan/calin
examples/simulation/toy event simulation for mst nectarcam array.ipynb
gpl-2.0
%pylab inline import calin.math.hex_array import calin.provenance.system_info import calin.simulation.vs_optics import calin.simulation.geant4_shower_generator import calin.simulation.ray_processor import calin.simulation.tracker import calin.simulation.detector_efficiency import calin.simulation.atmosphere import cali...
ToqueWillot/M2DAC
FDMS/TME3/Model_V5.ipynb
gpl-2.0
# from __future__ import exam_success from __future__ import absolute_import from __future__ import print_function # Standard imports %matplotlib inline import os import sklearn import matplotlib.pyplot as plt import seaborn as sns import numpy as np import random import pandas as pd import scipy.stats as stats # ...
CDIPS-AI-2017/pensieve
Notebooks/emo.ipynb
apache-2.0
import pensieve as pv import pandas as pd pd.options.display.max_rows = 6 import numpy as np import re from tqdm import tqdm_notebook as tqdm %matplotlib notebook import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D """ Explanation: Extract sentiment vectors from text using NRC lexicon End of explan...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/TFSlim/slim_walkthrough.ipynb
apache-2.0
import matplotlib %matplotlib inline import matplotlib.pyplot as plt import math import numpy as np import tensorflow as tf import time from datasets import dataset_utils # Main slim library slim = tf.contrib.slim """ Explanation: TF-Slim Walkthrough This notebook will walk you through the basics of using TF-Slim to...
kanhua/pypvcell
legacy/Mechanical stack 2J III-V-Si.ipynb
apache-2.0
%matplotlib inline import numpy as np from scipy.interpolate import interp2d import matplotlib.pyplot as plt from scipy.io import savemat from iii_v_si import calc_2j_si_eta, calc_2j_si_eta_direct from detail_balanced_MJ import calc_1j_eta def vary_top_eg(top_cell_qe,n_s=1): topcell_eg = np.linspace(0.9, 3, num=10...
dacr26/CompPhys
.ipynb_checkpoints/01_01_euler-checkpoint.ipynb
mit
T0 = 10. # initial temperature Ts = 83. # temp. of the environment r = 0.1 # cooling rate dt = 0.05 # time step tmax = 60. # maximum time nsteps = int(tmax/dt) # number of steps T = T0 for i in range(1,nsteps+1): new_T = T - r*(T-Ts)*dt T = new_T print i,i*dt, T # we can also do t = t - r*(t-t...
datapolitan/lede_algorithms
class2_1/EDA_Review.ipynb
gpl-2.0
df = pd.read_csv('data/ontime_reports_may_2015_ny.csv') df.describe() """ Explanation: Loading data Simple stuff. We're loading in a CSV here, and we'll run the describe function over it to get the lay of the land. End of explanation """ df.sort('ARR_DELAY', ascending=False).head(1) """ Explanation: In journalism,...
vzg100/Post-Translational-Modification-Prediction
.ipynb_checkpoints/Phosphorylation Sequence Tests -MLP -dbptm+ELM -EnzymeBenchmarks-VectorAvr.-checkpoint.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] benchmarks = ["Data/Benchmarks/phos_CDK1.csv", "Data/Benchmarks/phos_CK2.csv", "Data/B...
bashtage/statsmodels
examples/notebooks/statespace_local_linear_trend.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd from scipy.stats import norm import statsmodels.api as sm import matplotlib.pyplot as plt """ Explanation: State space modeling: Local Linear Trends This notebook describes how to extend the statsmodels statespace classes to create and estimate a custom model....
deculler/MachineLearningTables
Chapter3-1.ipynb
bsd-2-clause
# HIDDEN # For Tables reference see http://data8.org/datascience/tables.html # This useful nonsense should just go at the top of your notebook. from datascience import * %matplotlib inline import matplotlib.pyplot as plots import numpy as np from sklearn import linear_model plots.style.use('fivethirtyeight') plots.rc('...
epicf/ef
examples/ribbon_beam_in_magnetic_field_contour/Ribbon Beam Contour in Uniform Magnetic Field.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from sympy import * init_printing() Ex, Ey, Ez = symbols("E_x, E_y, E_z") Bx, By, Bz, B = symbols("B_x, B_y, B_z, B") x, y, z = symbols("x, y, z") vx, vy, vz, v = symbols("v_x, v_y, v_z, v") t = symbols("t") q, m = symbols("q, m") c, eps0 = symbols("c, epsilon_0") "...
quantopian/research_public
notebooks/lectures/Introduction_to_Futures/questions/notebook.ipynb
apache-2.0
# Useful Libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Exercises: Introduction to Futures Contracts By Christopher van Hoecke, Maxwell Margenot, and Delaney Mackenzie Lecture Link : https://www.quantopian.com/lectures/introduction-to-futures IMPORTANT NOTE: This lect...
amkatrutsa/MIPT-Opt
Spring2021/acc_grad.ipynb
mit
import numpy as np n = 100 # Random # A = np.random.randn(n, n) # A = A.T.dot(A) # Clustered eigenvalues A = np.diagflat([np.ones(n//4), 10 * np.ones(n//4), 100*np.ones(n//4), 1000* np.ones(n//4)]) U = np.random.rand(n, n) Q, _ = np.linalg.qr(U) A = Q.dot(A).dot(Q.T) A = (A + A.T) * 0.5 print("A is normal matrix: ||AA*...
VVard0g/ThreatHunter-Playbook
docs/tutorials/jupyter/notebooks/01_intro_to_python.ipynb
mit
for x in list(range(5)): print("One number per loop..") print(x) if x > 2: print("The number is greater than 2") print("----------------------------") """ Explanation: Introduction to Python Goals: Learn basic Python operations Understand differences in data structures Get familiarized wi...
MDAnalysis/cellgrid
tutorials/CellGrid_Tutorial.ipynb
mit
import numpy as np import cellgrid """ Explanation: CellGrid tutorial CellGrids are an object than contains coordinates, which are split into Cells End of explanation """ coords = np.random.random(30000).reshape(10000, 3).astype(np.float32) * 10.0 box = np.ones(3).astype(np.float32) * 10.0 """ Explanation: We'll st...
awadalaa/DataSciencePractice
practice/05.LinearRegression.ipynb
mit
# conventional way to import pandas import pandas as pd # read CSV file directly from a URL and save the results data = pd.read_csv('http://www-bcf.usc.edu/~gareth/ISL/Advertising.csv', index_col=0) # display the first 5 rows data.head() """ Explanation: Data science pipeline: pandas, seaborn, scikit-learn¶ Agenda ...
dsacademybr/PythonFundamentos
Cap11/DSA-Python-Cap11-Machine-Learning.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 11</font> Download: http://github.com/dsacademybr End of explanation """ from I...
elektrobohemian/courses
InformationRetrieval.ipynb
mit
# This cell has to be run to prepare the Jupyter notebook # The %... is an Jupyter thing, and is not part of the Python language. # In this case we're just telling the plotting library to draw things on # the notebook, instead of on a separate window. %matplotlib inline # See all the "as ..." contructs? They're just a...
metpy/MetPy
v0.9/_downloads/3aec65fc693ccd0216a40e663bc10ddb/Hodograph_Inset.ipynb
bsd-3-clause
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes import numpy as np import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, Hodograph, SkewT from metpy.units import units """ Explanation: Hodograph Inset ...
Chipe1/aima-python
notebooks/chapter22/Parsing.ipynb
mit
psource(Chart) """ Explanation: Parsing Overview Syntactic analysis (or parsing) of a sentence is the process of uncovering the phrase structure of the sentence according to the rules of grammar. There are two main approaches to parsing. Top-down, start with the starting symbol and build a parse tree with the given w...
dkirkby/quantum-demo
jupyter/PerturbTheory.ipynb
mit
%pylab inline """ Explanation: Time-Independent Perturbation Theory End of explanation """ def plot_1d_unperturbed(a=1, nmax=3, ngrid=100): x = np.linspace(0, a, ngrid) fig, ax = plt.subplots(1, 2, figsize=(12, 5)) for n in range(1, nmax + 1): color = 'krgb'[n - 1] psi = np.sqrt(2 / a) * ...
stijnvanhoey/course_gis_scripting
_solved/02-scientific-python-introduction.ipynb
bsd-3-clause
import matplotlib.pyplot as plt %matplotlib inline plt.style.use('seaborn-white') """ Explanation: <p><font size="6"><b>Scientific Python essentials</b></font></p> Introduction to GIS scripting May, 2017 © 2017, Stijn Van Hoey (&#115;&#116;&#105;&#106;&#110;&#118;&#97;&#110;&#104;&#111;&#101;&#121;&#64;&#103;&#109;&...
google/iree
samples/colab/tensorflow_hub_import.ipynb
apache-2.0
#@title Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ Explanation: Copyright 2021 The IREE Authors End of explanation """ %%capture !python -m pip install iree-compiler iree-runtim...
luofan18/deep-learning
intro-to-rnns/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...
gully/PyKE
docs/source/tutorials/ipython_notebooks/motion-correction/Replicate_Vanderburg_2014_K2SFF.ipynb
mit
from pyke import KeplerTargetPixelFile %matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import matplotlib.pyplot as plt """ Explanation: Replicate Vanderburg & Johnson 2014 K2SFF Method In this notebook we will replicate the K2SFF method from Vanderburg and Johnson 2014. The paper ...
adelle207/pyladies.cz
original/v1/s011-dicts/simple-api.ipynb
mit
import requests # Stažení stránky stranka = requests.get('https://python.cz/') # Ověření, že se vše povedlo stranka.raise_for_status() # Vypsání obsahu stránky print(stranka.text) """ Explanation: Ukázka práce s API Instalace knihovny requests Aktivujte si virtuální prostředí a v něm spusťte následující příkaz (ven...
aymeric-spiga/mcd-python
tutorial/mcd-python_tutorial.ipynb
gpl-2.0
from mcd import mcd # This line configures matplotlib to show figures embedded in the notebook. %matplotlib inline """ Explanation: python package for the Mars Climate Database: how to use? NB: to learn how to directly wrap within python the Fortran routine call_mcd compiled with f2py, look at the folder test_mcd Gen...
SciTools/cube_browser
doc/browsing_cubes/four_axes.ipynb
bsd-3-clause
import iris import iris.plot as iplt import matplotlib.pyplot as plt from cube_browser import Contour, Browser, Contourf, Pcolormesh """ Explanation: Four Axes This notebook demonstrates the use of Cube Browser to produce multiple plots using only the code (i.e. no selection widgets). End of explanation """ air_pot...
kingmolnar/MSA8150
Lecture Notes/03-InformationBased/03-InformationBased.ipynb
cc0-1.0
### define function information gain IG(d_feature, D_set) def IG(d_feature, D_set): # compute the information gain by dividing with feature d return 0.0 def splitDataSet(d_feature, D_set): Left_set = [] Right_set = [] return (Left_set, Right_set) def myID3(list_of_features, D_set): if len(list...
tmolteno/TART
doc/calibration/positions/site_survey.ipynb
lgpl-3.0
import numpy as np from scipy.optimize import minimize x0 = [0,0] x1 = [0, 2209] """ Explanation: Antenna Position Measurement Author: Tim Molteno. tim@elec.ac.nz. The antennas are laid out on tiles, and these tiles are placed on site. Once this is done, a survey is needed to refine the positions of each antenna in ...
JarronL/pynrc
docs/tutorials/HR8799_DMS_Level1b.ipynb
mit
# Import the usual libraries import numpy as np import matplotlib import matplotlib.pyplot as plt #import matplotlib.patches as mpatches # Enable inline plotting %matplotlib inline # Progress bar from tqdm.auto import trange, tqdm import pynrc from pynrc.simul.ngNRC import create_level1b_FITS # Disable informationa...
timnon/pyschedule
example-notebooks/readme-notebook.ipynb
apache-2.0
pip install pyschedule """ Explanation: pyschedule - resource-constrained scheduling in python pyschedule is the easiest way to match tasks with resources. Do you need to plan a conference or schedule your employees and there are a lot of requirements to satisfy, like availability of rooms or maximal allowed working ...
shikhar413/openmc
examples/jupyter/post-processing.ipynb
mit
%matplotlib inline from IPython.display import Image import numpy as np import matplotlib.pyplot as plt import openmc """ Explanation: Post Processing This notebook demonstrates some basic post-processing tasks that can be performed with the Python API, such as plotting a 2D mesh tally and plotting neutron source site...
eds-uga/csci1360-fa16
assignments/A5/A5_Q2.ipynb
mit
assert Movie m = Movie(title = "Avengers: Infinity War", year = 2018, stars = 4.9, genre = "Action/Adventure", "Chris Evans", "Robert Downey, Jr.", "Scarlett Johansson") assert m.title == "Avengers: Infinity War" assert m.year == 2018 assert set(m.starring) == set(["Chris Evans", "Robert Downey, Jr.", "Scarlett Johans...
Brunel-Visualization/Brunel
python/src/examples/.ipynb_checkpoints/Brunel Cars-checkpoint.ipynb
apache-2.0
import pandas as pd import ibmcognitive cars = pd.read_csv("data/Cars.csv") cars.head(6) """ Explanation: Demo of Brunel on Cars Data The Data We read the data into a pandas data frame. In this case we are grabbing some data that represents cars. We read it in and call the brunel use method to ensure the names are us...
chetan51/nupic.research
projects/dynamic_sparse/notebooks/kWinners-backup.ipynb
gpl-3.0
dataset = Dataset(config=dict(dataset_name='MNIST', data_dir='~/nta/results')) # build up a small neural network inputs = [] def init_weights(): W1 = torch.randn((4,10), requires_grad=True) b1 = torch.zeros(10, requires_grad=True) W2 = torch.randn((10,3), requires_grad=True) b2 = torch.zeros(3, requi...
atavory/ibex
examples/boston_plotting_cv_preds.ipynb
bsd-3-clause
import pandas as pd import numpy as np from sklearn import datasets from sklearn import model_selection import seaborn as sns sns.set_style('whitegrid') sns.despine() from ibex import trans from ibex.sklearn import linear_model as pd_linear_model from ibex.sklearn import decomposition as pd_decomposition from ibex.skl...
tensorflow/model-remediation
docs/min_diff/guide/integrating_min_diff_with_min_diff_model.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...
cahya-wirawan/SDC-LaneLines-P1
test.ipynb
mit
import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np %matplotlib inline img = mpimg.imread('test.jpg') plt.imshow(img) """ Explanation: Run all the cells below to make sure everything is working and ready to go. All cells should run without error. Test Matplotlib and Plotting End of exp...
hektor-monteiro/python-notebooks
aula-11_Solucao-EDOs.ipynb
gpl-2.0
################################################################ # Queda livre # definindo o problema # # d^2x/dt^2 = −g # # y = [x,v] e dy/dt = [v,-g] # # definimos o estado do sistema como y # def quedalivre(estado, tempo): g0 = estado[1] g1 = -9.8 return np.array( [ g0 , g1 ] ) """ Expl...
ioam/geoviews
examples/Homepage.ipynb
bsd-3-clause
import geoviews as gv import geoviews.feature as gf import xarray as xr from cartopy import crs gv.extension('bokeh', 'matplotlib') (gf.ocean + gf.land + gf.ocean * gf.land * gf.coastline * gf.borders).opts( 'Feature', projection=crs.Geostationary(), global_extent=True, height=325).cols(3) """ Explanation: GeoVi...
chungjjang80/FRETBursts
notebooks/Example - Exporting Burst Data Including Timestamps.ipynb
gpl-2.0
from fretbursts import * sns = init_notebook() """ Explanation: Exporting Burst Data This notebook is part of a tutorial series for the FRETBursts burst analysis software. In this notebook, show a few example of how to export FRETBursts burst data to a file. <div class="alert alert-info"> Please <b>cite</b> FRETBu...
abhi1509/deep-learning
language-translation/dlnd_language_translation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) """ Explanation: Language Translation In this project, you’re going...
letsgoexploring/beapy-package
beapyExample.ipynb
mit
import numpy as np import pandas as pd import urllib import datetime import matplotlib.pyplot as plt %matplotlib inline %load_ext autoreload %autoreload 2 import beapy apiKey = '3EDEAA66-4B2B-4926-83C9-FD2089747A5B' bea = beapy.initialize(apiKey =apiKey) """ Explanation: beapy beapy is a Python package for obtaining...
brianbreitsch/sportstat
notebooks/parsing-example.ipynb
bsd-3-clause
osu_roster_filepath = '../data/osu_roster.csv' """ Explanation: Parsing tsv files and populating the database End of explanation """ !head {osu_roster_filepath} """ Explanation: Inspecting the first few lines of the file, we get a feel for this data schema. Mongo Considerations: - can specify categories for validat...
intel-analytics/BigDL
apps/anomaly-detection-hd/autoencoder-zoo.ipynb
apache-2.0
from bigdl.dllib.nncontext import * sc = init_nncontext("Anomaly Detection HD Example") from scipy.io import arff import pandas as pd import os dataset = "ionosphere" #real world dataset data_dir = os.getenv("BIGDL_HOME")+"/bin/data/HiCS/"+dataset+".arff" rawdata, _ = arff.loadarff(data_dir) data = pd.DataF...
mariedekou/pymks_overview
notebooks/.ipynb_checkpoints/cahn_hilliard-checkpoint.ipynb
mit
%matplotlib inline %load_ext autoreload %autoreload 2 import numpy as np import matplotlib.pyplot as plt """ Explanation: Cahn-Hilliard Example This example demonstrates how to use PyMKS to solve the Cahn-Hilliard equation. The first section provides some background information about the Cahn-Hilliard equation as wel...
mne-tools/mne-tools.github.io
0.24/_downloads/7b89f7dac105a44e25d2fbdd898b911f/vector_mne_solution.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD-3-Clause import numpy as np import mne from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, apply_inverse print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' smoothing_steps = 7 # Rea...
tomilsinszki/python_samples
learningPython.ipynb
mit
print("Hello World") """ Explanation: Learning Python Hello World print is a method that will print some text End of explanation """ x = 1 if x < 0: print("x is negative") elif x == 0: print("x is zero") elif 0 < x: print("x is positive") else: print("ERROR") """ Explanation: Indentation Instead of...
yavuzovski/playground
machine learning/google-ml-crash-course/first_steps_with_tf.ipynb
gpl-3.0
# Load the necessary libraries import math from IPython import display from matplotlib import cm, gridspec, pyplot as plt import numpy as np import pandas as pd from sklearn import metrics import tensorflow as tf from tensorflow.python.data import Dataset tf.logging.set_verbosity(tf.logging.ERROR) pd.options.display....
brillozon-code/pebaystats
examples/aggregation_example.ipynb
apache-2.0
import numpy as np import nose.tools as nt from pebaystats import dstats """ Explanation: Demonstrate Aggregation of Descriptive Statistics Here we create an array of random values and for each row of the array, we create a distinct pebaystats.dstats object to accumulate the descriptive statistics for the values ...
statsmodels/statsmodels.github.io
v0.12.1/examples/notebooks/generated/regression_plots.ipynb
bsd-3-clause
%matplotlib inline from statsmodels.compat import lzip import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import ols plt.rc("figure", figsize=(16,8)) plt.rc("font", size=14) """ Explanation: Regression Plots End of explanation """ prestige = sm.datasets.get...
jupyter-widgets/ipywidgets
docs/source/examples/Using Interact.ipynb
bsd-3-clause
from __future__ import print_function from ipywidgets import interact, interactive, fixed, interact_manual import ipywidgets as widgets """ Explanation: Using Interact The interact function (ipywidgets.interact) automatically creates user interface (UI) controls for exploring code and data interactively. It is the eas...
goodwordalchemy/thinkstats_notes_and_exercises
code/chap14_analytical_methods.ipynb
gpl-3.0
live, firsts, others = first.MakeFrames() """ Explanation: Central Limit Theorem if we add up n values for almost any distribution the distribution of the sum converges to normal as n increases. values have to be drawn independently values have to come from same distribution (relaxed) distribution has to have finite ...
napsternxg/gensim
docs/notebooks/nmf_tutorial.ipynb
gpl-3.0
import logging import time from contextlib import contextmanager import os from multiprocessing import Process import psutil import numpy as np import pandas as pd from numpy.random import RandomState from sklearn import decomposition from sklearn.cluster import MiniBatchKMeans from sklearn.datasets import fetch_olive...
c22n/ion-channel-ABC
docs/examples/getting_started.ipynb
gpl-3.0
# Importing standard libraries import numpy as np import pandas as pd """ Explanation: Getting Started This notebook gives a whirlwind overview of the ionchannelABC library and can be used for testing purposes of a first installation. The notebook follows the workflow for parameter inference of a generic T-type Ca2+ c...
sandrofsousa/Resolution
Pysegreg/Pysegreg_notebook_distance.ipynb
mit
# Imports import numpy as np np.seterr(all='ignore') import pandas as pd from decimal import Decimal import time # Import python script with Pysegreg functions from segregationMetrics import Segreg # Instantiate segreg as cc cc = Segreg() """ Explanation: Pysegreg run - Distance based Instructions For fast processi...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex27-Wind Rose.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from matplotlib import pyplot as plt import matplotlib.cm as cm import numpy as np from math import pi from windrose import WindroseAxes, WindAxes, plot_windrose from pylab import rcParams rcParams['figure.figsize'] = 6, 6 """ Explanation: Wind Rose A wind ro...
andreyf/machine-learning-examples
linear_models/Logistic Gradient Descent.ipynb
gpl-3.0
from sklearn import datasets import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set(style='ticks', palette='Set2') import pandas as pd import numpy as np import math from __future__ import division data = datasets.load_iris() X = data.data[:100, :2] y = data.target[:100] X_full = data.data[:1...
jllanfranchi/playground
test_sqlite/test_sqlite.ipynb
mit
def adapt_array(arr): out = io.BytesIO() np.save(out, arr) out.seek(0) return sqlite3.Binary(out.read()) def convert_array(text): out = io.BytesIO(text) out.seek(0) return np.load(out) # Converts np.array to TEXT when inserting sqlite3.register_adapter(np.ndarray, adapt_array) # Converts ...
yunfeiz/py_learnt
sample_code/date_utils.ipynb
apache-2.0
col_show = ['name', 'open', 'pre_close', 'price', 'high', 'low', 'volume', 'amount', 'time', 'code'] initial_letter = ['HTGD','OFKJ','CDKJ','ZJXC','GXKJ','FHTX','DZJG'] code =[] for letter in initial_letter: code.append(df[df['UP']==letter].code[0]) #print(code) if code != '': #not empty != '' df_price = t...
pelodelfuego/word2vec-toolbox
notebook/classification/antonyms.ipynb
gpl-3.0
summaryDf = pd.DataFrame([extractSummaryLine(l) for l in open('../../data/learnedModel/anto/summary.txt').readlines()], columns=['bidirectional', 'strict', 'clf', 'feature', 'post', 'precision', 'recall', 'f1']) summaryDf.sort_values('f1', ascending=False)[:10] """ Explanation: Experience Base...
AlphaSmartDog/DeepLearningNotes
Note-3 Tensor Ridge Regression/global dimensionality reduction (GDR) algorithm Ver 1.0.ipynb
mit
import numpy as np import pandas as pd from scipy import linalg from scipy import optimize import functools import tensorly from tensorly.decomposition import partial_tucker from tensorly.decomposition import tucker tensorly.set_backend('numpy') """ Explanation: global dimensionality-reduction (GDR) algorithm 示例 End...
daniestevez/jupyter_notebooks
Lucy/Lucy frames Bochum 2021-10-24.ipynb
gpl-3.0
def timestamps(packets): epoch = np.datetime64('2000-01-01T12:00:00') t = np.array([struct.unpack('>I', p[ccsds.SpacePacketPrimaryHeader.sizeof():][:4])[0] for p in packets], 'uint32') return epoch + t * np.timedelta64(1, 's') def load_frames(path): frame_size = 223 * 5 - 2 frames...
fmfn/BayesianOptimization
examples/basic-tour.ipynb
mit
def black_box_function(x, y): """Function with unknown internals we wish to maximize. This is just serving as an example, for all intents and purposes think of the internals of this function, i.e.: the process which generates its output values, as unknown. """ return -x ** 2 - (y - 1) ** 2 + 1 ...
rajul/tvb-library
tvb/simulator/demos/surface_deterministic_stimulus.ipynb
gpl-2.0
from tvb.datatypes.cortex import Cortex from tvb.simulator.lab import * """ Explanation: Demonstrate using the simulator for a surface simulation. Run time: approximately 2 min (workstation circa 2010). Memory requirement: ~ 1 GB End of explanation """ LOG.info("Configuring...") #Initialise a Model, Coupling, and ...
TomTranter/OpenPNM
examples/tutorials/Intro to OpenPNM - Advanced.ipynb
mit
import warnings import numpy as np import scipy as sp import openpnm as op %matplotlib inline np.random.seed(10) ws = op.Workspace() ws.settings['loglevel'] = 40 np.set_printoptions(precision=4) pn = op.network.Cubic(shape=[10, 10, 10], spacing=0.00006, name='net') """ Explanation: Tutorial 3 of 3: Advanced Topics and...
team-hdnet/hdnet
examples/demoValidation.ipynb
gpl-3.0
true_spikes = hdnet.spikes.Spikes(spikes=hdnet.sampling.sample_from_ising_gibbs(J=Js[0,:15,:15], theta=thetas[0,:15], num_samples = 10**3, burn_in = 5*10**2, sampling_steps = 10**2)) print(true_spikes._spikes.shape) """ Explanation: Generating Spike Train from First Trial, and only first 15 Neurons, of the fitted par...
MatteusDeloge/opengrid
notebooks/Demo_caching.ipynb
apache-2.0
import pandas as pd from opengrid.library import misc from opengrid.library import houseprint from opengrid.library import caching from opengrid.library import analysis import charts hp = houseprint.Houseprint() """ Explanation: Demo caching This notebook shows how caching of daily results is organised. First we show ...
zero323/spark
python/docs/source/getting_started/quickstart_df.ipynb
apache-2.0
from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() """ Explanation: Quickstart: DataFrame This is a short introduction and quickstart for the PySpark DataFrame API. PySpark DataFrames are lazily evaluated. They are implemented on top of RDDs. When Spark transforms data, it does not immedi...
kbrose/article-tagging
lib/notebooks/explorations.ipynb
mit
print('# total articles :', df.shape[0]) print('# tagged articles :', df.loc[:, 'OEMC':'TASR'].any(1).sum()) print('# not relevant articles:', (~df['relevant']).sum()) print('# w/ no information :', df.shape[0] - df.loc[:, 'OEMC':'TASR'].any(1).sum() - (~df['relevant']).sum()) print('# w/ location info ...
patryk-oleniuk/emotion_recognition
temp/emotion_recognition_Oleniuk_Galotta_v1.ipynb
gpl-3.0
import random import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import csv import scipy.misc import time import collections import os import utils as ut import importlib import copy importlib.reload(ut) %matplotlib inline plt.rcParams['figure.figsize'] = (20.0, 20.0) # set default size of plo...
mtambos/springleaf
Springleaf - preprocess - string columns.ipynb
mit
%pylab inline %load_ext autoreload %autoreload 2 from __future__ import division from collections import defaultdict, namedtuple from datetime import datetime, timedelta from functools import partial import inspect import json import os import re import sys import cPickle as pickle import numpy as np import pandas a...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/sandbox-2/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'sandbox-2', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: MIROC Source ID: SANDBOX-2 Topic: Aerosol Sub-Topics: Transport, Emissions, Con...
kubeflow/pipelines
components/gcp/dataflow/launch_flex_template/sample.ipynb
apache-2.0
%%capture --no-stderr !pip3 install kfp --upgrade """ Explanation: Name Data preparation by using a Flex template to submit a job to Cloud Dataflow Labels GCP, Cloud Dataflow, Kubeflow, Pipeline Summary A Kubeflow Pipeline component to prepare data by using a Flex template to submit a job to Cloud Dataflow. Details I...
rkburnside/python_development
notes and useful info/useful info.ipynb
gpl-2.0
# strings s = 'Hello World' print(s[2]) s[:3] s[:-1] # Grab everything but the last lettesr s[::1] # Grab everything, but go in steps size of 1 s[::-1] # string backward s[1:] # Grab everything past the first term all the way to the length of s which is len(s) s[::2] # Grab everything, but go in step sizes of 2 s + ' c...
scikit-optimize/scikit-optimize.github.io
0.8/notebooks/auto_examples/plots/visualizing-results.ipynb
bsd-3-clause
print(__doc__) import numpy as np np.random.seed(123) import matplotlib.pyplot as plt """ Explanation: Visualizing optimization results Tim Head, August 2016. Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt Bayesian optimization or sequential model-based optimization uses a surrogate model to model the...
machinelearningdeveloper/lc101-kc
December 15, 2016/Covered in class.ipynb
unlicense
import this as t print(t) """ Explanation: Python design patterns Covering only a small portion of what exists. import this creating main functions Take a look at this guide: http://docs.python-guide.org/en/latest/writing/style/ Take a look at this "Zen of Python" by example: http://artifex.org/~hblanks/talks/2011/p...
mne-tools/mne-tools.github.io
0.17/_downloads/93d330ee6c0ab8305ae11bf7f764aeb8/plot_evoked_arrowmap.ipynb
bsd-3-clause
# Authors: Sheraz Khan <sheraz@khansheraz.com> # # License: BSD (3-clause) import numpy as np import mne from mne.datasets import sample from mne.datasets.brainstorm import bst_raw from mne import read_evokeds from mne.viz import plot_arrowmap print(__doc__) path = sample.data_path() fname = path + '/MEG/sample/samp...
blowekamp/SimpleITK-Notebook-Answers
ConnectedThresholdAndOtherFilterPerformance.ipynb
apache-2.0
img = sitk.Image(100,100, sitk.sitkUInt8) ctFilter = sitk.ConnectedThresholdImageFilter() ctFilter.SetSeed([0,0]) ctFilter.SetUpper(1) ctFilter.SetLower(0) ctFilter.AddCommand(sitk.sitkProgressEvent, lambda: print("\rProgress: {0:03.1f}%...".format(100*ctFilter.GetProgress()))) """ Explanation: Demonstrate Reporting ...
wikistat/Ateliers-Big-Data
Cdiscount/Part2-2bis-AIF-PysparkWorkflowPipeline-Cdiscount.ipynb
mit
sc # Importation des packages génériques et ceux # des librairie ML et MLlib ##Nettoyage import nltk import re ##Liste from numpy import array ##Temps import time ##Row and Vector from pyspark.sql import Row from pyspark.ml.linalg import Vectors ##Hashage et vectorisation from pyspark.ml.feature import HashingTF from...
karlstroetmann/Artificial-Intelligence
Python/5 Linear Regression/Simple-Linear-Regression-Function.ipynb
gpl-2.0
import csv """ Explanation: Simple Linear Regression We need to read our data from a <tt>csv</tt> file. The module csv offers a number of functions for reading and writing a <tt>csv</tt> file. End of explanation """ with open('cars.csv') as handle: reader = csv.DictReader(handle, delimiter=',') Data = [] ...
fantasycheng/udacity-deep-learning-project
tv-script-generation/dlnd_tv_script_generation_2.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...