repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session01/Day2/ImageProcessing/Image Processing Workbook II.ipynb | mit | import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
%matplotlib inline
# notebook
import detection
import imageProc
import utils
"""
Explanation: You are going to read some data, take a look at it, smooth it, and think about
whether the objects you've found are real.
I've provided three python fil... |
ToAruShiroiNeko/revscoring | ipython/Feature construction demo.ipynb | mit | extractor = APIExtractor(api.Session("https://en.wikipedia.org/w/api.php"))
"""
Explanation: Feature extractor setup
This line constructs a "feature extractor" that uses Wikipedia's API to solve dependencies.
End of explanation
"""
list(extractor.extract(123456789, [diff.chars_added]))
"""
Explanation: Using the ex... |
Guneet-Dhillon/mxnet | example/bayesian-methods/sgld.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Stochastic Gradient Langevin Dynamics in MXNet
End of explanation
"""
import mxnet as mx
import mxnet.ndarray as nd
import numpy
import logging
import time
import matplotlib.pyplot as plt
def load_synthetic(theta1, theta2, sigmax, num=20):
flag = numpy.random.randint(0, 2, (... |
tata-antares/tagging_LHCb | Stefania_files/vertex-based-tagging.ipynb | apache-2.0 | import pandas
import numpy
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import roc_curve, roc_auc_score
from rep.metaml import FoldingClassifier
from rep.data import LabeledDataStorage
from rep.report import ClassificationReport
from rep.report.metrics import RocAuc
from utils import get_... |
kit-cel/wt | wt/vorlesung/ch7_9/size_weight.ipynb | gpl-2.0 | # importing
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
# showing figures inline
%matplotlib inline
# plotting options
font = {'size' : 20}
plt.rc('font', **font)
plt.rc('text', usetex=True)
matplotlib.rc('figure', figsize=(18, 6) )
"""
Explanation: Content and Obje... |
ling7334/tensorflow-get-started | mnist/Deep_MNIST_for_Experts.ipynb | apache-2.0 | import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
"""
Explanation: 深入MNIST
TensorFlow是一个非常强大的用来做大规模数值计算的库。其所擅长的任务之一就是实现以及训练深度神经网络。
在本教程中,我们将学到构建一个TensorFlow模型的基本步骤,并将通过这些步骤为MNIST构建一个深度卷积神经网络。
这个教程假设你已经熟悉神经网络和MNIST数据集。如果你尚未了解,请查看新手指南。
关于本教程
本教程首先解释了mnist_softmax.py中的代码 —— 一个简单的Tensorflow模型... |
aravindk1992/TextClassification | A Noob's guide to text classification [Unrendered].ipynb | mit | import nltk
nltk.download()
"""
Explanation: A Noob's guide to Text Classification Using NLTK, Scikit and Gensim
The Summer of 2015 was very productive! I got an opportunity to work with a startup company on a Text Classification problem. We were dealing with a very large HTML corpus which made it all the more challe... |
Danghor/Algorithms | Python/Chapter-09/Kruskal.ipynb | gpl-2.0 | %run Union-Find-OO.ipynb
"""
Explanation: Kruskal's Algorithm for Computing the Minimum Spanning Tree
In our implementation of Kruskal's algorithm for finding the
minimum spanning tree we use the union-find data structure that we have defined previously.
End of explanation
"""
import heapq as hq
"""
Explanation: F... |
kit-cel/lecture-examples | mloc/ch4_Deep_Learning/pytorch/Deep_NN_Detection_QAM.ipynb | gpl-2.0 | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from ipywidgets import interactive
import ipywidgets as widgets
device = 'cuda' if torch.cuda.is_available() else 'cpu'
print("We are using the following device for learning:",device)
""... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-cm2-hr4/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-hr4', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-CM2-HR4
Topic: Aerosol
Sub-Topics: Transport, Emissions,... |
adrn/tutorials | notebooks/synthetic-images/synthetic-images.ipynb | cc0-1.0 | from astropy.utils.data import download_file
from astropy.io import fits
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.wcs import WCS
from astropy.convolution import Gaussian2DKernel
from astropy.modeling.models import Lorentz1D
from astropy.convolution import convolve_fft
impor... |
nikitaswinnen/model-for-predicting-rapid-response-team-events | Data Science Notebooks/Notebooks/EDA/rrt_reasons[EDA].ipynb | apache-2.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime as datetime
from impala.util import as_pandas
from collections import defaultdict
from operator import itemgetter
import cPickle as pickle
%matplotlib notebook
plt.style.use('ggplot')
from impala.dbapi import connect
conn = connect(... |
kiseyno92/SNU_ML | Practice6/3_char_rnn_inference.ipynb | mit | # Important RNN parameters
rnn_size = 128
num_layers = 2
batch_size = 1 # <= In the training phase, these were both 50
seq_length = 1
def unit_cell():
return tf.contrib.rnn.BasicLSTMCell(rnn_size,state_is_tuple=True,reuse=tf.get_variable_scope().reuse)
cell = tf.contrib.rnn.MultiRNNCell([unit_cell() for _ in r... |
kfollette/ASTR200-Spring2017 | Labs/Lab7/.ipynb_checkpoints/Lab7-checkpoint.ipynb | mit | from astropy.table import Table
from numpy import *
import matplotlib
matplotlib.use('nbagg') # required for interactive plotting
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: <small><i>This notebook is based on the 2016 AAS Python Workshop tutorial on tables, available on GitHub, though it has... |
dtamayo/reboundx | ipython_examples/Custom_Effects.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(m=1e-6,a=1.)
sim.move_to_com()
"""
Explanation: Custom Effects
This notebook walks you through how to simply add your own custom forces and operators through REBOUNDx.
The first thing you need to decide is whether you want to write a force or an operator.... |
kabrapratik28/Stanford_courses | cs231n/assignment2/FullyConnectedNets.ipynb | apache-2.0 | # As usual, a bit of setup
from __future__ import print_function
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.solv... |
SteveDiamond/cvxpy | examples/notebooks/WWW/robust_kalman.ipynb | gpl-3.0 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def plot_state(t,actual, estimated=None):
'''
plot position, speed, and acceleration in the x and y coordinates for
the actual data, and optionally for the estimated data
'''
trajectories = [actual]
if estimated is not None:
... |
aleph314/K2 | Foundations/Python CS/Activity 12.ipynb | gpl-3.0 | class MyVector:
def __init__(self, x):
self.x = x
# Return length of vector
def size(self):
return len(self.x)
# This allows access by index, e.g. y[2]
def __getitem__(self, index):
return self.x[index]
# Return norm of vector
def norm(self):
sq... |
junhwanjang/DataSchool | Lecture/18. 문서 전처리/4) 문서 전처리.ipynb | mit | from sklearn.feature_extraction.text import CountVectorizer
corpus = [
'This is the first document.',
'This is the second second document.',
'And the third one.',
'Is this the first document?',
'The last document?',
]
vect = CountVectorizer()
vect.fit(corpus)
vect.vocabulary_
vect.transform(['T... |
tjwei/HackNTU_Data_2017 | Week08/06-text_generation2.ipynb | mit | import os
os.environ['KERAS_BACKEND']='theano'
#os.environ['THEANO_FLAGS']="floatX=float64,device=cpu"
os.environ['THEANO_FLAGS']="floatX=float32,device=cuda"
from keras.models import Sequential
from keras.layers import Dense, Activation, Embedding
from keras.layers import LSTM
from keras.optimizers import RMSprop, Ad... |
hetaodie/hetaodie.github.io | assets/media/uda-ml/fjd/ica/独立成分分析/Independent Component Analysis Lab-zh.ipynb | mit | import numpy as np
import wave
# Read the wave file
mix_1_wave = wave.open('ICA_mix_1.wav','r')
"""
Explanation: 独立成分分析 Lab
在此 notebook 中,我们将使用独立成分分析方法从三个观察结果中提取信号,每个观察结果都包含不同的原始混音信号。这个问题与 ICA 视频中解释的问题一样。
数据集
首先看看手头的数据集。我们有三个 WAVE 文件,正如我们之前提到的,每个文件都是混音形式。如果你之前没有在 python 中处理过音频文件,没关系,它们实际上就是浮点数列表。
首先加载第一个音频文件 ICA_mix_... |
ledeprogram/algorithms | class7/donow/radhikapc_Class7_DoNow.ipynb | gpl-3.0 | import pandas as pd
%matplotlib inline
import numpy as np
from sklearn.linear_model import LogisticRegression
"""
Explanation: Apply logistic regression to categorize whether a county had high mortality rate due to contamination
1. Import the necessary packages to read in the data, plot, and create a logistic regressi... |
bp-kelley/rdkit | Docs/Notebooks/RGroupDecomposition-example-lactam.ipynb | bsd-3-clause | from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
IPythonConsole.ipython_useSVG=True
from rdkit.Chem.rdRGroupDecomposition import RGroupDecomposition
import pandas as pd
from rdkit.Chem import PandasTools
from IPython.display import HTML
from rdkit import rdBase
rdBase.DisableLog("rdApp.debug")
core = ... |
mne-tools/mne-tools.github.io | 0.24/_downloads/00ac060e49528fd74fda09b97366af98/3d_to_2d.ipynb | bsd-3-clause | # Authors: Christopher Holdgraf <choldgraf@berkeley.edu>
# Alex Rockhill <aprockhill@mailbox.org>
#
# License: BSD-3-Clause
from mne.io.fiff.raw import read_raw_fif
import numpy as np
from matplotlib import pyplot as plt
from os import path as op
import mne
from mne.viz import ClickableImage # noqa: ... |
janten/lcfam | lcfam.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
from skimage import io, color
"""
Explanation: Lightness Correction for Color-Coded FA Maps
To install the necessary prerequisites for this tool:
pip install ipython[all]
pip install scikit-image
pip install seaborn
Import the re... |
GoogleCloudPlatform/training-data-analyst | blogs/housing_prices/cloud-ml-housing-prices-hp-tuning.ipynb | apache-2.0 | %%bash
mkdir trainer
touch trainer/__init__.py
%%writefile trainer/task.py
import argparse
import pandas as pd
import tensorflow as tf
import os #NEW
import json #NEW
from tensorflow.contrib.learn.python.learn import learn_runner
from tensorflow.contrib.learn.python.learn.utils import saved_model_export_utils
print(... |
danlamanna/scratch | notebooks/experimental/Geoserver.ipynb | apache-2.0 | %matplotlib inline
from matplotlib import pylab as plt
"""
Explanation: Using Geoserver to load data on the map
In this notebook we'll take a look at using Geoserver to render raster data to the map. Geoserver is an open source server for sharing geospatial data. It includes a tiling server which the GeoJS map uses to... |
leewujung/ooi_sonar | notebooks/dB-diff_20150817-20151017.ipynb | apache-2.0 | import os, sys, glob, re
import datetime as dt
import numpy as np
from matplotlib.dates import date2num,num2date
import h5py
sys.path.insert(0,'..')
sys.path.insert(0,'../mi_instrument/')
import db_diff
import decomp_plot
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
%matplo... |
JAmarel/Phys202 | ODEs/ODEsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed
"""
Explanation: Ordinary Differential Equations Exercise 1
Imports
End of explanation
"""
def lorentz_derivs(yvec, t, sigma, rho, beta):
"""Compute the the de... |
Vvkmnn/books | AutomateTheBoringStuffWithPython/lesson25.ipynb | gpl-3.0 | import re
batRegex = re.compile(r'Bat(wo)?man') # The ()? says this group can appear 0 or 1 times to match; it is optional
mo = batRegex.search('The Adventures of Batman')
print(mo.group())
mo = batRegex.search('The Adventures of Batwoman')
print(mo.group())
"""
Explanation: Lesson 25:
RegEx groups and the Pipe Cha... |
tensorflow/docs | site/en/tutorials/images/data_augmentation.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... |
sbitzer/pyEPABC | examples/narrow_posteriors.ipynb | bsd-3-clause | def plot_mean_with_std(mean, std, std_mult=2, xvals=None, ax=None):
if xvals is None:
xvals = np.arange(mean.shape[0])
if ax is None:
ax = plt.axes()
ax.plot(mean, 'k', lw=3)
ax.fill_between(xvals, mean + std_mult*std, mean - std_mult*std,
edgecolor='k', fac... |
steven-murray/halomod | docs/examples/extension.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from halomod import TracerHaloModel
import halomod
import hmf
import scipy
print("halomod version: ", halomod.__version__)
print("hmf version:", hmf.__version__)
"""
Explanation: Customised extensions with halomod
In this tutorial, we use the exis... |
nikbearbrown/Deep_Learning | NEU/Tejas_Bawaskar _DL/Keras Tutorial.ipynb | mit | #Loading In The Data from uci repositories
# Import pandas
import pandas as pd
# Read in white wine data
white = pd.read_csv("http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv", sep=';')
# Read in red wine data
red = pd.read_csv("http://archive.ics.uci.edu/ml/machine-lear... |
tensorflow/probability | tensorflow_probability/examples/jupyter_notebooks/Variational_Inference_and_Joint_Distributions.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
mne-tools/mne-tools.github.io | 0.18/_downloads/91bce2f7850f38d948be352bfc02e16c/plot_montage.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.
from mayavi import mlab
import os.path as op
import mne
from mne.channels.montage import get_builtin_montages
from mne.datasets import fetch_fsaverage
from mne.viz import plot_alignment
sub... |
karenlmasters/ComputationalPhysicsUnit | StochasticMethods/RandomNumbersLecture1.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Random Processes in Computational Physics
The contents of this Jupyter Notebook lecture notes are:
Introduction to Random Numbers in Physics
Random Number Generation
Python Packages for Random Numbers
Coding for Probability (atomi... |
ampl/amplpy | notebooks/pattern_enumeration.ipynb | bsd-3-clause | !pip install -q amplpy ampltools amplpy matplotlib numpy
"""
Explanation: AMPLPY: Pattern Enumeration
Documentation: http://amplpy.readthedocs.io
GitHub Repository: https://github.com/ampl/amplpy
PyPI Repository: https://pypi.python.org/pypi/amplpy
Jupyter Notebooks: https://github.com/ampl/amplpy/tree/master/notebo... |
rueedlinger/machine-learning-snippets | notebooks/unsupervised/dimensionality_reduction/eigen/dimensionality_reduction_eigen.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from numpy import linalg as LA
from sklearn import datasets
iris = datasets.load_iris()
"""
Explanation: Dimensionality Reduction with Eigenvector / Eigenvalues and Correlation Matrix (PCA)
inspired by htt... |
m2dsupsdlclass/lectures-labs | labs/05_conv_nets_2/Fully_Convolutional_Neural_Networks_rendered.ipynb | mit | %matplotlib inline
import warnings
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1)
# Load a pre-trained ResNet50
# We use include_top = False for now,
# as we'll import output Dense Layer later
import tensorflow as tf
from tensorflow.keras.applications.resnet50 import ResNet50
base_model = ResN... |
TimothyHelton/k2datascience | notebooks/Clustering_Exercises.ipynb | bsd-3-clause | from bokeh.plotting import figure, show
import bokeh.io as bkio
import pandas as pd
from k2datascience import cluster
from k2datascience import plotting
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
bkio.output_notebook()
%matplotlib inline
"""
Explanation... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch6-Problem_6-10.ipynb | unlicense | %pylab notebook
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 6
Problem 6-10
End of explanation
"""
fe = 60 # [Hz]
p = 2
n_nl = 3580 # [r/min]
n_fl = 3440 # [r/min]
"""
Explanation: Description
A three-phase 60-Hz two-pole induction motor runs at a no-load speed of 3580 r/min and a ... |
4dsolutions/Python5 | Applied Voxelization Computations.ipynb | mit | def square_nums(n):
return n**2
def partial_sums(num):
squares = []
partials = [ ]
for i in range(1, num):
squares.append(square_nums(i))
partials.append(sum(squares)) # partial sums of 2nd powers
return partials
print(partial_sums(21), end=" ")
"""
Explanation: <a data-flickr-emb... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/sandbox-2/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: MOHC
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
kubeflow/examples | digit-recognition-kaggle-competition/digit-recognizer-kfp.ipynb | apache-2.0 | !pip install --user --upgrade pip
!pip install kfp --upgrade --user --quiet
# confirm the kfp sdk
! pip show kfp
"""
Explanation: Digit Recognizer Kubeflow Pipeline
In this Kaggle competition
MNIST ("Modified National Institute of Standards and Technology") is the de facto “hello world” dataset of computer vision.... |
tensorflow/quantum | docs/tutorials/quantum_reinforcement_learning.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... |
abulbasar/machine-learning | Scikit - 12 Neural Network using Numpy.ipynb | apache-2.0 | class NeuralNetwork:
def __init__(self, layers, learning_rate, random_state = None):
self.layers_ = layers
self.num_features = layers[0]
self.num_classes = layers[-1]
self.hidden = layers[1:-1]
self.learning_rate = learning_rate
if not random_state:
... |
rvperry/phys202-2015-work | assignments/assignment05/MatplotlibEx03.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 3
Imports
End of explanation
"""
def well2d(x, y, nx, ny, L=1.0):
"""Compute the 2d quantum well wave function."""
psi=(2/L)*np.sin((nx*np.pi*x)/L)*np.sin((ny*np.pi*y)/L)
return psi
psi = well2d(np... |
VUInformationRetrieval/IR2016_2017 | 01_inspecting.ipynb | gpl-2.0 | import pickle, bz2
Summaries_file = 'data/malaria__Summaries.pkl.bz2'
Summaries = pickle.load( bz2.BZ2File( Summaries_file, 'rb' ) )
"""
Explanation: Mini-Assignment 1: Inspecting the PubMed Paper Dataset
In this code for the first mini-assignment, we will get to know the dataset that we will be using throughout. You... |
michaelgat/Udacity_DL | tv-script-generation/dlnd_tv_script_generation-mg1.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... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/08_image/labs/mnist_linear.ipynb | apache-2.0 | import numpy as np
import shutil
import os
import tensorflow as tf
print(tf.__version__)
"""
Explanation: MNIST Image Classification with TensorFlow
This notebook demonstrates how to implement a simple linear image models on MNIST using Estimator.
<hr/>
This <a href="mnist_models.ipynb">companion notebook</a> extends ... |
drericstrong/Blog | 20170402_ArcheryWithGeometryPixelsAndMonteCarlo.ipynb | agpl-3.0 | from PIL import Image
import numpy as np
im = Image.open("TargetMonteCarlo.bmp")
# Convert the image into an array of [R,G,B] per pixel
data = np.array(im.getdata(), np.uint8).reshape(im.size[1], im.size[0], 3)
# For example, the upper left pixel is black ([0,0,0]):
print("Upper left pixel: {}".format(data[0][0]))
# T... |
IST256/learn-python | content/lessons/03-Conditionals/Slides.ipynb | mit | if boolean-expression:
statements-when-true
else:
statemrnts-when-false
"""
Explanation: IST256 Lesson 03
Conditionals
Zybook Ch3
P4E Ch3
Links
Participation: https://poll.ist256.com
Zoom Chat!!!
Agenda
Homework 02 Solution
Non-Linear Code Execution
Relational and Logical Operators
Different types of ... |
Cyb3rWard0g/ThreatHunter-Playbook | docs/notebooks/campaigns/apt29Evals.ipynb | gpl-3.0 | # Importing Libraries
from bokeh.io import show
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, LabelSet, HoverTool
from bokeh.transform import dodge
import pandas as pd
# You need to run this code at the beginning in order to show visualization using Jupyter Notebooks
from bokeh.io import... |
xmnlab/pywim | notebooks/presentations/scipyla2015/PyWIM.ipynb | mit | from IPython.display import display
from matplotlib import pyplot as plt
from scipy import signal
from scipy import constants
from scipy.signal import argrelextrema
from collections import defaultdict
from sklearn import metrics
import statsmodels.api as sm
import numpy as np
import pandas as pd
import numba as nb
imp... |
geography-munich/sciprog | material/sub/jrjohansson/Lecture-6B-HPC.ipynb | apache-2.0 | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Lecture 6B - Tools for high-performance computing applications
J.R. Johansson (jrjohansson at gmail.com)
The latest version of this IPython notebook lecture is available at http://github.com/jrjohansson/scientific-python-lectures.
The other notebooks ... |
nre-aachen/GeMpy | Prototype Notebook/.ipynb_checkpoints/Example_1_Sandstone_Project-checkpoint.ipynb | mit | # Importing
import theano.tensor as T
import sys, os
sys.path.append("../GeMpy")
# Importing GeMpy modules
import GeMpy_core
import Visualization
# Reloading (only for development purposes)
import importlib
importlib.reload(GeMpy_core)
importlib.reload(Visualization)
# Usuful packages
import numpy as np
import panda... |
AshleySetter/datahandling | SDE_Solution_Derivation.ipynb | mit | def a_q(t, v, q):
return v
def a_v(t, v, q):
return -(Gamma0 - Omega0*eta*q**2)*v - Omega0**2*q
def b_v(t, v, q):
return np.sqrt(2*Gamma0*k_b*T_0/m)
"""
Explanation: Equation of motion - SDE to be solved
$\ddot{q}(t) + \Gamma_0\dot{q}(t) + \Omega_0^2 q(t) - \dfrac{1}{m} F(t) = 0 $
where q = x, y or z
W... |
davicsilva/dsintensive | notebooks/capstone-flightDelay.ipynb | apache-2.0 | from datetime import datetime
# Pandas and NumPy
import pandas as pd
import numpy as np
# Matplotlib for additional customization
from matplotlib import pyplot as plt
%matplotlib inline
# Seaborn for plotting and styling
import seaborn as sns
# 1. Flight delay: any flight with (real_departure - planned_departure >=... |
darkomen/TFG | ipython_notebooks/07_conclusiones/conclusiones.ipynb | cc0-1.0 | %pylab inline
#Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos los ficheros c... |
DLR-SC/tigl | examples/python/notebooks/geometry_wing.ipynb | apache-2.0 | import tigl3.curve_factories
import tigl3.surface_factories
from OCC.gp import gp_Pnt
from OCC.Display.SimpleGui import init_display
import numpy as np
"""
Explanation: Wing modelling example
In this example, we demonstrate, how to build up a wing surface by starting with a list of curves. These curves are then interp... |
susantabiswas/Natural-Language-Processing | Notebooks/Word_Prediction_using_Pentagrams_Memory_Efficient.ipynb | mit | #%%timeit
from nltk.util import ngrams
from collections import defaultdict
import nltk
import string
"""
Explanation: Word prediction based on Pentagram
This program reads the corpus line by line so it is slower than the program which reads the corpus
in one go.This reads the corpus one line at a time loads it into th... |
risantos/schoolwork | Física Computacional/Ficha 2.ipynb | mit | import numpy as np
%matplotlib inline
"""
Explanation: Departamento de Física - Faculdade de Ciências e Tecnologia da Universidade de Coimbra
Física Computacional - Ficha 2 - Zeros de Funções
Rafael Isaque Santos - 2012144694 - Licenciatura em Física
End of explanation
"""
f = lambda x: np.sin(x)
df = lambda x: np.c... |
MontrealCorpusTools/PolyglotDB | examples/tutorial/tutorial_1_first_steps.ipynb | mit | from polyglotdb import CorpusContext
import polyglotdb.io as pgio
corpus_root = '/mnt/e/Data/pg_tutorial'
"""
Explanation: Tutorial 1: First steps
Downloading the tutorial corpus
The tutorial corpus used here is a version of the LibriSpeech test-clean subset, forced aligned with the
Montreal Forced Aligner (tutorial ... |
ivotron/torpor-popper | experiments/redis/results/visualize.ipynb | bsd-3-clause | sns.barplot(x='machine', y='mbps', data=df.query('limits == "no" and op == "SET"'))
plt.xticks(rotation=30)
"""
Explanation: We run the redis benchmark (show results for SET operation) and we show results for multiple machines.
End of explanation
"""
for b in df['op'].unique():
if b == 'raw':
continue
... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/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', 'snu', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
Justin-YueLiu/CarND-Projects | CarND-LaneLines-P1/.ipynb_checkpoints/P1-checkpoint.ipynb | mit | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
"""
Explanation: Self-Driving Car Engineer Nanodegree
Project: Finding Lane Lines on the Road
In this project, you will use the tools you learned about in the lesson to ide... |
GoogleCloudPlatform/tf-estimator-tutorials | 01_Regression/04.0 - TF Regression Model - Dataset Input.ipynb | apache-2.0 | MODEL_NAME = 'reg-model-03'
TRAIN_DATA_FILES_PATTERN = 'data/train-*.csv'
VALID_DATA_FILES_PATTERN = 'data/valid-*.csv'
TEST_DATA_FILES_PATTERN = 'data/test-*.csv'
RESUME_TRAINING = False
PROCESS_FEATURES = True
EXTEND_FEATURE_COLUMNS = True
MULTI_THREADING = True
"""
Explanation: Steps to use the TF Experiment APIs... |
phoebe-project/phoebe2-docs | 2.2/examples/sun.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: Sun (single rotating star)
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 i... |
GoogleCloudPlatform/data-science-on-gcp | 11_realtime/evaluation.ipynb | apache-2.0 | import matplotlib
import matplotlib.pyplot as plt
import seaborn
matplotlib.rcParams.update({'font.size': 22})
"""
Explanation: Evaluating 2015-2018 Model on 2019 data
End of explanation
"""
%%bigquery
SELECT
SQRT(SUM(
(CAST(ontime AS FLOAT64) - predicted_ontime.scores[OFFSET(0)])*
(CAST(ontime AS FL... |
PyDataMallorca/WS_Introduction_to_data_science | ml_miguel/perroGato.ipynb | gpl-3.0 | import pandas as pd # Cargamos pandas con el alias pd
"""
Explanation: Perros o gatos?
Por Miguel Escalona
Edición Febrero 2017
Inicio del notebook
Para iniciar cualquier notebook, comenzaremos por invocar los módulos necesarios par... |
Vvkmnn/books | TensorFlowForMachineIntelligence/chapters/05_object_recognition_and_classification/Chapter 5 - 02 Convolutions.ipynb | gpl-3.0 | # setup-only-ignore
import tensorflow as tf
import numpy as np
# setup-only-ignore
sess = tf.InteractiveSession()
input_batch = tf.constant([
[ # First Input
[[0.0], [1.0]],
[[2.0], [3.0]]
],
[ # Second Input
[[2.0], [4.0]],
[[6.0], [8.0]]
... |
wikistat/Apprentissage | BackPropagation/backpropagation.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sb
sb.set_style("whitegrid")
import numpy as np
from functools import reduce
"""
Explanation: <center>
<a href="http://www.insa-toulouse.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/logo-insa.jpg" style="float:left; max-wid... |
andrewzwicky/puzzles | FiveThirtyEightRiddler/2016-10-14/2016-10-14.ipynb | mit | import itertools
# heads = True
# tails = False
# Initialize coins to all heads
coins = [True]*100
for factor in range(100):
# This will generate N zeros, then a 1. This repeats forever
flip_generator = itertools.cycle([0]*factor+[1])
# This will take the first 100 items from the generator
flip... |
planet-os/notebooks | api-examples/SMAP_package-api.ipynb | mit | import time
import os
from package_api import download_data
import xarray as xr
from netCDF4 import Dataset, num2date
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
import datetime
import warnings
warnings.filterwarnings("ignore",category=matplotlib.cbook.m... |
dimitri-yatsenko/pipeline | python/example/DLC_workflow_detailed_explanation.ipynb | lgpl-3.0 | import datajoint as dj
from pipeline import pupil
"""
Explanation: pupil_new explanation (in detail)
This is a notebook on explaining deeplabcut workflow (Detailed version)
Let's import pupil first (and datajoint)
End of explanation
"""
dj.ERD(pupil.schema)
"""
Explanation: OK, now let's see what is under pupil mod... |
tcstewar/testing_notebooks | Intercept Distribution .ipynb | gpl-2.0 | %matplotlib inline
import pylab
import numpy as np
import nengo
import seaborn
import pytry
import pandas
"""
Explanation: Intercept Distribution
This notebook shows how to define intercepts that are uniform in the area allocated to each neuron, and shows that this improves decoder accuracy.
Distributing intercepts un... |
guyk1971/deep-learning | image-classification/dlnd_image_classification_mysol.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
kazzz24/deep-learning | language-translation/dlnd_language_translation.mine.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... |
anhaidgroup/py_entitymatching | notebooks/guides/step_wise_em_guides/Performing Blocking Using Built-In Blockers (Attr. Equivalence Blocker).ipynb | bsd-3-clause | %load_ext autotime
# Import py_entitymatching package
import py_entitymatching as em
import os
import pandas as pd
"""
Explanation: Introduction
Blocking is typically done to reduce the number of tuple pairs considered for matching. There are several blocking methods proposed. The py_entitymatching package supports a... |
joelowj/Udacity-Projects | Udacity-Deep-Learning-Foundation-Nanodegree/Project-2/dlnd_image_classification.ipynb | apache-2.0 | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
class DLProgress(tqdm):
last_block = 0
def hoo... |
mne-tools/mne-tools.github.io | stable/_downloads/f5853db1ea98f82173310d147f23289c/compute_mne_inverse_epochs_in_label.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator
from mne.minimum_norm import apply_inverse
print(__doc__)
data_p... |
IST256/learn-python | content/lessons/08-Lists/HW-Lists.ipynb | mit | ! curl https://raw.githubusercontent.com/mafudge/datasets/master/ist256/08-Lists/test-fudgemart-products.txt -o test-fudgemart-products.txt
! curl https://raw.githubusercontent.com/mafudge/datasets/master/ist256/08-Lists/fudgemart-products.txt -o fudgemart-products.txt
"""
Explanation: Homework: The Fudgemart Products... |
MargaritaLubimova/python_park_mail | homework/homework1.ipynb | mit | def is_number(str):
try:
int(str)
return True
except:
return False
isnumber = False
while not isnumber:
year = input('Введите год: ')
isnumber = is_number(year)
if isnumber:
if (int(year) % 4 == 0 and int(year) % 100 != 0) or int(year) % 400 == 0:
print... |
wesleybeckner/salty | scripts/vae/wes_vae_two.ipynb | mit | plt.hist(values.map(len))
def pad_smiles(smiles_string, smile_max_length):
if len(smiles_string) < smile_max_length:
return smiles_string + " " * (smile_max_length - len(smiles_string))
padded_smiles = [pad_smiles(i, smile_max_length) for i in values if pad_smiles(i, smile_max_length)]
shuffle(padd... |
darioizzo/d-CGP | doc/sphinx/notebooks/finding_prime_integrals.ipynb | gpl-3.0 | from dcgpy import expression_gdual_vdouble as expression
from dcgpy import kernel_set_gdual_vdouble as kernel_set
from pyaudi import gdual_vdouble as gdual
from matplotlib import pyplot as plt
import numpy as np
from numpy import sin, cos
from random import randint, random
np.seterr(all='ignore') # avoids numpy complai... |
danielgoncalvesti/BIGDATA2017 | Projeto/.ipynb_checkpoints/pagerank-webgoogle-checkpoint.ipynb | gpl-3.0 | import pandas as pd
import networkx as nx
import pyensae
import pyquickhelper
example = pd.read_csv("data/web-Google-test.txt",sep = "\t", names=['from','to'])
example
G = nx.from_pandas_dataframe(example, 'from', 'to',create_using=nx.DiGraph())
import matplotlib as mp
%matplotlib inline
import matplotlib.pyplot a... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/ec-earth3-veg-lr/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'ec-earth3-veg-lr', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: EC-EARTH3-VEG-LR
Sub-Topi... |
European-XFEL/h5tools-py | docs/dssc_geometry.ipynb | bsd-3-clause | %matplotlib inline
from karabo_data.geometry2 import DSSC_1MGeometry
# Made up numbers!
quad_pos = [
(-130, 5),
(-130, -125),
(5, -125),
(5, 5),
]
path = 'dssc_geo_june19.h5'
g = DSSC_1MGeometry.from_h5_file_and_quad_positions(path, quad_pos)
g.inspect()
import numpy as np
import matplotlib.pyplot a... |
vlas-sokolov/multicube | notebooks/example.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pylab as plt
import pyspeckit
from multicube.subcube import SubCube
from multicube.astro_toolbox import make_test_cube, get_ncores
from IPython.utils import io
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: Flexible initial guess selection wit... |
rickiepark/python-tutorial | tutorial-3/3. decorator.ipynb | mit | def print_name(first, last):
return 'My name is %s, %s' % (last, first)
def p_decor(func):
def func_wrapper(*args, **kwargs):
text = func(*args, **kwargs)
return '<p>%s</p>' % text
return func_wrapper
print_name = p_decor(print_name)
print_name('jobs', 'steve')
@p_decor
def print_name2(f... |
ara-ta3/ml4se | Chapter3.ipynb | mit | main()
main()
main()
M = [0,1,2,3]
main()
main()
# -*- coding: utf-8 -*-
#
# 最尤推定による正規分布の推定
#
# 2015/04/23 ver1.0
#
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
from numpy.random import normal
from scipy.stats import norm
def gauss():
fig = plt... |
Housebeer/Natural-Gas-Model | Data Analytics/Fitting curve.ipynb | mit | import pandas as pd
import numpy as np
from scipy.optimize import leastsq
import pylab as plt
N = 1000 # number of data points
t = np.linspace(0, 4*np.pi, N)
data = 3.0*np.sin(t+0.001) + 0.5 + np.random.randn(N) # create artificial data with noise
guess_mean = np.mean(data)
guess_std = 3*np.std(data)/(2**0.5)
guess_p... |
jarvis-fga/Projetos | Problema 4/stars.ipynb | mit | import numpy
def verify_missing_data(data, features):
missing_data = []
for feature in features:
count = 0
for x in range(0, len(data)):
if type(data[feature][x]) is numpy.float64 or type(data[feature][x]) is numpy.int64:
count = count + 1
missing_data.a... |
tensorflow/docs-l10n | site/en-snapshot/quantum/tutorials/qcnn.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... |
0x4a50/udacity-0x4a50-deep-learning-nanodegree | embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
rcrehuet/Python_for_Scientists_2017 | notebooks/6_2_More NumPy.ipynb | gpl-3.0 | import numpy as np
arr = np.array([1,2,3])
print(arr," is of type ",arr.dtype)
float_arr = arr.astype(np.float64)
print(float_arr," is of type ",float_arr.dtype)
"""
Explanation: NumPy: computing with arrays
Numerical Python (NumPy) is the fundamental package for high performance scientific computing and data analysis... |
SHAFNehal/Course | code/Introduction to Deep Learning.ipynb | apache-2.0 | # Import the required packages
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy
import math
import random
import string
random.seed(123)
# Display plots inline
%matplotlib inline
# Define plot's default figure size
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0... |
tpin3694/tpin3694.github.io | sql/ignoring_null_values.ipynb | mit | # Ignore
%load_ext sql
%sql sqlite://
%config SqlMagic.feedback = False
"""
Explanation: Title: Ignoring Null or Missing Values
Slug: ignoring_null_values
Summary: Ignoring Null or Missing Values in SQL.
Date: 2017-01-16 12:00
Category: SQL
Tags: Basics
Authors: Chris Albon
Note: This tutorial was written using C... |
UCSBarchlab/PyRTL | ipynb-examples/example4-debuggingtools.ipynb | bsd-3-clause | import random
import io
from pyrtl.rtllib import adders, multipliers
import pyrtl
pyrtl.reset_working_block()
random.seed(93729473) # used to make random calls deterministic for this example
"""
Explanation: Example 4: Debugging
Debugging is half the coding process in software, and in PyRTL, it's no
different. PyRTL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.