repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
turnerbw/JNBinder | Periodic_Trends.ipynb | mit | # Import modules that contain functions we need
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Periodic Trends
Charting the Patterns of Elements
This data was modified from a data set that came from Data-Scientists Matthew Renze.
Thanks to UCF undergraduates... |
hetaodie/hetaodie.github.io | assets/media/uda-ml/fjd/ica/独立成分分析/Independent Component Analysis Lab [SOLUTION]-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_... |
flohorovicic/pynoddy | docs/notebooks/Experiment_entropy_analysis_2D_py3_hspace.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
%matplotlib inline
# here the usual imports. If any of the imports fails,
# make sure that pynoddy is installed
# properly, ideally with 'python setup.py develop'
# or 'python setup.py install'
import sys, os
import matp... |
agiovann/Constrained_NMF | demos/notebooks/demo_dendritic.ipynb | gpl-2.0 | import cv2
import glob
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
try:
cv2.setNumThreads(0)
except():
pass
try:
if __IPYTHON__:
get_ipython().magic('load_ext autoreload')
get_ipython().magic('autoreload 2')
except NameError:
pass
import caiman as cm
fr... |
tpin3694/tpin3694.github.io | python/pandas_dataframe_examples.ipynb | mit | import pandas as pd
"""
Explanation: Title: Simple Example Dataframes In Pandas
Slug: pandas_dataframe_examples
Summary: Simple Example Dataframes In Pandas
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
import modules
End of explanation
"""
raw_data = {'first_name': ['Jason', 'M... |
jacobdein/alpine-soundscapes | archive/Landcover factor exploration.ipynb | mit | import pandas
from Pymilio import database
import numpy as np
from colour import Color
import matplotlib.pylab as plt
%matplotlib inline
"""
Explanation: Landcover factor exploration
This notebook explores the relationship between the soundscape power and contributing land cover area for sounds in a pumilio databas... |
vberaudi/utwt | demo.ipynb | apache-2.0 | import pandas as pd
#channels = read_storage('channels.csv')
_names = pd.read_csv("https://raw.githubusercontent.com/vberaudi/utwt/master/bank_customers.csv", names =["customerid","name"])
offers = pd.read_csv("https://raw.githubusercontent.com/vberaudi/utwt/master/bank_behaviors.csv", names =["customerid","Product1","... |
harmsm/pythonic-science | chapters/02_regression/01_fitting-with-least-squares.ipynb | unlicense | d = pd.read_csv("data/dataset_0.csv")
fig, ax = plt.subplots()
ax.plot(d.x,d.y,'o')
"""
Explanation: What does the following code do?
End of explanation
"""
def linear(x,a,b):
return a + b*x
"""
Explanation: What does the following code do?
End of explanation
"""
def linear(x,a,b):
return a + b*x
def lin... |
gee-community/gee_tools | notebooks/.ipynb_checkpoints/chart-checkpoint.ipynb | mit | import ee
from geetools import ui
test_site = ee.Geometry.Point([-71, -42])
test_feat = ee.Feature(test_site, {'name': 'test feature'})
test_featcol = ee.FeatureCollection([
test_feat,
test_feat.buffer(100).set('name', 'buffer 100'),
test_feat.buffer(1000).set('name', 'buffer 1000')
])
"""
Explanation... |
gmonce/datascience | src/Predict_Shakespeare_with_Cloud_TPUs_and_Keras.ipynb | gpl-3.0 | # Copyright 2018 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... |
ponderousmad/pyndent | depth_setup.ipynb | mit | %matplotlib inline
from __future__ import print_function
import ipywidgets
import os
import re
import sys
import urllib
import zipfile
from IPython.display import display
import outputer
import improc
drive_files = []
for root, dirs, files in os.walk('internal'):
for name in files:
if name.lower().endsw... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-2/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-2', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: TEST-INSTITUTE-2
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topic... |
mne-tools/mne-tools.github.io | dev/_downloads/499a81f33500445fc2e1eac0be346d47/temporal_whitening.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import mne
from mne.time_frequency import fit_iir_model_raw
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
meg_path = data_... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_stats_spatio_temporal_cluster_sensors.ipynb | bsd-3-clause | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Jona Sassenhagen <jona.sassenhagen@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mne.viz import plot_topomap
import mne
from mne.stats import spatio_... |
ucsd-ccbb/jupyter-genomics | notebooks/rnaSeq/ToppGeneAPI.ipynb | mit | ##importing python module
import os
import pandas
import qgrid
qgrid.nbinstall(overwrite=True)
qgrid.set_defaults(remote_js=True, precision=4)
import mygene
##change directory
os.chdir("/Users/nicole/Documents/CCBB Internship")
"""
Explanation: ToppGene API
Authors: N. Mouchamel, T. Nguyen & K. Fisch
Email: Kfisch@... |
seewhydee/ntuphys_nb | jupyter/gradqm/electromagnetism.ipynb | gpl-3.0 | %matplotlib inline
## Numerical solver for Schrodinger equation for electron in 2D
## See below for detailed documentation and usage examples.
## Phi, Ax, Ay : functions specifying scalar and vector potential
## args : tuple of additional inputs to the potential functions
## L : length of comput... |
jgarciab/wwd2017 | class4/hw_3.ipynb | gpl-3.0 | print("Figure 1")
display(Image(url="http://www.datavis.ca/gallery/images/galvanic-3D.png",width=600))
print("Figure 2")
display(Image(url="http://www.econoclass.com/images/statdrivers.gif"))
"""
Explanation: Assignment 1: Data visualization
Explain what do you think that is wrong with the following figures and what ... |
Fifth-Cohort-Awesome/NightThree | three_arg.ipynb | mit | MovieTextFile = open("tmdb_5000_movies.csv")
# for line in MovieTextFile:
# print(line) # not quite right
# type(MovieTextFile)
"""
Explanation: Goal 1
Injest file as pure text
End of explanation
"""
import csv
with open("tmdb_5000_movies.csv",encoding="utf8") as f:
reader = csv.reader(f)
MovieList = list... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage3/get_started_with_dataflow_pipeline_components.ipynb | apache-2.0 | import os
# The Vertex AI Workbench Notebook product has specific requirements
IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME")
IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists(
"/opt/deeplearning/metadata/env_version"
)
# Vertex AI Notebook requires dependencies to be installed with '--user'
USER_FLAG = ... |
kdungs/teaching-SMD2-2016 | assignments/1.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
"""
Explanation: Übungsblatt 1: Fehlerrechnung
Aufgabe 1
Aufgabe 2
Aufgabe 3
End of explanation
"""
a1, a1_err = 2.0, 0.2
a2, a2_err = 1.0, 0.1
rho = -0.8
"""
Explanation: Aufgabe 1
Gegeben sei eine parametrische Funktion... |
chrismcginlay/crazy-koala | jupyter/12_arrays_one.ipynb | gpl-3.0 | amount1=int(input("Please enter amount 1:"))
amount2=int(input("Please enter amount 2:"))
amount3=int(input("Please enter amount 3:"))
total = amount1 + amount2 + amount3
print("The total raised is", total)
"""
Explanation: Arrays Part 1
In Task 15 (Charity Collection) you probably used three variables for the differ... |
tpospisi/FlexCoDE | vignettes/Custom Class.ipynb | gpl-2.0 | import flexcode
import numpy as np
import xgboost as xgb
from flexcode.regression_models import XGBoost, CustomModel
"""
Explanation: This notebook provides an example on how to use a custom class within Flexcode. <br>
In order to be compatible, a regression method needs to have a fit and predict method implemented - ... |
pligor/predicting-future-product-prices | 04_time_series_prediction/.ipynb_checkpoints/30_price_history_dataset_per_mobile_phone-arima-checkpoint.ipynb | agpl-3.0 | input_len = 60
target_len = 30
batch_size = 50
with_EOS = False
csv_in = '../price_history_03_seq_start_suddens_trimmed.csv'
"""
Explanation: Step 0 - hyperparams
vocab_size is all the potential words you could have (classification for translation case)
and max sequence length are the SAME thing
decoder RNN hidden un... |
google-research/google-research | cell_embedder/CellEmbedder.ipynb | apache-2.0 | #@title Default title text
# 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, softwar... |
xdnian/pyml | assignments/solutions/ex03_sample_solution.ipynb | mit | %load_ext watermark
%watermark -a '' -u -d -v -p numpy,pandas,matplotlib,scipy,sklearn
%matplotlib inline
# Added version check for recent scikit-learn 0.18 checks
from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version
"""
Explanation: Assignment 3 - basic classifiers... |
Abasyoni/dynet | examples/python/tutorials/RNNs.ipynb | apache-2.0 | # we assume that we have the dynet module in your path.
# OUTDATED: we also assume that LD_LIBRARY_PATH includes a pointer to where libcnn_shared.so is.
from dynet import *
"""
Explanation: RNNs tutorial
End of explanation
"""
pc = ParameterCollection()
NUM_LAYERS=2
INPUT_DIM=50
HIDDEN_DIM=10
builder = LSTMBuilder(N... |
ColeLab/informationtransfermapping | TheoreticalResults/.ipynb_checkpoints/ItoEtAl2017_ComputationalModelGroupAnalysis-checkpoint.ipynb | gpl-3.0 | import numpy as np
import sys
sys.path.append('utils/')
import os
os.environ['OMP_NUM_THREADS'] = str(1)
import matplotlib.pyplot as plt
% matplotlib inline
import scipy.stats as stats
import statsmodels.api as sm
import multiprocessing as mp
import sklearn.preprocessing as preprocessing
import sklearn.svm as svm
impor... |
johntanz/ROP | .ipynb_checkpoints/Masimo160127-Copy1-checkpoint.ipynb | gpl-2.0 | #the usual beginning
import pandas as pd
import numpy as np
from pandas import Series, DataFrame
from datetime import datetime, timedelta
from pandas import concat
#define any string with 'C' as NaN
def readD(val):
if 'C' in val:
return np.nan
return val
"""
Explanation: Masimo Analysis
For Pulse Ox. ... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-cm2-sr5/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-sr5', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-CM2-SR5
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy... |
azhurb/deep-learning | intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb | mit | import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical
"""
Explanation: Sentiment analysis with TFLearn
In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w... |
oroszl/szamprob | notebooks/Package01/feladat01.ipynb | gpl-3.0 | mondat="A "
mondat+="mezőn legelésző "
mondat+="bárányok "
mondat+="mélyen "
mondat+="hallgatnak."
print(mondat)
"""
Explanation: Feladatok
Minden feladatot külön notebookba oldj meg!
A megoldásnotebook neve tartalmazza a feladat számát!
A megoldasok kerüljenek a MEGOLDASOK mappába!<br> Csak azok a feladatok kerül... |
jbpoline/newpower | peakdistribution/find_peakdistr.ipynb | mit | % matplotlib inline
import os
import numpy as np
import nibabel as nib
from nipy.labs.utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset
import nipy.algorithms.statistics.rft as rft
from __future__ import print_function, division
import math
import matplotlib.pyplot as plt
import palettable.colorbrewer a... |
kevinsung/OpenFermion | docs/fqe/tutorials/fqe_vs_openfermion_quadratic_hamiltonians.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... |
scikit-optimize/scikit-optimize.github.io | 0.7/notebooks/auto_examples/sklearn-gridsearchcv-replacement.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
"""
Explanation: Scikit-learn hyperparameter search wrapper
Iaroslav Shcherbatyi, Tim Head and Gilles Louppe. June 2017.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Introduction
This example assumes basic familiarity with
scikit-learn <http://scikit-learn.org/sta... |
drivendata/data-science-is-software | notebooks/lectures/4.0-testing.ipynb | mit | from __future__ import print_function
import os
import numpy as np
import pandas as pd
PROJ_ROOT = os.path.abspath(os.path.join(os.pardir, os.pardir))
"""
Explanation: <table style="width:100%; border: 0px solid black;">
<tr style="width: 100%; border: 0px solid black;">
<td style="width:75%; border: 0p... |
LSSTDESC/Twinkles | doc/SLSimDocumentation/strong_lensing_review.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from astropy.io import fits
plt.style.use('ggplot')
%matplotlib inline
om10_cat = fits.open('../../data/twinkles_lenses_v2.fits')[1].data
sprinkled_lens_gals = pd.read_csv('../../data/sprinkled_lens_galaxies_230.txt')
sprinkled_agn = pd.read_csv('.... |
mne-tools/mne-tools.github.io | 0.17/_downloads/9ced5a5fd40c97d018c393deda509609/plot_visualize_raw.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import mne
data_path = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample')
raw = mne.io.read_raw_fif(op.join(data_path, 'sample_audvis_raw.fif'),
preload=True)
raw.set_eeg_reference('average', projection=True) # set EEG average reference
"""
Ex... |
numeristical/introspective | examples/SplineCalib_Details.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import ml_insights as mli
from sklearn.metrics import roc_auc_score, log_loss
## This is a (rather ugly) function that allows us
## to make piecewise linear functions easily
def make_pw_linear_fn(xvals, yvals):
def lin_fun... |
sonyahanson/assaytools | examples/ipynbs/data-analysis/hsa/analyzing_FLU_hsa_lig1_20150922.ipynb | lgpl-2.1 | import numpy as np
import matplotlib.pyplot as plt
from lxml import etree
import pandas as pd
import os
import matplotlib.cm as cm
import seaborn as sns
%pylab inline
# Get read and position data of each fluorescence reading section
def get_wells_from_section(path):
reads = path.xpath("*/Well")
wellIDs = [rea... |
smalladi78/SEF | notebooks/0_DataCleanup-Feb2016.ipynb | unlicense | import pandas as pd
import numpy as np
import locale
import matplotlib.pyplot as plt
from bokeh.plotting import figure, show
from bokeh.models import ColumnDataSource, HoverTool
%matplotlib inline
from bokeh.plotting import output_notebook
output_notebook()
_ = locale.setlocale(locale.LC_ALL, '')
thousands_sep = lamb... |
PAIR-code/ai-explorables | server-side/private-and-fair/MNIST_Generate_UMAP.ipynb | apache-2.0 | %%capture
!curl -L https://github.com/tensorflow/privacy/releases/download/0.2.3/order.tgz -o order.tgz
!tar zxvf order.tgz
mnist_priv_train = np.load('data/order_mnist_priv_train.npy')
mnist_priv_test = np.load('data/order_mnist_priv_test.npy')
mnist_priv_train.shape
(x_train, y_train), (x_test, y_test) = tf.keras.... |
andreyf/machine-learning-examples | sklearn/sklearn.cross_validation.ipynb | gpl-3.0 | from sklearn import cross_validation, datasets
import numpy as np
"""
Explanation: Sklearn
sklearn.cross_validation
документация: http://scikit-learn.org/stable/modules/cross_validation.html
End of explanation
"""
iris = datasets.load_iris()
train_data, test_data, train_labels, test_labels = cross_validation.train... |
wobiskai/anomaly-detection-in-Bitcoin | notebooks/Bitcoin Anomaly Analysis.ipynb | apache-2.0 | import numpy as np
import pandas as pd
column_names = ['txn_key', 'from_user', 'to_user', 'date', 'amount']
df = pd.read_csv('../data/bitcoin_uic_data_and_code_20130410/user_edges.txt', names=column_names)
df.head()
"""
Explanation: Load data
End of explanation
"""
df[ df.date < 20110000000000 ].to_csv('../data/su... |
jo-tez/aima-python | learning_apps.ipynb | mit | from learning import *
from notebook import *
"""
Explanation: LEARNING APPLICATIONS
In this notebook we will take a look at some indicative applications of machine learning techniques. We will cover content from learning.py, for chapter 18 from Stuart Russel's and Peter Norvig's book Artificial Intelligence: A Modern... |
unoebauer/public-astro-tools | jupyter/wind_tutorial.ipynb | mit | mstar = 52.5 # mass; if no astropy units are provided, the calculators will assume units of solar masses
lstar = 1e6 # luminosity; if no astropy units are provided, the calculators will assume units of solar luminosities
teff = 4.2e4 # effective temperature; if no astropy units are provided, the calculators will ass... |
claudiuskerth/PhDthesis | Data_analysis/SNP-indel-calling/dadi/dadiExercises/First_Steps_with_dadi.ipynb | mit | sys.path.insert(0, '/home/claudius/Downloads/dadi')
sys.path
"""
Explanation: I have cloned the $\delta$a$\delta$i repository into '/home/claudius/Downloads/dadi' and have compiled the code. Now I need to add that directory to the PYTHONPATH variable:
End of explanation
"""
import dadi
dir(dadi)
import pylab
%ma... |
goujou/LAPM | notebooks/Century.ipynb | mit | from sympy import *
from LAPM import *
from LAPM.linear_autonomous_pool_model import LinearAutonomousPoolModel
"""
Explanation: Ages and transit time distribution from Century
This notebook shows how to use the LAPM package to compute system level metrics for the Century model.
End of explanation
"""
B=Matrix([[-2.9... |
opencobra/cobrapy | documentation_builder/media.ipynb | gpl-2.0 | from cobra.io import load_model
model = load_model("textbook")
model.medium
"""
Explanation: Growth media
The availability of nutrients has a major impact on metabolic fluxes and cobrapy provides some helpers to manage the exchanges between the external environment and your metabolic model. In experimental settings t... |
blakeflei/IntroScientificPythonWithJupyter | 07 - Some Basic Statistics.ipynb | bsd-3-clause | from numpy.random import normal,rand
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
%matplotlib inline
"""
Explanation: Some Basic Statistics
This module will cover the calculation of some basic statistical parameters using numpy and scipy, starting with a 'by hand' or from textbook fo... |
gschivley/ERCOT_power | Prediction model/Prediction models - XGBoost.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import os
from xgboost import XGBRegressor
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR, LinearSVR
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing ... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/solutions/custom_model_training.ipynb | apache-2.0 | USER_FLAG = "--user"
!pip3 install {USER_FLAG} google-cloud-aiplatform==1.7.0 --upgrade
!pip3 install {USER_FLAG} kfp==1.8.9 google-cloud-pipeline-components==0.2.0
"""
Explanation: Running custom model training on Vertex AI Pipelines
In this lab, you will learn how to run a custom model training job using the Kubefl... |
CDIPS-AI-2017/pensieve | Notebooks/image_search_query.ipynb | apache-2.0 | import os
import json
import requests
from requests_oauthlib import OAuth1
def get_secret(service):
"""Access local store to load secrets."""
local = os.getcwd()
root = os.path.sep.join(local.split(os.path.sep)[:3])
secret_pth = os.path.join(root, '.ssh', '{}.json'.format(service))
return secret_p... |
bspalding/research_public | advanced_sample_analyses/Tesla-and-Oil-(Short).ipynb | apache-2.0 | # Import libraries
from matplotlib import pyplot
from pykalman import KalmanFilter
import numpy
import scipy
import time
import datetime
# Initialize a Kalman Filter.
# Using kf to filter does not change the values of kf, so we don't need to ever reinitialize it.
kf = KalmanFilter(transition_matrices = [1],
... |
keras-team/autokeras | docs/ipynb/text_regression.ipynb | apache-2.0 |
dataset = tf.keras.utils.get_file(
fname="aclImdb.tar.gz",
origin="http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz",
extract=True,
)
# set path to dataset
IMDB_DATADIR = os.path.join(os.path.dirname(dataset), "aclImdb")
classes = ["pos", "neg"]
train_data = load_files(
os.path.join(IMD... |
danielmcd/hacks | marketpatterns/TestNotebook.ipynb | gpl-3.0 | import calendar
import datetime
import numpy
import os.path
import pickle
from random import randrange, random, shuffle
import sys
import time
import math
import nupic
from nupic.encoders import ScalarEncoder, MultiEncoder
from nupic.bindings.algorithms import SpatialPooler as SP
from nupic.research.TP10X2 import TP10... |
alepoydes/introduction-to-numerical-simulation | practice/Not so elementary elementary functions.ipynb | mit | y=np.linspace(-2,3,100)
x=np.exp(y)
plt.plot(x,y)
plt.xlabel('$x$')
plt.ylabel('$y=\ln x$')
plt.show()
"""
Explanation: Вычисление элементарных функций
Вычисление значения функции на данном аргументе является одной из важнейших задач численных методов.
Несмотря на то, что вы уже огромное число раз вычисляли значения ф... |
Unidata/unidata-python-workshop | notebooks/MetPy_Advanced/QG Analysis.ipynb | mit | from datetime import datetime
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import numpy as np
from scipy.ndimage import gaussian_filter
from siphon.catalog import TDSCatalog
from siphon.ncss import NCSS
import matplotlib.pyplot as plt
import metpy.calc as mpcalc
import metpy.constants as mpconstants
f... |
fccoelho/Curso_Blockchain | assignments/Edwards-curve signature/Lisk.ipynb | lgpl-3.0 | from hashlib import sha256
import json
import ed25519
"""
Explanation: <img src="https://cdn-images-1.medium.com/max/1200/1*cCHDhDD093-nE5lFTRGMDA.png" width="100px" align="left">
Understanding Lisk's Transactions Signing Scheme
Flávio Codeço Coelho
End of explanation
"""
passphrase = b"witch collapse practice feed... |
hpparvi/PyTransit | notebooks/contamination/example_1a.ipynb | gpl-2.0 | %pylab inline
import sys
from corner import corner
sys.path.append('.')
from src.mocklc import MockLC, SimulationSetup
from src.blendlpf import MockLPF
import src.plotting as pl
"""
Explanation: Contamination example 1a
No contamination and uninformative priors on orbital parameters
Hannu Parviainen<br>
Instituto d... |
buds-lab/the-building-data-genome-project | notebooks/00_Meta Data Exploration.ipynb | mit | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import os
%matplotlib inline
repos_path = "/Users/nus/temporal-features-for-nonres-buildings-library/"
meta = pd.read_csv(os.path.join(repos_path,"data/raw/meta_open_withclassificationobjectives.csv"), index_col='uid', parse_dates=["datastart"... |
magenta/magenta-demos | jupyter-notebooks/NSynth.ipynb | apache-2.0 | import os
import numpy as np
import matplotlib.pyplot as plt
from magenta.models.nsynth import utils
from magenta.models.nsynth.wavenet import fastgen
from IPython.display import Audio
%matplotlib inline
%config InlineBackend.figure_format = 'jpg'
"""
Explanation: Exploring Neural Audio Synthesis with NSynth
Parag Mit... |
fja05680/pinkfish | examples/225.weight-by-portfolio/strategy.ipynb | mit | import datetime
import matplotlib.pyplot as plt
import pandas as pd
import pinkfish as pf
import strategy
# Format price data.
pd.options.display.float_format = '{:0.2f}'.format
%matplotlib inline
# Set size of inline plots.
'''note: rcParams can't be in same cell as import matplotlib
or %matplotlib inline
... |
tpin3694/tpin3694.github.io | python/set_the_color_of_a_matplotlib.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Title: Set The Color Of A Matplotlib Plot
Slug: set_the_color_of_a_matplotlib
Summary: Set The Color Of A Matplotlib Plot
Date: 2016-05-01 12:00
Category: Python
Tags: Data Visualization
Authors: Chris Albon
Import numpy and matpl... |
hparik11/Deep-Learning-Nanodegree-Foundation-Repository | Project2/image-classification/dlnd_image_classification.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... |
borja876/Thinkful-DataScience-Borja | Evolution+of+GDP+and+Household+Electrcity+Consumption.ipynb | mit | import numpy as np
import pandas as pd
import scipy
import matplotlib.pyplot as plt
from scipy.stats import ttest_ind
from scipy import stats
import itertools
%matplotlib inline
w = pd.read_csv('https://raw.githubusercontent.com/borja876/Thinkful-DataScience-Borja/master/Electricity%20Consumption.csv')
x = pd.read_csv... |
ChadFulton/statsmodels | examples/notebooks/markov_autoregression.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
import requests
from io import BytesIO
# NBER recessions
from pandas_datareader.data import DataReader
from datetime import datetime
usrec = DataReader('USREC', 'fred', start=datetime(1947, 1, 1), en... |
roatienza/Deep-Learning-Experiments | versions/2022/autoencoder/python/ae_pytorch_demo.ipynb | mit | import torch
import torchvision
import wandb
import time
from torch import nn
from einops import rearrange
from argparse import ArgumentParser
from pytorch_lightning import LightningModule, Trainer, Callback
from pytorch_lightning.loggers import WandbLogger
from torch.optim import Adam
from torch.optim.lr_scheduler im... |
google-aai/sc17 | cats/step_0_to_0.ipynb | apache-2.0 | print('Hello world!')
"""
Explanation: Let's Get Started With Data Science, World!
Author(s): kozyr@google.com
Reviewer(s): nrh@google.com
It's a beautiful day and we can do all kinds of pretty things. Here are some little examples to get you started.
Print: ...something
End of explanation
"""
import numpy as np
n ... |
joshnsolomon/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."""
xcoord, ycoord = np.meshgrid(x,y)
xpor = np.sin((nx*np.pi*xcoord)/L)
ypor = np.... |
ogaway/Matching-Market | matching.ipynb | gpl-3.0 | # coding: UTF-8
%matplotlib inline
from matching import *
from matching_simu import *
"""
Explanation: Matching Market
Table of Contents
・One-to-One Matching
・Many-to-One Matching
・Modeling Simulation
Import a class, Matching() from matching.py.
End of explanation
"""
prop_prefs = [[1, 0, 2],
... |
sud218/ml-graphlab-boilerplate | notebooks/01 - Getting started with GraphLab and SFrame.ipynb | mit | import graphlab as gl
"""
Explanation: Fire up GraphLab create
End of explanation
"""
sf = gl.SFrame('data/people-example.csv')
"""
Explanation: Load a tabular dataset
SFrame is a tabular, column-mutable dataframe object that can scale to big data. The data in SFrame is stored column-wise, and is stored on persiste... |
hpcarcher/2015-12-14-Portsmouth-students | ScientificPython/L02-numpy/L02_NumPy.ipynb | gpl-2.0 | # calculate pi
import numpy as np
# N : number of iterations
def calc_pi(N):
x = np.random.ranf(N);
y = np.random.ranf(N);
r = np.sqrt(x*x + y*y);
c=r[ r <= 1.0 ]
return 4*float((c.size))/float(N)
# time the results
pts = 6; N = np.logspace(1,8,num=pts);
result = np.zeros(pts); count = 0;
for n in... |
adityaka/misc_scripts | python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/03_01/Begin/.ipynb_checkpoints/Creating Series-checkpoint.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
"""
Explanation: Series
Series is a one-dimensional labeled array capable of holding any data type (integers, strings, floating point numbers,
Python objects, etc.). The axis labels are collectively referred to as the index.
documentation: http://pandas.pydata.org/pandas-docs/sta... |
esa-as/2016-ml-contest | HouMath/Face_classification_HouMath_XGB_03.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
import matplotlib.colors as colors
import xgboost as xgb
import numpy as np
from sklearn.metrics import confusion_matrix, f1_score, accuracy_score
from ... |
NAU-CFL/Python_Learning_Source | reference_notebooks/Notes-06.ipynb | mit | fruit = "pinapple"
letter = fruit[1]
"""
Explanation: Strings
String is a Sequence
A string is a sequence of characters. You can access the characters one at a time with the bracket operator:
End of explanation
"""
print(letter)
"""
Explanation: The second statement selects character number 1 from fruit and assigns... |
simkovic/simkovic.github.io | _ipynb/Skewed Distributions-Overview.ipynb | mit | %pylab inline
from scipy import stats
np.random.seed(3)
from IPython.display import Image
import warnings
warnings.filterwarnings('ignore')
from urllib import urlopen
Image(url='http://tiny.cc/tpiaox')
"""
Explanation: The Trouble with Response Times
Recently, I wanted to analyse response times from a visual search ta... |
michaelgat/Udacity_DL | image-classification/dlnd_image_classification_MG.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'
class DLProgress(tqdm):
last_block = 0
def hoo... |
tpin3694/tpin3694.github.io | machine-learning/pipelines_with_parameter_optimization.ipynb | mit | # Import required packages
import numpy as np
from sklearn import linear_model, decomposition, datasets
from sklearn.pipeline import Pipeline
from sklearn.model_selection import GridSearchCV, cross_val_score
from sklearn.preprocessing import StandardScaler
"""
Explanation: Title: Pipelines With Parameter Optimization ... |
amadeuspzs/travelTime | travelTime.ipynb | mit | import urllib, json, time
"""
Explanation: travelTime
Source realtime travel data from Google Maps
End of explanation
"""
apiKey=""
if not apiKey:
print "Enter your API key for traffic data!"
exit(1)
"""
Explanation: Enter your Google Maps Directions API key below:
End of explanation
"""
origin="Empire St... |
hanhanwu/Hanhan_Data_Science_Practice | sequencial_analysis/CPT_poem_generator.ipynb | mit | from CPT import *
import pandas as pd
sample_poem = open('sample_sonnets.txt').read().lower().replace('\n', '') # smaller data sample
all_poem = open('sonnets.txt').read().lower().replace('\n', '') # larger data sample
def generate_char_seq(whole_str, n):
"""
Generate a dataframe, each row contains a sequen... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/scipy/effect_size.ipynb | mit | from __future__ import print_function, division
import numpy
import scipy.stats
import matplotlib.pyplot as pyplot
from IPython.html.widgets import interact, fixed
from IPython.html import widgets
# seed the random number generator so we all get the same results
numpy.random.seed(17)
# some nice colors from http:/... |
phanrahan/magmathon | notebooks/tutorial/coreir/TFF.ipynb | mit | import magma as m
from mantle import DFF
class TFF(m.Circuit):
io = m.IO(O=m.Out(m.Bit)) + m.ClockIO()
# instance a dff to hold the state of the toggle flip-flop - this needs to be done first
dff = DFF()
# compute the next state as the not of the old state ff.O
io.O <= dff(~dff.O)
def tff(... |
probml/pyprobml | notebooks/misc/linreg_sklearn.ipynb | mit | # Standard Python libraries
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import time
import numpy as np
import glob
import matplotlib.pyplot as plt
import PIL
import imageio
from IPython import display
import sklearn
import seaborn as sns
sns.set(style="ticks", color... |
Hvass-Labs/TensorFlow-Tutorials | 01_Simple_Linear_Model.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import confusion_matrix
# Use TensorFlow v.2 with this old v.1 code.
# E.g. placeholder variables and sessions have changed in TF2.
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
"""
Explanation: TensorFlow Tutorial... |
adrn/gary | docs/examples/Arbitrary-density-SCF.ipynb | mit | # Some imports we'll need later:
# Third-party
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# Custom
import gala.coordinates as gc
import gala.dynamics as gd
import gala.integrate as gi
import gala.potential as gp
from gala.units import galactic
from gala.potential.s... |
PMEAL/OpenPNM | examples/tutorials/network/random_networks_based_on_delaunay_and_voronoi_tessellations.ipynb | mit | import openpnm as op
import matplotlib.pyplot as plt
pn = op.network.DelaunayVoronoiDual(points=100, shape=[1, 1, 1])
print(pn)
"""
Explanation: Delaunay and Voronoi Tessalation
Generate Random Networks Based on Delaunay Triangulations, Voronoi Tessellations, or Both
A random network offers several advantages over t... |
mne-tools/mne-tools.github.io | dev/_downloads/87ced9add160fc358769ef662f31e446/45_projectors_background.ipynb | bsd-3-clause | import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # noqa
from scipy.linalg import svd
import mne
def setup_3d_axes():
ax = plt.axes(projection='3d')
ax.view_init(azim=-105, elev=20)
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
ax.... |
mmaelicke/scikit-gstat | tutorials/05_binning.ipynb | mit | import skgstat as skg
import numpy as np
import pandas as pd
from imageio import imread
import plotly.graph_objects as go
from plotly.offline import init_notebook_mode, iplot
from plotly.subplots import make_subplots
skg.plotting.backend('plotly')
init_notebook_mode()
"""
Explanation: 5 - Lag classes
This tutorial fo... |
lizardsystem/lizard-connector | Example_EN.ipynb | gpl-3.0 | result = cli.timeseries.get(uuid="867b166a-fa39-457d-a9e9-4bcb2ff04f61")
result.metadata
"""
Explanation: The connection with Lizard is made. Above all endpoints are shown
Now we collect the metadata for a first timeseries with uuid 867b166a-fa39-457d-a9e9-4bcb2ff04f61:
End of explanation
"""
queryparams = {
"en... |
cesarcontre/Simulacion2017 | Modulo3/.ipynb_checkpoints/Clase23_Repaso1(Mod.3)-checkpoint.ipynb | mit | # Librería de cálculo simbólico
import sympy as sym
# Para imprimir en formato TeX
from sympy import init_printing; init_printing(use_latex='mathjax')
"""
Explanation: Repaso (Módulo 3)
El tema principal en este módulo fue optimización. Al finalizar este módulo, se espera que ustedes tengan las siguientes competencia... |
GoogleCloudPlatform/python-docs-samples | notebooks/tutorials/storage/Storage command-line tool.ipynb | apache-2.0 | !gsutil help
"""
Explanation: Storage command-line tool
The Google Cloud SDK provides a set of commands for working with data stored in Cloud Storage. This notebook introduces several gsutil commands for interacting with Cloud Storage. Note that shell commands in a notebook must be prepended with a !.
List available c... |
fotis007/python_intermediate | Python_2_8.ipynb | gpl-3.0 | from sklearn import datasets
iris = datasets.load_iris()
digits = datasets.load_digits()
iris.data[10]
iris.target
print(digits.data)
digits.target
digits.images[0]
from sklearn import svm
clf = svm.SVC(gamma=0.001, C=100.)
clf.fit(digits.data[:-1], digits.target[:-1])
clf.predict(digits.data[-1])
from skle... |
google/pikov | python/samples/2_connect.ipynb | apache-2.0 | names = {}
for node in graph:
for edge in node:
if edge.guid == "169a81aefca74e92b45e3fa03c7021df":
value = node[edge].value
if value in names:
raise ValueError('name: "{}" defined twice'.format(value))
names[value] = node
names["ctor"]
def name_to_... |
tensorflow/docs-l10n | site/ja/agents/tutorials/7_SAC_minitaur_tutorial.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
rahulremanan/python_tutorial | Machine_Vision/02_Object_Prediction/notebook/prediction_cats_dogs.ipynb | mit | import sys
import argparse
import numpy as np
import requests
import matplotlib
matplotlib.use('Agg')
import os
import time
import json
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import tqdm
from io import BytesIO
from PIL import Image
from keras.preprocessing import image
from keras.... |
AllenDowney/ThinkBayes2 | soln/gss_grass.ipynb | mit | # If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install empiricaldist
# Get utils.py
import os
if not os.path.exists('utils.py'):
!wget https://github.com/AllenDowney/ThinkBayes2/raw/master/co... |
charlesll/RamPy | examples/Baseline_and_Centroid_determination.ipynb | gpl-2.0 | %matplotlib inline
import numpy as np
np.random.seed(42) # fixing the seed
import matplotlib
import matplotlib.pyplot as plt
import rampy as rp
import scipy
"""
Explanation: Centroid measurement
Author: Charles Le Losq
This notebook illustrates the use of the rampy.centroid() function to measure the centroid of a peak... |
pastephens/pysal | pysal/contrib/spint/notebooks/Vec_SA_Test.ipynb | bsd-3-clause | dest_A_rand_I = []
dest_B_rand_I = []
dest_A_rand_p = []
dest_B_rand_p = []
for i in range(1000):
phi = np.random.uniform(0,np.pi*2, 50).reshape((-1,1))
num = np.arange(0,50).reshape((-1,1))
OX = np.random.randint(0,500, 50).reshape((-1,1))
OY = np.random.randint(0,500, 50).reshape((-1,1))
DX = np.c... |
ljo/collatex-tutorial | unit5/Custom sort.ipynb | gpl-3.0 | import re
"""
Explanation: Defining a custom sort for a complex value
We need to sort data that is partially numeric and partially alphabetic, in this case the line numbers 1, 4008, 4008a, 4009, and 9. We can’t sort them numerically because the 'a' isn’t numeric. And we can’t sort them alphabetically because the numbe... |
marko911/deep-learning | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.