repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
cogeorg/black_rhino | examples/degroot/Analyse_deGroot.ipynb | gpl-3.0 | de_groot_data = pd.read_csv('measurements/Measurement_degroot_new.csv', index_col=0)
"""
Explanation: Analyse deGroot
The notebook can be used to analyse the output of the deGroot model.
End of explanation
"""
de_groot_data.head(3)
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(10,6))
ax.plot(de_groot_data.inde... |
mne-tools/mne-tools.github.io | 0.23/_downloads/a9e07affc8c71aa96bb4ffe855ff552c/morph_surface_stc.ipynb | bsd-3-clause | # Author: Tommy Clausner <tommy.clausner@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import mne
from mne.datasets import sample
print(__doc__)
"""
Explanation: Morph surface source estimate
This example demonstrates how to morph an individual subject's
:class:mne.SourceEstimate to a common ... |
jinntrance/MOOC | coursera/ml-regression/assignments/week-6-local-regression-assignment-blank.ipynb | cc0-1.0 | import graphlab
"""
Explanation: Predicting house prices using k-nearest neighbors regression
In this notebook, you will implement k-nearest neighbors regression. You will:
* Find the k-nearest neighbors of a given query input
* Predict the output for the query input using the k-nearest neighbors
* Choose the be... |
shaypal5/rotten_needles | notebooks/Stats.ipynb | mit | imdb = pd.read_csv("C:\\Users\\Adam\\Google Drive\\School\\ComputerScience\\intro to data science\\rotten_needles\\data\\datasets\\movies_dataset.csv")
#imdb = imdb.dropna()
imdb = imdb.assign(rating10=(imdb['rating']*10))
imdb = imdb.assign(metascore10=(imdb['metascore']/10))
"""
Explanation: import data and drop NAs... |
mabevillar/rmtk | rmtk/vulnerability/derivation_fragility/NLTHA_on_SDOF/MSA_on_SDOF.ipynb | agpl-3.0 | import MSA_on_SDOF
from rmtk.vulnerability.common import utils
import numpy as np
%matplotlib inline
"""
Explanation: Multiple Stripe Analysis (MSA) for Single Degree of Freedom (SDOF) Oscillators
In this method, a single degree of freedom (SDOF) model of each structure is subjected to non-linear time history analysi... |
jacobdein/alpine-soundscapes | examples/Playing with rasterio and fiona.ipynb | mit | sample_points_filepath = ""
DEM_filepath = ""
elevation_filepath = ""
"""
Explanation: Playing with rasterio and fiona
Variable declarations
sample_points_filepath – path to sample points shapefile <br />
DEM_filepath – path to DEM raster <br />
elevation_filepath – path to export excel file containing elevation val... |
thomasmeagher/DS-501 | lectures/06 Machine Learning Part 1 and Midterm Review/2_ML.ipynb | mit | # Old libraries that we know and love.
import numpy as np
import matplotlib.pylab as py
import pandas as pa
%matplotlib inline
# Our new libraries.
from sklearn import datasets
from mpl_toolkits.mplot3d import Axes3D
import mayavi.mlab as mlab
iris = datasets.load_iris()
"""
Explanation: Loading in the libraries.
En... |
particle-physics-playground/playground | activities/activity01_cms_dimuons.ipynb | mit | import numpy as np
import matplotlib.pylab as plt
%matplotlib notebook
import h5hep
import pps_tools as hep
from file_download_tools import download_file
infile = "../data/dimuons_1000_collisions.hdf5"
print("Reading in the data....")
collisions = hep.get_collisions(infile,experiment='CMS',verbose=False)
print(... |
giraph/data-sci | poker/Poker Odds.ipynb | unlicense | KNOWN = 5
UNKNOWN = 47
def card_odds(outs):
duds = UNKNOWN - outs
#return '%d:%d' % (duds, outs)
return '%d:%d' % (round(duds/outs), 1)
print(card_odds(1))
print(card_odds(6))
print(card_odds(11))
print(card_odds(16))
print(card_odds(21))
print(card_odds(26))
print(card_odds(31))
print(card_odds(36))
"""... |
ES-DOC/esdoc-jupyterhub | notebooks/thu/cmip6/models/sandbox-3/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'thu', 'sandbox-3', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: THU
Source ID: SANDBOX-3
Topic: Aerosol
Sub-Topics: Transport, Emissions, Concent... |
aleph314/K2 | Statistical Inference/HR-Exercise.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# read data
df = pd.read_csv('HR_comma_sep.csv')
# print first rows
df.head()
# print info, we have no nulls
df.info()
# describe numeric columns
# satisfaction_level and last_evaluation seems percentages
# work_accident, left... |
BL-Labs/poetryhunt | Clustering running notepad.ipynb | mit | %matplotlib inline
import mpld3
mpld3.enable_notebook()
# Get the dataset:
from clustering import create_cluster_dataset, NewspaperArchive
DBFILE = "1749_1750_no_drift.db"
n = NewspaperArchive()
ds = create_cluster_dataset(n, daterange = [1749, 1750], dbfile = DBFILE)
"""
Explanation: Clustering experiments
I hope t... |
UCBerkeleySETI/breakthrough | SDR/stations/sdr_stations.ipynb | gpl-3.0 | def calc_time_diff(time1, time2):
"""returns difference in seconds between time 1 and time 2
time1, time2: strings in format hh:mm:ss
"""
str_to_sec = lambda time: sum([60**p[0]*int(p[1]) for p in enumerate(time.split(":")[::-1])])
return str_to_sec(time1) - str_to_sec(time2)
%matplotlib inlin... |
mmaelicke/scikit-gstat | tutorials/06_gstools.ipynb | mit | # import
import skgstat as skg
import gstools as gs
import numpy as np
import matplotlib.pyplot as plt
import plotly.offline as pyo
import warnings
pyo.init_notebook_mode()
warnings.filterwarnings('ignore')
# use the example from gstools
# generate a synthetic field with an exponential model
x = np.random.RandomState(... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/mpiesm-1-2-ham/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'mpiesm-1-2-ham', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: MPIESM-1-2-HAM
Topic: Ocean
Sub-Topic... |
dtamayo/reboundx | ipython_examples/TidesConstantTimeLag.ipynb | gpl-3.0 | import rebound
import reboundx
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
def getsim():
sim = rebound.Simulation()
sim.units = ('yr', 'AU', 'Msun')
sim.add(m=0.86) # post-MS Sun
sim.add(m=3.e-6, a=1., e=0.03) # Earth
sim.move_to_com()
rebx = reboundx.Extras(si... |
unpingco/Python-for-Probability-Statistics-and-Machine-Learning | chapters/machine_learning/notebooks/clustering.ipynb | mit | from IPython.display import Image
Image('https://github.com/unpingco/Python-for-Probability-Statistics-and-Machine-Learning/raw/master/python_for_probability_statistics_and_machine_learning.jpg')
%matplotlib inline
from matplotlib.pylab import subplots
import numpy as np
from sklearn.datasets import make_blobs
"""
... |
ES-DOC/esdoc-jupyterhub | notebooks/dwd/cmip6/models/sandbox-1/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-1', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: DWD
Source ID: SANDBOX-1
Topic: Atmoschem
Sub-Topics: Transport, Emissions Co... |
PyDataTokyo/pydata-tokyo-tutorial-1 | pydatatokyo_tutorial_dh.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
np.seterr(invalid='ignore') # Workaround
df = pd.read_csv("data/train.csv")
df[df.Age == 65][["Name", "Age"]]
"""
Explanation: 1. チュートリアル第一部「Data Handling」
第一部の目的
IPythonの使い方について学びます
第二部で利用するチュートリアル用のデータについて学びます。
Pandasを使ったデー... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_compute_raw_data_spectrum.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io, read_proj, read_selection
from mne... |
ES-DOC/esdoc-jupyterhub | notebooks/nuist/cmip6/models/sandbox-1/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nuist', 'sandbox-1', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NUIST
Source ID: SANDBOX-1
Topic: Landice
Sub-Topics: Glaciers, Ice.
Propertie... |
tensorflow/docs-l10n | site/ko/lattice/tutorials/keras_layers.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... |
tuanavu/python-cookbook-3rd | notebooks/ch01/16_filtering_list_elements.ipynb | mit | mylist = [1, 4, -5, 10, -7, 2, 3, -1]
# All positive values
pos = [n for n in mylist if n > 0]
print(pos)
# All negative values
neg = [n for n in mylist if n < 0]
print(neg)
# Negative values clipped to 0
neg_clip = [n if n > 0 else 0 for n in mylist]
print(neg_clip)
# Positive values clipped to 0
pos_clip = [n if ... |
google/applied-machine-learning-intensive | content/04_classification/01_binary_classification/colab.ipynb | apache-2.0 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... |
KIPAC/StatisticalMethods | tutorials/agn_photometry_metro.ipynb | gpl-2.0 | exec(open('tbc.py').read()) # define TBC and TBC_above
import astropy.io.fits as pyfits
import numpy as np
import matplotlib.pyplot as plt
from io import StringIO # StringIO behaves like a file object
import scipy.stats as st
%matplotlib inline
import corner
import incredible as cr
"""
Explanation: Tutorial: AGN Pho... |
OpenPIV/openpiv-python | openpiv/docs/src/piv_basics.ipynb | gpl-3.0 | # import the standard numerical and plotting packages
import matplotlib.pyplot as plt
import numpy as np
from skimage.io import imread
"""
Explanation: Basics of Particle Image Velocimetry (PIV)
Using open source PIV software, OpenPIV (http://www.openpiv.net) written with the great help of Python, Numpy, Scipy (http:/... |
massimo-nocentini/simulation-methods | notes/matrices-functions/riordan-arrays-ctors-thesis.ipynb | mit | from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, t, alpha
from sequences import *
init_printing()
m = 5
d_fn, h_fn = Function('d'), Function('h')
d, h = IndexedBase('d'), IndexedBase('h')
"""
Explanation: <p>
<img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jpg... |
c22n/ion-channel-ABC | docs/examples/human-atrial/standardised_ina.ipynb | gpl-3.0 | import os, tempfile
import logging
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from ionchannelABC import theoretical_population_size
from ionchannelABC import IonChannelDistance, EfficientMultivariateNormalTransition, IonChannelAcceptor
from ionchannelABC.experimen... |
Neuroglycerin/neukrill-net-work | notebooks/model_run_and_result_analyses/Interactive Pylearn2 - Integrating OpenCV features.ipynb | mit | import pylearn2.space
final_shape = (48,48)
vector_size = 100
input_space = pylearn2.space.CompositeSpace([
pylearn2.space.Conv2DSpace(shape=final_shape,num_channels=1,axes=['b',0,1,'c']),
pylearn2.space.VectorSpace(vector_size)
])
"""
Explanation: Building the model
This time we want to use a CompositeS... |
jacobdein/alpine-soundscapes | Compute location distance error.ipynb | mit | from geo.models import SampleLocation
from database.models import Site
from shapely.geometry import shape, MultiPoint
import geopandas
import pandas
import numpy
from django.db import connection
"""
Explanation: Compute location distance error
This notebook computes the average distance between the generated recording... |
SylvainCorlay/bqplot | examples/Marks/Pyplot/GridHeatMap.ipynb | apache-2.0 | np.random.seed(0)
data = np.random.randn(10, 10)
"""
Explanation: Get Data
End of explanation
"""
from ipywidgets import *
fig = plt.figure(padding_y=0.0)
grid_map = plt.gridheatmap(data)
fig
grid_map.display_format = '.2f'
grid_map.font_style = {'font-size': '16px', 'fill':'blue', 'font-weight': 'bold'}
"""
Expl... |
robertclf/FAFT | FAFT_64-points_R2C/nbFAFT128_offset_xy_2D.ipynb | bsd-3-clause | import numpy as np
import ctypes
from ctypes import *
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import math
%matplotlib inline
"""
Explanation: 2D Fast Accurate ... |
zczapran/datascienceintensive | linear_regression/Mini_Project_Linear_Regression.ipynb | mit | # special IPython command to prepare the notebook for matplotlib and other libraries
%pylab inline
import numpy as np
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
import sklearn
import seaborn as sns
# special matplotlib argument for improved plots
from matplotlib import rcParams
... |
jhjungCode/pytorch-tutorial | 05_MNIST.ipynb | mit | %matplotlib inline
"""
Explanation: Minist 예제
Minist 예제를 살펴봅시다. 사실 minist 예제는 3장 다룬 기초적인 Neural Networw와 거의 동일 합니다.
단지, 입력 DataLoader를 사용하여 Minist dataset를 이용하는 부분만 차이가 나고, 데이터량이 많아서 시간이 좀 많이 걸리는 부분입니다.
입력 DataLoader를 이용하는 것은 4장에서 잠시 다루었기 때문에, 시간을 줄이기 위해서 cuda gpu를 사용하는 부분을 추가했습니다.
입력변수와 network상의 변수의 torch.Tenso... |
PMEAL/OpenPNM | examples/simulations/transient/transient_advection_diffusion.ipynb | mit | from scipy import special
from scipy.optimize import curve_fit
import openpnm as op
%config InlineBackend.figure_formats = ['svg']
import numpy as np
np.random.seed(0)
import matplotlib.pyplot as plt
%matplotlib inline
np.set_printoptions(precision=3)
"""
Explanation: Transient Advection-Diffusion
This example will sh... |
nehal96/Deep-Learning-ND-Exercises | Recurrent Neural Networks/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... |
GoogleCloudPlatform/training-data-analyst | courses/fast-and-lean-data-science/fairing_train.ipynb | apache-2.0 | BUCKET = "gs://" # your bucket here
assert re.search(r'gs://.+', BUCKET), 'A GCS bucket is required to store your results.'
"""
Explanation: Authenticate with the docker registry first
bash
gcloud auth configure-docker
If using TPUs please also authorize Cloud TPU to access your project as described here.
Set up your... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-mh/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-mh', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-MH
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
elliotk/twitter_eda | develop/20171010_fastforwardlabs_tweet_counts.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('fivethirtyeight')
import tweepy
import numpy as np
import pandas as pd
from collections import Counter
from datetime import datetime
# Turn on retina mode for high-quality inline plot resolution
from IPython.display import set_mat... |
davidruffner/cv-people-detector | testWalkerDetection.ipynb | mit | video_capture = cv2.VideoCapture('resources/TestWalker.mp4')
# From https://www.learnopencv.com/how-to-find-frame-rate-or-frames-per-second-fps-in-opencv-python-cpp/
# Find OpenCV version
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
print major_ver, minor_ver, subminor_ver
# With webcam get(CV_... |
huggingface/pytorch-transformers | notebooks/02-transformers.ipynb | apache-2.0 | # !pip install transformers
import torch
from transformers import AutoModel, AutoTokenizer, BertTokenizer
torch.set_grad_enabled(False)
# Store the model we want to use
MODEL_NAME = "bert-base-cased"
# We need to create the model and tokenizer
model = AutoModel.from_pretrained(MODEL_NAME)
tokenizer = AutoTokenizer.... |
deepmind/deepmind-research | enformer/enformer-training.ipynb | apache-2.0 | !pip install dm-sonnet tqdm
# Get enformer source code
!wget -q https://raw.githubusercontent.com/deepmind/deepmind-research/master/enformer/attention_module.py
!wget -q https://raw.githubusercontent.com/deepmind/deepmind-research/master/enformer/enformer.py
"""
Explanation: Copyright 2021 DeepMind Technologies Limit... |
mne-tools/mne-tools.github.io | stable/_downloads/272b39eb7cbe2bfe1e8c768341ec7c56/time_frequency_simulated.ipynb | bsd-3-clause | # Authors: Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Chris Holdgraf <choldgraf@berkeley.edu>
#
# License: BSD-3-Clause
import numpy as np
from matplotlib import pyplot as plt
from mne import create_info, EpochsArray
from mne.baseline import rescale
from ... |
mattssilva/UW-Machine-Learning-Specialization | Week 1/Getting started with iPython Notebook.ipynb | mit | print ('Hello World!')
"""
Explanation: Getting started with Python
End of explanation
"""
i = 4 # int
type(i)
f = 4.1 # float
type(f)
b = True # boolean variable
s = "This is a string!"
print s
"""
Explanation: Create some variables in Python
End of explanation
"""
l = [3,1,2] # list
print l
d = {'fo... |
Aniruddha-Tapas/Applied-Machine-Learning | Ensemble Learning/Classifying Default of Credit Card Clients.ipynb | mit | import os
from sklearn.tree import DecisionTreeClassifier, export_graphviz
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn import cross_validation, metrics
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import BernoulliNB
from sklea... |
refugeehackathon/brain-backend | SpreadsheetConversion/convert_tables_for_db.ipynb | mit | import requests
from io import BytesIO
import pandas as pd
spreadsheet_url = "https://docs.google.com/spreadsheets/d/1WbYov7KrliIvh9Ei485zxPF27Wx7-CYFZliNj3hZ9WE"
stream = requests.get("{0}/export?format=xlsx".format(spreadsheet_url))
full_table = pd.read_excel(BytesIO(stream.content), sheetname="Project-DB")
ful... |
enoordeh/StatisticalMethods | examples/XrayImage/Summarizing.ipynb | gpl-2.0 | from __future__ import print_function
import astropy.io.fits as pyfits
import numpy as np
import astropy.visualization as viz
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 10.0)
targdir = 'a1835_xmm/'
imagefile = targdir+'P0098010101M2U009IMAGE_3000.FTZ'
expmapfile = targd... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-2/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-2', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-2
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties:... |
khalido/nd101 | Handwritten Digit Recognition with TFLearn.ipynb | gpl-3.0 | # 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... |
AllenDowney/ModSimPy | examples/yoyo.ipynb | mit | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import exists
filename = 'modsim.py'
if not exists(filename):
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/'
... |
robertoalotufo/ia898 | src/dftshift.ipynb | mit | import numpy as np
def dftshift(f):
import ia898.src as ia
return ia.ptrans(f, np.array(f.shape)//2)
"""
Explanation: Function dftshift
Synopse
Shifts zero-frequency component to center of spectrum.
g = iafftshift(f)
OUTPUT
g: Image.
INPUT
f: Image. n-dimensional.
Description
The origin (0,0) of the D... |
reyadji/data-512-a1 | A1.ipynb | mit | import pprint
import requests
import json
# Global variables
pagecounts_url = 'https://wikimedia.org/api/rest_v1/metrics/legacy/{apiname}/aggregate/en.wikipedia.org/{access}/monthly/{start}/{end}'
pageviews_url = 'https://wikimedia.org/api/rest_v1/metrics/{apiname}/aggregate/en.wikipedia.org/{access}/{agent}/monthly/{... |
StingraySoftware/notebooks | Modeling/ModelingExamples.ipynb | mit | %load_ext autoreload
%autoreload 2
# ignore warnings to make notebook easier to see online
# COMMENT OUT THESE LINES FOR ACTUAL ANALYSIS
import warnings
warnings.filterwarnings("ignore")
%matplotlib inline
import matplotlib.pyplot as plt
try:
import seaborn as sns
sns.set_palette("colorblind")
except ImportEr... |
materialsproject/mapidoc | example_notebooks/Programmatically Access Materials Project Electrolyte Genome Data.ipynb | bsd-3-clause | urlpattern = {
"results": "https://materialsproject.org/molecules/results?query={spec}",
"mol_json": "https://materialsproject.org/molecules/{mol_id}/json",
"mol_svg": "https://materialsproject.org/molecules/{mol_id}/svg",
"mol_xyz": "https://materialsproject.org/molecules/{mol_id}/xyz",
}
"""
Explanat... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_resample.ipynb | bsd-3-clause | # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com>
#
# License: BSD (3-clause)
from matplotlib import pyplot as plt
import mne
from mne.datasets import sample
"""
Explanation: Resampling data
When performing experiments where timing is critical, a signal with a high
sampling rate is desired. However, having a sign... |
dvirsamuel/MachineLearningCourses | Visual Recognision - Stanford/assignment2/Dropout.ipynb | gpl-3.0 | # As usual, a bit of setup
import time
import numpy as np
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.solver import Solver
%matplotlib inline
... |
smorton2/think-stats | code/chap07ex.ipynb | gpl-3.0 | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import brfss
import thinkstats2
import thinkplot
"""
Explanation: Examples and Exercises from Think Stats, 2nd Edition
http://thinkstats2.com
Copyright 2016 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
End of ... |
dynaryu/rmtk | rmtk/vulnerability/derivation_fragility/NLTHA_on_SDOF/MSA_on_SDOF.ipynb | agpl-3.0 | import MSA_on_SDOF
from rmtk.vulnerability.common import utils
import numpy as np
import MSA_utils
%matplotlib inline
"""
Explanation: Multiple Stripe Analysis (MSA) for Single Degree of Freedom (SDOF) Oscillators
In this method, a single degree of freedom (SDOF) model of each structure is subjected to non-linear tim... |
kaleoyster/nbi-data-science | Bridge Life-Cycle Models/CDF+Probability+Reconstruction+vs+Age+of+Bridges+in+the+Southwest+United+States.ipynb | gpl-2.0 | import pymongo
from pymongo import MongoClient
import time
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib.pyplot import *
import matplotlib.pyplot as plt
import folium
import datetime as dt
import random as rnd
import warnings
import datetime as dt
import csv
%matplotlib inline
"""
Explan... |
arcyfelix/Courses | 18-11-22-Deep-Learning-with-PyTorch/06-Sentiment Prediction with RNNs/Sentiment_analysis_with_RNNs.ipynb | apache-2.0 | import numpy as np
from tqdm import tqdm_notebook as tqdm
# read data from text files
with open('data/reviews.txt', 'r') as f:
reviews = f.read()
with open('data/labels.txt', 'r') as f:
labels = f.read()
print(reviews[:1000])
print()
print(labels[:20])
"""
Explanation: Sentiment Analysis with an RNN
In this n... |
KMFleischer/PyEarthScience | Visualization/PyNGL/PyEarthScience_contour_unstructured_PyNGL.ipynb | mit | import numpy as np
import math, time
import Ngl,Nio
"""
Explanation: PyEarthScience: Python examples for Earth Scientists
contour plots
Using PyNGL
Contour plot with
- unstructured data (ICON)
- CellFill
- filled contour areas
- without contour line labels
- labelbar
- title
End of explanation
"""
t1 = time.time() ... |
michael-isaev/cse6040_qna | PythonQnA_6_sorting.ipynb | apache-2.0 | a = [2, 6, 3, 4, 1, 9]
print ("List before sorting", a)
b = a.sort()
print ("That's what list.sort() returns:", b)
print ("List after sorting", a)
"""
Explanation: 6. Sorting Things out
Another topic that is surprisingly close to mutations is sorting. That relation comes because usually you need to sort a list. Sorti... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/solutions/deep_recommenders.ipynb | apache-2.0 | !pip install -q tensorflow-recommenders
!pip install -q --upgrade tensorflow-datasets
"""
Explanation: Building deep retrieval models
Learning Objectives
Converting raw input examples into feature embeddings.
Splitting the data into a training set and a testing set.
Configuring the deeper model with losses and metric... |
milroy/Spark-Meetup | exercises/01_introduction.ipynb | mit | def square(x):
return x*x
numbers = [1,2,3]
def map_squares(nums):
res = []
for x in nums:
res.append( square(x) )
return res
map_squares(numbers)
"""
Explanation: <img src='https://www.rc.colorado.edu/sites/all/themes/research/logo.png'>
Introduction to Spark
Many examples courtesy Monte Lu... |
karlstroetmann/Formal-Languages | Python/Parse-Table.ipynb | gpl-2.0 | r1 = ('E', ('E', '+', 'P'))
r2 = ('E', ('E', '-', 'P'))
r3 = ('E', ('P',))
r4 = ('P', ('P', '*', 'F'))
r5 = ('P', ('P', '/', 'F'))
r6 = ('P', ('F',))
r7 = ('F', ('(', 'E', ')'))
r8 = ('F', ('NUMBER',))
"""
Explanation: A Parse Table for a Shift-Reduce Parser
This notebook contains the parse table that is needed for ... |
afeiguin/comp-phys | 09_02_random_distributions.ipynb | mit | %matplotlib inline
import numpy as np
from matplotlib import pyplot
N = 10000
r = np.random.random(N)
xlambda = 0.1
x = -np.log(r)/xlambda
binwidth=xlambda*5
pyplot.hist(x,bins=np.arange(0.,100., binwidth),density=True);
pyplot.plot(np.arange(0.,100.,binwidth),xlambda*np.exp(-xlambda*np.arange(0.,100.,binwidth)),ls=... |
Lstyle1/Deep_learning_projects | autoencoder/Simple_Autoencoder_Solution.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
maartenbreddels/ipyvolume | docs/source/examples/popup.ipynb | mit | import ipyvolume as ipv
import ipywidgets as widgets
f = ipv.figure()
scatter = ipv.examples.gaussian(show=False, description="Blob")
scatter.popup = widgets.IntText()
ipv.show()
"""
Explanation: Popups
Ipyvolume has the option to show a popup widgets when hovering above a mark. When hovering, the widget will be shown... |
phoebe-project/phoebe2-docs | 2.2/tutorials/LC.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: 'lc' Datasets and Options
Setup
Let's first make sure we have the latest version of PHOEBE 2.2 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 in... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/sandbox-3/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetati... |
hanhanwu/Hanhan_Data_Science_Practice | sequencial_analysis/Time_Series_Movement_Prediction.ipynb | mit | from IPython.display import Image
import pandas as pd
import numpy as np
path="MovementAAL.jpg"
Image(path, width=600, height=400)
"""
Explanation: Time Series Movement Prediction
With the data provided by sensonrs, it's trying to predict whether the person moved or not.
Detailed data description & data download can... |
jgomezc1/medios | NOTEBOOKS/Ej1_EcPlano.ipynb | mit | from numpy import array, cross, dot
"""
Explanation: Ejemplo 1. Determinar la ecuación del plano que pasa por 3 puntos
Esta es de la forma:
$ax+by+cz=d$
End of explanation
"""
r1 = array([2,-1,1])
r2 = array([3,2,-1])
r3 = array([-1,3,2])
"""
Explanation: Primero determinemos el vector posición $\vec{r_{1}}$, $\v... |
appleby/fastai-courses | deeplearning1/nbs/lesson3.ipynb | apache-2.0 | from theano.sandbox import cuda
%matplotlib inline
import utils; reload(utils)
from utils import *
from __future__ import division, print_function
#path = "data/dogscats/sample/"
path = "data/dogscats/"
model_path = path + 'models/'
if not os.path.exists(model_path): os.mkdir(model_path)
batch_size=64
"""
Explanati... |
IBM/differential-privacy-library | notebooks/linear_regression.ipynb | mit | from sklearn.model_selection import train_test_split
from sklearn import datasets
dataset = datasets.load_diabetes()
X_train, X_test, y_train, y_test = train_test_split(dataset.data[:, :2], dataset.target, test_size=0.2)
print("Train examples: %d, Test examples: %d" % (X_train.shape[0], X_test.shape[0]))
"""
Explanat... |
kpei/cs-rating | wl_model/wlbet_player_model.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import datetime as dt
from scipy.stats import norm, bernoulli
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
from spcl_case import *
plt.style.use('fivethirtyeight')
"""
Explanation: Win/Loss Betting Model
End of explanation
"""
h_matches = pd.read_csv... |
Centre-Alt-Rendiment-Esportiu/att | notebooks/Serial Ports.ipynb | gpl-3.0 | import sys
#sys.path.insert(0, '/home/asanso/workspace/att-spyder/att/src/python/')
sys.path.insert(0, 'i:/dev/workspaces/python/att-workspace/att/src/python/')
"""
Explanation: <h1>Serial Ports</h1>
<hr style="border: 1px solid #000;">
<span>
<h2>Serial Port abstraction for ATT.</h2>
</span>
<br>
<span>
This notebook... |
Pinafore/ds-hw | python-tutorials/defaultdict.ipynb | mit | data = [
('california', 1),
('california', 3),
('colorado', 0),
('colorado', 10),
('washington', 2),
('washington', 4)
]
"""
Explanation: Python default dictionary vs dictionary
This notebook motivates and explains why python has default dictionaries
Read more here: https://docs.python.org/3/li... |
EstevaoVieira/udacity_projects | titanic_survival_exploration/.ipynb_checkpoints/titanic_survival_exploration-checkpoint.ipynb | mit | # Import libraries necessary for this project
import numpy as np
import pandas as pd
from IPython.display import display # Allows the use of display() for DataFrames
# Import supplementary visualizations code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Load the dataset
in_file... |
erickpeirson/statistical-computing | .ipynb_checkpoints/Hamiltonian MCMC (HMC)-checkpoint.ipynb | cc0-1.0 | dtarget = lambda x: multivariate_normal.pdf(x, mean=(3, 10), cov=[[1, 0], [0, 1]])
x1 = np.linspace(-6, 12, 101)
x2 = np.linspace(-11, 31, 101)
X, Y = np.meshgrid(x1, x2)
Z = np.array(map(dtarget, zip(X.flat, Y.flat))).reshape(101, 101)
plt.figure(figsize=(10,7))
plt.contour(X, Y, Z)
plt.xlim(0, 6)
plt.ylim(7, 13)
plt... |
verdverm/pypge | notebooks/Dissertation/data_gen/explicit_problems_5d.ipynb | mit | from pypge.benchmarks import explicit
import numpy as np
# visualization libraries
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import gridspec
# plot the visuals in ipython
%matplotlib inline
"""
Explanation: Explicit 5D Benchmarks
This file demonstrates how to generate,... |
TurkuNLP/BINF_Programming | lectures/week-3-uniprot.ipynb | gpl-2.0 | import requests as R
"""
Explanation: Sequence records, part 2
Instructions
This part of the course material does not rely on the Biopython tutorial. Rather, it shows how sequences can be searched and fetched from UniProt databases and how to use other online services.
Read the documentation for programmatic access to... |
amueller/pydata-amsterdam-2016 | Cross-validation.ipynb | cc0-1.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
End ... |
tensorflow/docs-l10n | site/ja/lattice/tutorials/shape_constraints.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... |
xMyrst/BigData | python/howto/012_Módulo_NumPy_Procesado_Datos.ipynb | gpl-3.0 | # Importamos la libería numpy
import numpy as np
# Creamos dos arrays [inicio,fin,salto]
x = np.arange(1,5)
y = np.arange(5,9)
# Creamos un array máscara
cond = np.array([True, False, False, True])
x, y
"""
Explanation: MÓDULO NumPy
PROCESADO DE DATOS MEDIANTE ARRAYS
Los arrays realizan una gestión de la memoria mucho... |
maubarsom/ORFan-proteins | phage_assembly/5_annotation/asm_v1.2/assembly_homologues/4_parse_blastn_results.ipynb | mit | #Load blastn hits
blastn_hits = pd.read_csv("blastn_hits.csv")
"""
Explanation: Load blast hits
End of explanation
"""
#List of sequences to extract
seqs_for_msa = blastn_hits[blastn_hits.db == "env_nt"].sort_values(by="ali_len",ascending=False).head(n=10)
#Export megahit ids to extract directly from fasta : Empty!
... |
yhilpisch/dx | 08_dx_fourier_pricing.ipynb | agpl-3.0 | import dx
import datetime as dt
"""
Explanation: <img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="45%" align="right" border="4">
Fourier-based Option Pricing
For several reasons, it is beneficial to have available alternative valuation and pricing approaches to the Monte Carlo simulation appr... |
cschnaars/intro-to-coding-in-python | notebooks/intro_to_coding_in_python_part_2_lists_and_dictionaries_with_code.ipynb | mit | my_friends = ['Aaron', 'Sue', 'Chris', 'Renee']
"""
Explanation: Introduction to Coding in Python, Part 2
Investigative Reporters and Editors Conference, New Orleans, June 2016<br />
By Aaron Kessler and Christopher Schnaars<br />
Lists
A list is a mutable (meaning it can be changed), ordered collection of objects. Ev... |
palandatarxcom/sklearn_tutorial_cn | notebooks/04.3-Density-GMM.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# use seaborn plotting defaults
import seaborn as sns; sns.set()
"""
Explanation: 这个分析笔记由Jake Vanderplas编辑汇总。 源代码和license文件在GitHub。 中文翻译由派兰数据在派兰大数据分析平台上完成。 源代码在GitHub上。
密度估计:高斯混合模型
我们在这里将会讨论 高斯混合模型,它是一个无监督聚类和密度估计的算法。
我们首先进行基... |
huiyi1990/maths-with-python | 02-programs.ipynb | mit | import math
x = math.sin(1.2)
"""
Explanation: Programs
Using the Python console to type in commands works fine, but has serious drawbacks. It doesn't save the work for the future. It doesn't allow the work to be re-used. It's frustrating to edit when you make a mistake, or want to make a small change. Instead, we wan... |
Kismuz/btgym | examples/setting_up_environment_basic.ipynb | lgpl-3.0 | from btgym import BTgymEnv
# Handy function:
def under_the_hood(env):
"""Shows environment internals."""
for attr in ['dataset','strategy','engine','renderer','network_address']:
print ('\nEnv.{}: {}'.format(attr, getattr(env, attr)))
for params_name, params_dict in env.params.items():
pri... |
rochelleterman/scrape-interwebz | 1_APIs/4_api_solutions.ipynb | mit | # Import required libraries
import requests
import json
from __future__ import division
import math
import csv
import matplotlib.pyplot as plt
"""
Explanation: Accessing Databases via Web APIs
End of explanation
"""
# set key
key="be8992a420bfd16cf65e8757f77a5403:8:44644296"
# set base url
base_url="http://api.nyti... |
otavio-r-filho/AIND-Deep_Learning_Notebooks | 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... |
daviddesancho/MasterMSM | examples/alanine_dipeptide/ala_dipeptide.ipynb | gpl-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
import math
import numpy as np
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"})
"""
Explanation: MSM of the alanine dipeptide
Here we run... |
dostrebel/working_place_ds_17 | 03 python II/01 Python II .ipynb | mit | lst = [11,2,34,4,5,5111]
len([11,2,'sort',4,5,5111])#zählt die Elemente einer Liste
sorted(lst)
lst.sort()
min(lst)
max(lst)
str(1212)
sum([1,2,2])
lst.remove(4)
lst.append(4)
string = 'hello, wie geht Dir?'
string.split(',')
"""
Explanation: Python II
Wiederholung: die wichtigsten Funktion
Viel mächtigere... |
gfeiden/Notebook | Daily/20150902_phoenix_bol_corrs.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as scint
"""
Explanation: Phoenix BT-Settl Bolometric Corrections
Figuring out the best method of handling Phoenix bolometric correction files.
End of explanation
"""
cd /Users/grefe950/Projects/starspot/starspot/color/tab... |
woutdenolf/spectrocrunch | doc/source/tutorials/xrfquant.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
%matplotlib inline
from spectrocrunch.materials import xrfstandards
from spectrocrunch.detectors import xrf as xrfdetectors
from spectrocrunch.geometries import xrf as xrfgeometries
from spectrocrunch.sources import xray as xraysources
source = xray... |
ueapy/ueapy.github.io | content/notebooks/2015-11-27-meeting-summary.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Today we discussed some of the basic matplotlib functions and also had a look at different ways of running Jupyter Notebooks.
Creating subplots in matplotlib
Back to basics
End of explanation
"""
plt.rcParams['figure.facecolor'] ... |
opesci/devito | examples/userapi/01_dsl.ipynb | mit | from devito import *
"""
Explanation: The Devito domain specific language: an overview
This notebook presents an overview of the Devito symbolic language, used to express and discretise operators, in particular partial differential equations (PDEs).
For convenience, we import all Devito modules:
End of explanation
"""... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/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', 'mohc', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: MOHC
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emissions ... |
weichetaru/weichetaru.github.com | notebook/data-wrangling/numpy-the-basic.ipynb | mit | import numpy as np
"""
Explanation: Numpy - Get Started
What is Numpy?
NumPy is the fundamental package for scientific computing with Python.
It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices), and an assortment of routines for fast opera... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.