repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
taspinar/siml | notebooks/WV2 - Visualizing the Scaleogram, time-axis and Fourier Transform.ipynb | mit | import os
import pywt
#from wavelets.wave_python.waveletFunctions import *
import itertools
import numpy as np
import pandas as pd
from scipy.fftpack import fft
from collections import Counter
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
... |
mdeloge/DarkSky | Basic_setup.ipynb | mit | config = ConfigParser.RawConfigParser()
config.read('synchronization.cfg')
api_key = config.get('Darksky', 'api_key')
geolocator = Nominatim()
location = geolocator.geocode('Muntstraat 10 Leuven')
latitude = location.latitude
longitude = location.longitude
base_url = config.get('Darksky', 'base_url') + api_key \
... |
FaustineLi/Sta663-Project | examples/Variational_Autoencoder_Starfish.ipynb | mit | import pickle, gzip
import matplotlib.pyplot as plt
import numpy as np
import sys
import scipy.io
%matplotlib inline
np.random.seed(0)
from vae import VAE
sil = scipy.io.loadmat('../resources/data/caltech101_16.mat')
silX = sil['X']
silY = sil['Y']
silX_train = silX[np.where(sil['Y'] == 87)[1],:][0:80,:]
silX_test ... |
jdsanch1/SimRC | 01. Parte 1/04. Clase 4/04Class NB.ipynb | mit | #importar los paquetes que se van a usar
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import datetime
from datetime import datetime
import scipy.stats as stats
import scipy as sp
import scipy.optimize as scopt
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
#algun... |
satishgoda/learning | python/libs/yaml/ruamel_1_intro.ipynb | mit | import ruamel.yaml
ruamel.yaml
ruamel
dir(ruamel)
"""
Explanation: About
ruamel.yaml is a YAML 1.2 loader/dumper package for Python. It is a derivative of Kirill Simonov’s PyYAML 3.11
ruamel.yaml supports YAML 1.2 and has round-trip loaders and dumpers that preserves, among others:
comments
block style and key ord... |
xmnlab/notebooks | jupyter/Introducción.ipynb | mit | a = 1
b = 2.2
c = 3
d = 'a'
%who
def f1(n):
for x in range(n):
pass
%%time
f1(100)
%%timeit
f1(100)
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Introducción-a-Jupyter-Notebook" data-toc-modified-id="Introducción-a-Jupyter-Notebook-1"><span class="toc-item-num">1 &nb... |
kubeflow/examples | digit-recognition-kaggle-competition/digit_recognizer_orig.ipynb | apache-2.0 | !pip install -r requirements.txt --quiet
"""
Explanation: Digit Recognizer Notebook
In this Kaggle competition
MNIST ("Modified National Institute of Standards and Technology") is the de facto “hello world” dataset of computer vision. Since its release in 1999, this classic dataset of handwritten images has served a... |
yhat/ggplot | docs/how-to/Layering Plots.ipynb | bsd-2-clause | ggplot(diamonds, aes(x='carat', y='price')) + geom_point() + ggtitle("Carat vs. Price")
"""
Explanation: Layers
Layers are one of the most powerful aspects of ggplot. The idea is to think of your plot as containing different components, or layers, which when combined together make up the entire visual.
Take the follow... |
ubcgif/gpgLabs | notebooks/seismic/Seis_Reflection.ipynb | mit | # Import the necessary packages
%matplotlib inline
from SimPEG.utils import download
from geoscilabs.seismic.syntheticSeismogram import InteractLogs, InteractDtoT, InteractWconvR, InteractSeismogram
from geoscilabs.seismic.NMOwidget import ViewWiggle, InteractClean, InteractNosiy, NMOstackthree
# from geoscilabs.sei... |
CyberCRI/dataanalysis-herocoli-redmetrics | v1.52.2/Functions/0.4 GF correct answers.ipynb | cc0-1.0 | %run "../Functions/0.2 GF French localization.ipynb"
"""
Explanation: Google form correct answers
All possible and correct answers in English and French.
End of explanation
"""
processGForm = not ('gform' in globals())
if processGForm:
gformFR1522.columns = gformEN1522.columns
"""
Explanation: Localization
Expl... |
brettavedisian/phys202-2015-work | days/day11/Interpolation.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
"""
Explanation: Interpolation
Learning Objective: Learn to interpolate 1d and 2d datasets of structured and unstructured points using SciPy.
End of explanation
"""
x = np.linspace(0,4*np.pi,10)
x
"""
Explanation: Overview
W... |
joshwalawender/POCS | examples/notebooks/POCS Operation.ipynb | mit | # Load the POCS module
from pocs import POCS
# Create an instance of POCS that acts as a simulator
pocs = POCS(simulator=['all']) # Could be a list of: 'weather', 'camera', 'mount'
"""
Explanation: An instance of POCS can be loaded and run as a simulator, which will then allow you to play with various aspects of of P... |
gghezzo/prettypython | python-data-science-intro/week_3/exploring_data.ipynb | mit | %matplotlib inline
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Exploring-and-understanding-data" data-toc-modified-id="Exploring-and-understanding-data-1"><span class="toc-item-num">1 </span>Exploring and understanding data</a></div><div class="lev1 toc-item"><a href="#What-is... |
nitin-cherian/LifeLongLearning | Python/Python Morsels/multimax/Trey's Solutions/multimax.ipynb | mit | multimax([])
def multimax(iterable):
""" Return a list of all maximum values """
try:
max_item = max(iterable)
except ValueError:
return []
return [
item
for item in iterable
if item == max_item
]
multimax([])
def multimax(iterable):
""" Return a l... |
garibaldu/multicauseRBM | Max/ORBM-XOR-X-Bits.ipynb | mit | # model = build_and_eval(3,3,epochs)
b = BernoulliRBM(n_components=3,n_iter=10000,learning_rate=0.02)
b.fit(np.eye(3))
# b.gibbs(np.array([1,0,0]))
# model.weights
model.hidden_bias
model.visible_bias
b
vs = [np.array([1,1,0]),np.array([0,1,1]),np.array([1,0,0])]
for v in vs:
eval_partitioned(model,v)
"""
Expla... |
Wx1ng/Python4DataScience.CH | Series_1_Scientific_Python/S1EP1_Numpy.ipynb | cc0-1.0 | from numpy import cos,sin #避免使用
import numpy as np #np.method()
"""
Explanation: Python数值计算库NumPy
—— 一切向量化计算的基础
1. NumPy初探
1.1 开始使用
End of explanation
"""
r1 = range(5)
r2 = np.arange(5)
r3 = xrange(5)
print r1,r2,r3
for i in r1:
print i,
print '\n'
for i in r2:
print i,
print '\n'
for i in r3:
print i... |
snowicecat/umich-eecs445-f16 | handsOn_lecture13_error-measures-and-ml-advice/handsOn13_error-measures-and-ml-advice.ipynb | mit | import matplotlib.pyplot as plt
from IPython.display import Image
%matplotlib inline
# image courtesy of Raschka, Sebastian. Python machine learning. Birmingham, UK: Packt Publishing, 2015. Print.
Image(filename='learning-curve.png', width=600)
"""
Explanation: ROC Curves
Recall that an ROC curve takes the ranking ... |
Vvkmnn/books | TensorFlowForMachineIntelligence/chapters/05_object_recognition_and_classification/Chapter 5 - 03 Layers.ipynb | gpl-3.0 | # setup-only-ignore
import tensorflow as tf
import numpy as np
# setup-only-ignore
sess = tf.InteractiveSession()
"""
Explanation: Common Layers
For a neural network architecture to be considered a CNN, it requires at least one convolution layer (tf.nn.conv2d). There are practical uses for a single layer CNN (edge de... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/Iterators and Generators Homework - Solution.ipynb | apache-2.0 | def gensquares(N):
for i in range(N):
yield i ** 2
for x in gensquares(10):
print x
"""
Explanation: Iterators and Generators Homework - Solution
Problem 1
Create a generator that generates the squares of numbers up to some number N.
End of explanation
"""
import random
random.randint(1,10)
def ra... |
empet/PSCourse | BivariateNormal.ipynb | bsd-3-clause | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import multivariate_normal as Nd
"""
Explanation: Distributia normala bivariata
In acest notebook prezentam mai multe instrumente pentru vizualizarea datelor ce au distributie normala bivariata sau sunt observatii asupra unei mixtu... |
jonathf/chaospy | docs/user_guide/polynomial/truncation_scheme.ipynb | mit | import chaospy
expansion = chaospy.monomial(start=0, stop=21, dimensions=2, graded=True)
expansion[:6]
"""
Explanation: Truncation scheme
By default, the constructor functions that create polynomial expansions are ordered using graded reversed lexicographical sorting.
In practice this mostly means that the order of t... |
redst4r/RC2015 | Session2/Til_paper.ipynb | apache-2.0 | import scipy.stats as stats
from scipy.stats import binom
from __future__ import division
%pylab
%matplotlib inline
import seaborn as sns
plt.plot([1,2,3], [2,3,5])
pylab.rcParams['figure.figsize'] = 12, 6
"""
Explanation: <center><h1>A stochastic model of stem cell proliferation, based on the growth of spleen colo... |
statsmodels/statsmodels.github.io | v0.12.1/examples/notebooks/generated/glm.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import statsmodels.api as sm
from scipy import stats
from matplotlib import pyplot as plt
plt.rc("figure", figsize=(16,8))
plt.rc("font", size=14)
"""
Explanation: Generalized Linear Models
End of explanation
"""
print(sm.datasets.star98.NOTE)
"""
Explanation: GLM: Binomial r... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-raw-out-DexDem-7d.ipynb | mit | ph_sel_name = "DexDem"
data_id = "7d"
# ph_sel_name = "all-ph"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:34:52 2017
Duration: 8 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
fro... |
tanle8/Data-Science | 1-uIDS-courseNotes/l5-MapReduce.ipynb | mit | from IPython.display import HTML
HTML('<iframe width="846" height="476" src="https://www.youtube.com/embed/KdSqUjFWzdY" frameborder="0" allowfullscreen></iframe>')
from IPython.display import HTML
HTML('<iframe width="960" height="540" src="https://www.youtube.com/embed/gYiwszKaCoQ" frameborder="0" allowfullscreen></... |
tensorflow/docs-l10n | site/en-snapshot/hub/tutorials/tweening_conv3d.ipynb | apache-2.0 | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
Hexiang-Hu/mmds | final/Final-advance.ipynb | mit | import numpy as np
A = np.array([[0, 0, 0, 0],
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0]])
mat1 = (A.T).dot(A)
print mat1
a = np.array([.25, .25, .25, .25])
for i in xrange(3):
a = mat1.dot(a)
print a
mat2 = (A).dot(A.T)
print mat2
h = np.array([.25, .25, .25, .25])
for... |
Yu-Group/scikit-learn-sandbox | jupyter/backup_deprecated_nbs/01_Exploring_Tree_Plots.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Trees and Forests
NOTE: This module code was partly taken from Andreas Muellers Adavanced scikit-learn O'Reilly Course
It is just used to explore the scikit-learn random forest object in a systematic manner
I've added more code to i... |
alexad2/XeRPI | lce_note/a_kr83m_1T.ipynb | gpl-3.0 | from xerawdp_helpers import * # helper functions for retrieving xerawdp data
from Kr83m_Basic import * # pax minitree class for Kr83m data
from cut_helpers import * # functions to apply and plot some event selections
from lce_helpers import * # functions for binning, building map files, and plot... |
NEONScience/NEON-Data-Skills | tutorials-in-development/Python/setting-working-dir-py/setting-working-dir-py.ipynb | agpl-3.0 | import os
"""
Explanation: syncID:
title: "Setting Working Directory in Python"
description: "This tutorial shows you how to set your working directory in Python."
dateCreated: 2017-12-08
authors: Donal O'Leary
contributors:
estimatedTime: 0.5 hour
packagesLibraries: os
topics: data-analysis, data-management
language... |
mne-tools/mne-tools.github.io | 0.22/_downloads/f781cba191074d5f4243e5933c1e870d/plot_find_ref_artifacts.ipynb | bsd-3-clause | # Authors: Jeff Hanna <jeff.hanna@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io
from mne.datasets import refmeg_noise
from mne.preprocessing import ICA
import numpy as np
print(__doc__)
data_path = refmeg_noise.data_path()
"""
Explanation: Find MEG reference channel artifacts
Use ICA decompos... |
tensorflow/docs-l10n | site/zh-cn/tutorials/distribute/custom_training.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... |
solgaardlab/dphox | doc/source/02_design.ipynb | mit | import dphox as dp
import numpy as np
import holoviews as hv
from trimesh.transformations import rotation_matrix
hv.extension('bokeh')
import warnings
warnings.filterwarnings('ignore') # ignore shapely warnings
"""
Explanation: Design workflow and devices in dphox
In this tutorial, we discuss the design workflow for ... |
phoebe-project/phoebe2-docs | 2.1/tutorials/MESH.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: 'mesh' Datasets and Options
Setup
Let's first make sure we have the latest version of PHOEBE 2.1 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 ... |
cloudmesh/book | notebooks/numpy/numpy.ipynb | apache-2.0 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
"""
Explanation: Numpy
This is a short introduction to Numpy.
First we import the modules needed for this introduction and abreviate them with the as feature of the import statement
End of explanation
"""
X = np.arange(0.2,1,.1)
print (X)
... |
fullmetalfelix/ML-CSC-tutorial | NeuralNetwork - TotalEnergy.ipynb | gpl-3.0 | # --- INITIAL DEFINITIONS ---
from sklearn.neural_network import MLPRegressor
import numpy, math, random
import matplotlib.pyplot as plt
from scipy.sparse import load_npz
from mpl_toolkits.mplot3d import Axes3D
"""
Explanation: Total Energy Prediction - Neural Network
Introduction
In this notebook we will machine-lear... |
rriehle/Python300-2017q3 | 2017-07-05.ipynb | gpl-3.0 | def make_multiplier_of(n):
def multiplier(x):
return x * n
return multiplier
times3 = make_multiplier_of(3)
type(times3)
times3(3)
times3(11)
times5 = make_multiplier_of(5)
times5(3)
timessomething = make_multiplier_of()
"""
Explanation: Closures
End of explanation
"""
def my_decorator(func):
... |
hankcs/HanLP | plugins/hanlp_demo/hanlp_demo/zh/sdp_mtl.ipynb | apache-2.0 | !pip install hanlp -U
"""
Explanation: <h2 align="center">点击下列图标在线运行HanLP</h2>
<div align="center">
<a href="https://colab.research.google.com/github/hankcs/HanLP/blob/doc-zh/plugins/hanlp_demo/hanlp_demo/zh/sdp_mtl.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Ope... |
shahariarrabby/Mail_Server | .ipynb_checkpoints/Receive and server Mail-checkpoint.ipynb | mit | __author__ = 'Shahariar Rabby'
import email
import imaplib
import ctypes
import getpass
import threading
from playsound import playsound
"""
Explanation: Recive Mail
Importing all dependency
End of explanation
"""
def user():
# ORG_EMAIL = "@gmail.com"
# FROM_EMAIL = "your mail" + ORG_EMAIL
# FROM_PWD = ... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day17-analyzing-tweets-with-string-processing/Twitter_Downloader.ipynb | agpl-3.0 | !pip install tweepy
"""
Explanation: Tweepy Example - Twitter api for Python
This example notebook shows the code we used to download twitter feeds for the in-class assignment. You can try to follow along but this notebook may not work on some systems.
Before starting we need to make sure Tweepy module is installed.... |
fangohr/paper-supplement-2016-dmi-nanocylinder-hysteresis | notebooks/figure-3-distorted-geometries.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib._png import read_png
"""
Explanation: Figure 3: Distorted Geometries
This notebook reproduces figure with the 3D plots which demonstrate the distorted geometries used to... |
ES-DOC/esdoc-jupyterhub | notebooks/dwd/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: DWD
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
gengyj/ml-basic-course | sklearn_titanic.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import matplotlib.pylab as plt
%matplotlib inline
import seaborn as sns
data_train = pd.read_csv("../kaggle_titanic/data//train.csv",index_col='PassengerId')
data_test = pd.read_csv("../kaggle_titanic/data/test.csv",index_col='PassengerId')
data_train.head(5)
"""
Explanation: sc... |
kdheepak/psst | docs/notebooks/interactive_visuals/NetworkGraph.ipynb | mit | from psst.network.graph import (
NetworkModel, NetworkViewBase, NetworkView
)
from psst.case import read_matpower
case = read_matpower('../cases/case118.m')
"""
Explanation: Network Graph Demo
End of explanation
"""
# Create the model from the case
m = NetworkModel(case, sel_bus='Bus1')
# Create the view from ... |
afeiguin/comp-phys | 01_01_euler.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 ('{:20.18f} {:20.18f} {:20.18f}'.format(i,i... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_creating_data_structures.ipynb | bsd-3-clause | import mne
import numpy as np
"""
Explanation: Creating MNE's data structures from scratch
MNE provides mechanisms for creating various core objects directly from
NumPy arrays.
End of explanation
"""
# Create some dummy metadata
n_channels = 32
sampling_rate = 200
info = mne.create_info(n_channels, sampling_rate)
pr... |
MartyWeissman/Python-for-number-theory | P3wNT Notebook 2.ipynb | gpl-3.0 | def square(x):
answer = x * x
return answer
"""
Explanation: Part 2: Functions in Python 3.x
A distinguishing property of programming languages is that the programmer can create their own functions. Creating a function is like teaching the computer a new trick. Typically a function will receive some data as... |
tensorflow/docs-l10n | site/zh-cn/tutorials/distribute/multi_worker_with_estimator.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... |
GustavoRP/IA369Z | dev/DTI_open_(Compartilhando o primeiro notebook)_25-04-17_GRP.ipynb | gpl-3.0 | # import modules and libs
import io, os, sys, types
import numpy as np
# image and graphic
from IPython.display import Image
from IPython.display import display
import matplotlib.pyplot as plt
%matplotlib
#import notebook as module
sys.path.append('C:/iPython/DTIlib')
import DTIlib as DTI
"""
Explanation: Openig D... |
parambharat/ML-Programs | P0:_Titanic_Survival/.ipynb_checkpoints/Titanic_Survival_Exploration-checkpoint.ipynb | mit | import numpy as np
import pandas as pd
# RMS Titanic data visualization code
from titanic_visualizations import survival_stats
from IPython.display import display
%matplotlib inline
# Load the dataset
in_file = 'titanic_data.csv'
full_data = pd.read_csv(in_file)
# Print the first few entries of the RMS Titanic data... |
hannorein/rebound | ipython_examples/WebGLVisualization.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.getWidget()
"""
Explanation: WebGL Visualization Widget
REBOUND comes with a ipython widget that can be used in Jupyter notebooks. It is similar to the OpenGL visualization in the C version of REBOUND, but it currently misses a few features such as rendering spheres and su... |
camillescott/barf | barf/Presentation.ipynb | mit | import re
import string
class SequenceModel(object):
def __init__(self, alphabet, flags=re.IGNORECASE):
self.alphabet = alphabet
self.pattern = re.compile(r'[{alphabet}]*$'.format(alphabet=alphabet),
flags=flags)
def __str__(self):
return 'SequenceMod... |
sbenthall/bigbang | examples/experimental_notebooks/Corr between centrality and community 0.1.ipynb | agpl-3.0 | %matplotlib inline
from bigbang.archive import Archive
import bigbang.parse as parse
import bigbang.graph as graph
import bigbang.mailman as mailman
import bigbang.process as process
import networkx as nx
import matplotlib.pyplot as plt
import pandas as pd
from pprint import pprint as pp
import pytz
import numpy as np... |
GoogleCloudPlatform/training-data-analyst | courses/fast-and-lean-data-science/TPU-GPU optimized Jigsaw Multilingual BERT.ipynb | apache-2.0 | # When not running on Kaggle, comment out this import
from kaggle_datasets import KaggleDatasets
# When not running on Kaggle, set a fixed GCS path here
GCS_PATH = KaggleDatasets().get_gcs_path('jigsaw-multilingual-toxic-comment-classification')
print(GCS_PATH)
"""
Explanation: To run this sample on Google Cloud Platf... |
ekaakurniawan/iPyMacLern | NNfML-W3/Perceptron.ipynb | gpl-3.0 | # Display graph inline
%matplotlib inline
# Display graph in 'retina' format for Mac with retina display. Others, use PNG or SVG format.
%config InlineBackend.figure_format = 'retina'
#%config InlineBackend.figure_format = 'PNG'
#%config InlineBackend.figure_format = 'SVG'
"""
Explanation: Part of iPyMacLern project.... |
bikeviz/bikeviz.github.io | bikeshares.ipynb | apache-2.0 | import glob
import csv
from collections import Counter
import numpy as np
from matplotlib import pyplot as plt
import re
%matplotlib inline
def get_top_trips(path,N=10):
#the headers on the CSV are slightly different depending on whether the data is from Citi or Capital
if path=="capital":
start_... |
GoogleCloudPlatform/training-data-analyst | quests/serverlessml/02_bqml/solution/first_model.ipynb | apache-2.0 | %%bash
export PROJECT=$(gcloud config list project --format "value(core.project)")
echo "Your current GCP Project Name is: "$PROJECT
%%bash
pip install tensorflow==2.6.0 --user
"""
Explanation: First BigQuery ML models for Taxifare Prediction
In this notebook, we will use BigQuery ML to build our first models for tax... |
markovmodel/adaptivemd | examples/rp/3_example_adaptive.ipynb | lgpl-2.1 | import sys, os
# stop RP from printing logs until severe
# verbose = os.environ.get('RADICAL_PILOT_VERBOSE', 'REPORT')
os.environ['RADICAL_PILOT_VERBOSE'] = 'ERROR'
from adaptivemd import (
Project,
Event, FunctionalEvent,
File
)
# We need this to be part of the imports. You can only restore known object... |
HazyResearch/flyingsquid | examples/tutorials/Video.ipynb | apache-2.0 | import numpy as np
from tutorial_helpers import *
L_train = np.load('L_train_video.npy')
L_dev = np.load('L_dev_video.npy')
Y_dev = np.load('Y_dev_video.npy')
print(L_train.shape)
print(L_dev.shape)
print(Y_dev.shape)
"""
Explanation: FlyingSquid for Video
In this notebook, we'll use FlyingSquid to train a label mod... |
martinjrobins/hobo | examples/sampling/slice-overrelaxation-mcmc.ipynb | bsd-3-clause | import pints
import pints.toy
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
# Create log pdf
log_pdf = pints.toy.GaussianLogPDF([2, 4], [[1, 0.96], [0.96, 1]])
# Contour plot of pdf
levels = np.linspace(-3,12,20)
num_points = 100
x = np.linspace(-1, 5, num_points... |
gfeiden/Notebook | Daily/20150728_peak_magnetic_field.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
radial_points = np.arange(0.01, 1.0, 0.01) # units of Rstar
bfield_scaling = radial_points**(-3.0) # see equation (1)
bfield_surface = np.arange(0.5, 4.1, 0.5) # units of kiloGauss
"""
Explanation: Peak Magnetic Field Strength
Magnetic m... |
cdawei/digbeta | dchen/music/aotm2011_subset_nice.ipynb | gpl-3.0 | %matplotlib inline
%load_ext autoreload
%autoreload 2
import os, sys
import gzip
import pickle as pkl
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import precision_recall_fscore_support
from scipy.sparse import lil_matrix, issparse
from collections im... |
dib-lab/kevlar | notebook/human-sim-pico/HumanSimulationPico.ipynb | mit | from __future__ import print_function
import subprocess
import kevlar
import random
import sys
def gen_muts():
locs = [random.randint(0, 2500000) for _ in range(10)]
types = [random.choice(['snv', 'ins', 'del', 'inv']) for _ in range(10)]
for l, t in zip(locs, types):
if t == 'snv':
val... |
BeatHubmann/17F-U-DLND | sentiment-network/Sentiment_Classification_Projects.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
volodymyrss/3ML | examples/090217206.ipynb | bsd-3-clause | import matplotlib
%matplotlib inline
"""
Explanation: <center><img src="http://identity.stanford.edu/overview/images/emblems/SU_BlockStree_2color.png" width="200" style="display: inline-block"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Main_fermi_logo_HI.jpg/682px-Main_fermi_logo_HI.jpg" width... |
MaxPowerWasTaken/MaxPowerWasTaken.github.io | jupyter_notebooks/clustering mnist.ipynb | gpl-3.0 | import math
import random
import numpy as np
import pandas as pd
from sklearn.datasets import fetch_mldata
from sklearn.cross_validation import train_test_split
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import os
"""
Explanation: Brief Code to Quickly Compare Several Baseline Predictive Models
... |
atlury/deep-opencl | DL0110EN/6.1.2Multiple Channel Convolution.ipynb | lgpl-3.0 | import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import numpy as np
from scipy import ndimage, misc
"""
Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px">
<a href="http://cocl.us/pytorch_link_top"><img src = "http://cocl.us/Pytorch_top" width = 950, align = "center"></... |
dtamayo/MachineLearning | Day2/SVC-basic.ipynb | gpl-3.0 | #import all the needed package
import numpy as np
import scipy as sp
import pandas as pd
import sklearn
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation import train_test_split,cross_val_score
from sklearn import metrics
from sklearn.data... |
spulido99/Programacion | Margarita/.ipynb_checkpoints/Taller 1-checkpoint.ipynb | mit | import sys
print('{0[0]}.{0[1]}'.format(sys.version_info))
"""
Explanation: Taller 1: Básico de Python
Funciones
Listas
Diccionarios
Este taller es para resolver problemas básicos de python. Manejo de listas, diccionarios, etc.
El taller debe ser realizado en un Notebook de Jupyter en la carpeta de cada uno. Debe ha... |
mlflow/mlflow | examples/rapids/mlflow_project/notebooks/rapids_mlflow.ipynb | apache-2.0 | #!wget -N https://rapidsai-cloud-ml-sample-data.s3-us-west-2.amazonaws.com/airline_small.parquet
"""
Explanation: Pull sample airline data
End of explanation
"""
def load_data(fpath):
"""
Simple helper function for loading data to be used by CPU/GPU models.
:param fpath: Path to the data to be ingested
... |
mne-tools/mne-tools.github.io | 0.20/_downloads/5a3a8c2664be35abac537a97ac994e3e/plot_modifying_data_inplace.ipynb | bsd-3-clause | import mne
import os.path as op
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: Modifying data in-place
It is often necessary to modify data once you have loaded it into memory.
Common examples of this are signal processing, feature extraction, and data
cleaning. Some functionality is pre-buil... |
sbarman-mi9/Apache-Spark-Tutorial | PySparkTutorial.ipynb | gpl-2.0 | import os
import sys
sys.path.append(os.environ["SPARK_HOME"] + "/python/lib/py4j-0.9-src.zip")
sys.path.append(os.environ["SPARK_HOME"] + "/python/lib/pyspark.zip")
from pyspark import SparkConf, SparkContext
from pyspark import SparkFiles
from pyspark import StorageLevel
from pyspark import AccumulatorParam
sconf ... |
mohanprasath/Course-Work | certifications/code/titanic_survival_exploration/titanic_survival_exploration.ipynb | gpl-3.0 | # 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... |
zzsza/TIL | Tensorflow/mnist.ipynb | mit | def cnn_model_fn(features, labels, mode):
input_layer = tf.reshape(features["x"], [-1, 28, 28, 1])
conv1 = tf.layers.conv2d(
inputs=input_layer,
filters=32,
kernel_size=[5, 5],
padding="same",
activation=tf.nn.relu)
pool1 = tf.layers.max... |
jdhp-docs/python_notebooks | nb_dev_python/python_scipy_interpolate_en.ipynb | mit | %matplotlib inline
"""
Explanation: Interpolation with scipy
End of explanation
"""
import numpy as np
import pandas as pd
import scipy.interpolate
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
"""
Explanation: Official documentation: https://docs.scipy.org/doc/scipy/reference/interpolate... |
xesscorp/pygmyhdl | examples/4_blockram/block_ram_party.ipynb | mit | from pygmyhdl import *
@chunk
def ram(clk_i, en_i, wr_i, addr_i, data_i, data_o):
'''
Inputs:
clk_i: Data is read/written on the rising edge of this clock input.
en_i: When high, the RAM is enabled for read/write operations.
wr_i: When high, data is written to the RAM; when low, data is ... |
dcavar/python-tutorial-for-ipython | notebooks/Bayesian Classifier.ipynb | apache-2.0 | spam = [ """Our medicine cures baldness. No diagnostics needed.
We guarantee Fast Viagra delivery.
We can provide Human growth hormone. The cheapest Life
Insurance with us. You can Lose weight with this treatment.
Our Medicine now and No medical exams necessary.
... |
diegocavalca/Studies | phd-thesis/Benchmarking Geral - Diferentes abordagens para classificação de cargas.ipynb | cc0-1.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
plt.rc('text', usetex=False)
from matplotlib.image import imsave
import pandas as pd
import pickle as cPickle
import os, sys, cv2
from math import *
from pprint import pprint
from tqdm import tqdm_notebook
from mpl_toolkits.ax... |
sarathid/Learning | Deep_learning_ND/Week 1/dlnd-your-first-network/DLND-your-first-network/.ipynb_checkpoints/dlnd-your-first-neural-network-checkpoint.ipynb | gpl-3.0 | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
mne-tools/mne-tools.github.io | 0.17/_downloads/2187adaa95700a6de5f9ba2004254a87/plot_sensor_noise_level.ipynb | bsd-3-clause | # Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import mne
data_path = mne.datasets.sample.data_path()
raw_erm = mne.io.read_raw_fif(op.join(data_path, 'MEG', 'sample',
'ernoise_raw.fif'), preload=True)
"""
Explanation: Show nois... |
ledeprogram/algorithms | class6/donow/Kandrach_Sasha_6_donow.ipynb | gpl-3.0 | import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt
import statsmodels.formula.api as smf
import numpy as np
import scipy as sp
"""
Explanation: 1. Import the necessary packages to read in the data, plot, and create a linear regression model
End of explanation
"""
df = pd.read_csv("hanford.csv")... |
projectmesa/mesa-examples | examples/Schelling/.ipynb_checkpoints/analysis-checkpoint.ipynb | apache-2.0 | import matplotlib.pyplot as plt
%matplotlib inline
from model import SchellingModel
"""
Explanation: Schelling Segregation Model
Background
The Schelling (1971) segregation model is a classic of agent-based modeling, demonstrating how agents following simple rules lead to the emergence of qualitatively different macr... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/TODO/Autoencoders/convolutional-autoencoder/Convolutional_Autoencoder_Exercise.ipynb | apache-2.0 | import torch
import numpy as np
from torchvision import datasets
import torchvision.transforms as transforms
# convert data to torch.FloatTensor
transform = transforms.ToTensor()
# load the training and test datasets
train_data = datasets.MNIST(root='data', train=True,
download=True... |
pligor/predicting-future-product-prices | 04_time_series_prediction/12_price_history_dummy_seq2seq_with_and_without_EOS.ipynb | agpl-3.0 | from __future__ import division
import tensorflow as tf
from os import path
import numpy as np
import pandas as pd
import csv
from sklearn.model_selection import StratifiedShuffleSplit
from time import time
from matplotlib import pyplot as plt
import seaborn as sns
from mylibs.jupyter_notebook_helper import show_graph
... |
arokem/seaborn | doc/docstrings/kdeplot.ipynb | bsd-3-clause | tips = sns.load_dataset("tips")
sns.kdeplot(data=tips, x="total_bill")
"""
Explanation: Plot a univariate distribution along the x axis:
End of explanation
"""
sns.kdeplot(data=tips, y="total_bill")
"""
Explanation: Flip the plot by assigning the data variable to the y axis:
End of explanation
"""
iris = sns.load... |
MarsUniversity/ece387 | website/block_4_mobile_robotics/misc/ins.ipynb | mit | from __future__ import division, print_function
from math import pi
from IPython.display import HTML, display
"""
Explanation: Inertial Navigation
Kevin J. Walchko, 1 Apr 2017
Blah ...
References
Evaluating inertial measurement units
HOW TO EVALUATE THE PERFORMANCE OF AN INERTIAL MEASUREMENT UNIT (IMU)
Vectornav.com... |
atlury/deep-opencl | DL0110EN/1.2 Two-Dimensional Tensors_v2.ipynb | lgpl-3.0 | # These are the libraries will be used for this lab.
import numpy as np
import matplotlib.pyplot as plt
import torch
import pandas as pd
"""
Explanation: <a href="http://cocl.us/pytorch_link_top">
<img src="https://cocl.us/Pytorch_top" width="750" alt="IBM 10TB Storage" />
</a>
<img src="https://ibm.box.com/shar... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: NCC
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
KEHANG/AutoFragmentModeling | ipython/1. frag_mech_generation/.ipynb_checkpoints/generate_fragment_mechanism_2mobenzene-checkpoint.ipynb | mit | import os
from tqdm import tqdm
from rmgpy import settings
from rmgpy.data.rmg import RMGDatabase
from rmgpy.kinetics import KineticsData
from rmgpy.rmg.model import getFamilyLibraryObject
from rmgpy.data.kinetics.family import TemplateReaction
from rmgpy.data.kinetics.depository import DepositoryReaction
from rmgpy.d... |
buntyke/TRo2017 | Experiments/Exp7/experiment3.ipynb | mit | # import the modules
import GPy
import csv
import numpy as np
import cPickle as pickle
import scipy.stats as stats
import sklearn.metrics as metrics
import GPy.plotting.Tango as Tango
from matplotlib import pyplot as plt
%matplotlib notebook
"""
Explanation: Experiment 7: TRo Journal
In this experiment, the generali... |
gully/adrasteia | notebooks/adrasteia_03-03_cross_match.ipynb | mit | #! cat /Users/gully/.ipython/profile_default/startup/start.ipy
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%config InlineBackend.figure_format = 'retina'
%matplotlib inline
import pandas as pd
from astropy import units as u
from astropy.coordinates import SkyCoord
"""
Explanation: Gaia
... |
hayatoy/dataflow-tutorial | Dataflow_Tutorial1.ipynb | apache-2.0 | import apache_beam as beam
"""
Explanation: Cloud Dataflow Tutorial
事前準備
Google Cloud Platform の課金設定
Dataflow APIの有効化
GCSのBucketを作る
BigQueryにtestdatasetというデータセットを作る
Datalabを起動
That's it!
このNotebookをコピーするには
Datalabを開いたら、Notebookを新規に開いてください。
その後、セルに次のコードを入力して実行してください。
!git clone https://github.com/hayatoy/dataflow-tut... |
cshankm/rebound | ipython_examples/AdvWHFast.ipynb | gpl-3.0 | import rebound
import numpy as np
def test_case():
sim = rebound.Simulation()
sim.integrator = 'whfast'
sim.add(m=1.) # add the Sun
sim.add(m=3.e-6, a=1.) # add Earth
sim.move_to_com()
sim.dt = 0.2
return sim
"""
Explanation: Advanced settings for WHFast: Extra speed, accuracy, and additio... |
google/starthinker | colabs/sheets_copy.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: Sheet Copy
Copy tab from a sheet to a sheet.
License
Copyright 2020 Google LLC,
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 ... |
datacommonsorg/api-python | notebooks/intro_data_science/Feature_Engineering.ipynb | apache-2.0 | # We need to install the Data Commons API, since they don't ship natively with
# most python installations.
# In Colab, we'll be installing the Data Commons python and pandas APIs through pip.
!pip install datacommons --upgrade --quiet
!pip install datacommons_pandas --upgrade --quiet
# We'll also install some nice ... |
ethen8181/machine-learning | projects/kaggle_rossman_store_sales/rossman_gbt.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... |
deepcharles/ruptures | docs/examples/music-segmentation.ipynb | bsd-2-clause | import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import Audio, display
import ruptures as rpt # our package
"""
Explanation: Music segmentation
<!-- {{ add_binder_block(page) }} -->
Introduction
Music segmentation can be seen as a change point detection t... |
phungkh/phys202-2015-work | assignments/assignment04/MatplotlibExercises.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Visualization 1: Matplotlib Basics Exercises
End of explanation
"""
a=np.random.randn(2,10)
x=a[0,:]
x
y=a[1,:]
y
plt.scatter(x,y,color='red')
plt.grid(True)
plt.box(False)
plt.xlabel('random x values')
plt.ylabel('random y value... |
kazzz24/deep-learning | autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[3]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
rajul/tvb-library | tvb/simulator/demos/region_deterministic.ipynb | gpl-2.0 | from tvb.simulator.lab import *
import datetime
START_TIME = datetime.datetime.now()
"""
Explanation: Demonstrate using the simulator at the region level, deterministic interation.
Run time: approximately 120 seconds (workstation circa 2013)
Memory requirement: < 1GB
End of explanation
"""
LOG.info("Configuring...... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.