repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
choderalab/assaytools | examples/direct-fluorescence-assay/1b Simulating fluorescence binding data - protein concentration design a la Nick Levinson.ipynb | lgpl-2.1 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
%pylab inline
"""
Explanation: In this notebook we will explore how varying protein concentration can affect our fluorescence assay results
We will simulate expected fluorescence results for a ligand protein with known Kd and protein concentratio... |
mulhod/spaCy_demo | Cython_demo_notebook.ipynb | mit | import timeit
# There are two packages, one containing regular Python modules and
# the other containing corresponding Cython modules
"""
Explanation: Cython Demo
End of explanation
"""
# Let's create a C extension from the `hello` module
! rm -f awesome_cython_stuff/hello.c awesome_cython_stuff/hello*.so awesome_c... |
liganega/Gongsu-DataSci | notebooks/GongSu06_Errors_and_Exception_Handling.ipynb | gpl-3.0 | input_number = input("A number please: ")
number = int(input_number)
print("제곱의 결과는", number**2, "입니다.")
input_number = input("A number please: ")
number = int(input_number)
print("제곱의 결과는", number**2, "입니다.")
"""
Explanation: 오류 및 예외 처리
개요
코딩할 때 발생할 수 있는 다양한 오류 살펴 보기
오류 메시지 정보 확인 방법
예외 처리, 즉 오류가 발생할 수 있는 예외적... |
torgebo/deep_learning_workshop | 4-gan/1-gan-multimodal-distribution.ipynb | mit | import pandas as pd
import numpy as np
import admin.tools as tools
data = pd.read_csv('resources/multinomial.csv', index_col=0 )
"""
Explanation: Generative Adversarial Networks 1
<div class="alert alert-warning">
In this notebook we will use what we have learned about artificial neural networks to explore generative... |
ucsdlib/python-novice-inflammation | 4-files & conditionals-short.ipynb | cc0-1.0 | print(glob.glob('data/inflammation*.csv'))
"""
Explanation: glob contains function glob that finds files that match a pattern
* matches 0+ characters; ? matches any one char
End of explanation
"""
# loop here
counter = 0
for filename in glob.glob('data/*.csv'):
#counter+=1
counter = counter + 1
print("number... |
rebeccabilbro/rebeccabilbro.github.io | _drafts/words-in-space-nb.ipynb | mit | import os
from sklearn.datasets.base import Bunch
from yellowbrick.download import download_all
## The path to the test data sets
FIXTURES = os.path.join(os.getcwd(), "data")
## Dataset loading mechanisms
datasets = {
"hobbies": os.path.join(FIXTURES, "hobbies")
}
def load_data(name, download=True):
"""
... |
DamienIrving/ocean-analysis | development/calc_ensemble.ipynb | mit | sample_points_grid1 = [('depth', cube1_grid1.coord('depth').points),
('latitude', cube1_grid1.coord('latitude').points)]
cube2_grid1 = cube2_grid2.interpolate(sample_points_grid1, iris.analysis.Linear())
cube2_grid1.coord('latitude').bounds = cube1_grid1.coord('latitude').bounds
cube2_grid1.coo... |
kgrodzicki/machine-learning-specialization | course-3-classification/module-8-boosting-assignment-1-blank.ipynb | mit | import graphlab
"""
Explanation: Exploring Ensemble Methods
In this assignment, we will explore the use of boosting. We will use the pre-implemented gradient boosted trees in GraphLab Create. You will:
Use SFrames to do some feature engineering.
Train a boosted ensemble of decision-trees (gradient boosted trees) on t... |
vvishwa/deep-learning | intro-to-tensorflow/intro_to_tensorflow.ipynb | mit | import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
print('All m... |
duetosymmetry/slimplectic | PostNewtonian_Inspiral_with_RK.ipynb | mit | %matplotlib inline
from __future__ import print_function
import numpy as np, matplotlib.pyplot as plt
import slimplectic, orbit_util as orbit
# Parameters of the compact binary
# One solar mass in seconds
G = 6.67428e-11 #(in m^3/kg/s^2)
c = 2.99792458e8 # (in m/s)
Msun_in_kg = 1.98892e30
Msun_in_sec = G/c**3 * Msu... |
pdebuyl-lab/colloidal_chemotaxis_companion | diffusion.ipynb | bsd-3-clause | %matplotlib inline
import h5py
import matplotlib.pyplot as plt
from matplotlib.figure import SubplotParams
import numpy as np
from scipy.signal import fftconvolve
from scipy.optimize import leastsq, curve_fit
from scipy.integrate import simps, cumtrapz
from glob import glob
plt.rcParams['figure.figsize'] = (12, 6)
plt... |
chetnapriyadarshini/deep-learning | batch-norm/Batch_Normalization_Lesson.ipynb | mit | # Import necessary packages
import tensorflow as tf
import tqdm
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Import MNIST data so we have something for our experiments
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
"... |
FeitengLab/EmotionMap | 2StockEmotion/3. 主成份分析(PCA)(伦敦).ipynb | mit | import numpy as np
from sklearn.decomposition import PCA
import pandas as pd
df = pd.read_csv('London.txt', sep='\s+')
# df.drop('id', axis=1, inplace=True) # 数据不像Manhattan,前期已经去除id项
df.tail()
"""
Explanation: Here I will using scikit-learn to perform PCA in Jupyter Notebook.
First, I need some example to get familia... |
metpy/MetPy | v0.12/_downloads/e3a381e26c1f7c055ae74476848708cb/Station_Plot_with_Layout.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import pandas as pd
from metpy.calc import wind_components
from metpy.cbook import get_test_data
from metpy.plots import (add_metpy_logo, simple_layout, StationPlot,
StationPlotLayout, wx_code_map)
fr... |
nicoguaro/AdvancedMath | notebooks/vector_calculus-mayavi.ipynb | mit | from mayavi import mlab
import numpy as np
mlab.init_notebook()
red = (0.9, 0.1, 0.1)
blue = (0.2, 0.5, 0.7)
green = (0.3, 0.7, 0.3)
"""
Explanation: Coordinate systems
Introduction
This notebooks provides a tutorial about (curvilinear) coordinate systems. We use Mayavi to do the visualization of some of the surface... |
tensorflow/docs-l10n | site/ja/federated/tutorials/high_performance_simulation_with_kubernetes.ipynb | apache-2.0 | #@test {"skip": true}
!pip install --quiet --upgrade tensorflow-federated
!pip install --quiet --upgrade nest-asyncio
import nest_asyncio
nest_asyncio.apply()
"""
Explanation: High-performance Simulation with Kubernetes
This tutorial will describe how to set up high-performance simulation using a
TFF runtime running ... |
tleonhardt/CodingPlayground | python/cython/hello/hello_cython.ipynb | mit | %load_ext Cython
"""
Explanation: Using Cython in a Jupyter notebook
Cython can be used conveniently and interactively from a web browser through the Jupyter notebook.
To enable support for Cython compilation, install Cython and load the Cython extenstion from within Jupyter.
End of explanation
"""
%%cython
cdef ... |
albahnsen/ML_SecurityInformatics | notebooks/13-ModelDeployment.ipynb | mit | import pandas as pd
import zipfile
with zipfile.ZipFile('../datasets/phishing.csv.zip', 'r') as z:
f = z.open('phishing.csv')
data = pd.read_csv(f, index_col=False)
data.head()
data.phishing.value_counts()
"""
Explanation: 13 - Model Deployment
by Alejandro Correa Bahnsen
version 0.1, May 2016
Part of the cl... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/sandbox-1/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-1', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: BCC
Source ID: SANDBOX-1
Topic: Aerosol
Sub-Topics: Transport, Emissions, Concent... |
mne-tools/mne-tools.github.io | 0.21/_downloads/82590448493c884f52ea0c7ddc5b446b/plot_publication_figure.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# Daniel McCloy <dan.mccloy@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable, ImageGrid
import mne
"""
Explanation: Make figures more public... |
gammapy/PyGamma15 | tutorials/naima/naima_radiative_models.ipynb | bsd-3-clause | #prepare imports
import numpy as np
import astropy.units as u
import naima
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['lines.linewidth'] = 2
"""
Explanation: Naima Radiative Models
Welcome to the naima radiative models tutorial!
Useful references:
naima code at github
naima documentation
naima I... |
trangel/Insight-Data-Science | general-docs/recommendation-validation/recommender_systems-validation.ipynb | gpl-3.0 | # ipython notebook foo to embed figures
%matplotlib inline
from validation_figs import *
# generate a small, random user-item matrix for illustration
uim, _ = uim_data()
"""
Explanation: Recommender Systems: Validation
The goal of this document is to provide a solid basis for validating recommender systems. Along t... |
d00d/quantNotebooks | Notebooks/quantopian_research_public/notebooks/lectures/Variance/notebook.ipynb | unlicense | # Import libraries
import numpy as np
np.random.seed(121)
# Generate 20 random integers < 100
X = np.random.randint(100, size=20)
# Sort them
X = np.sort(X)
print 'X: %s' %(X)
mu = np.mean(X)
print 'Mean of X:', mu
"""
Explanation: Measures of Dispersion
By Evgenia "Jenny" Nitishinskaya, Maxwell Margenot, and Dela... |
AllenDowney/ThinkBayes2 | examples/combine_estimates.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
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from empiricaldist import Pmf
"""
Explanation: Think Ba... |
drphilmarshall/LocalGroupHaloProps | Notebooks/gmm_pair_M33.ipynb | gpl-2.0 | %matplotlib inline
import localgroup
import triangle
import sklearn
from sklearn import mixture
import numpy as np
import pickle
import matplotlib.patches as mpatches
"""
Explanation: Local Group Halo Properties: Demo Inference
We approximate the local group distance, radial velocity and proper motion likelihood funct... |
QuantStack/quantstack-talks | 2019-07-10-CICM/notebooks/wealth-of-nations.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import os
from bqplot import (
LogScale, LinearScale, OrdinalColorScale, ColorAxis,
Axis, Scatter, Lines, CATEGORY10, Label, Figure, Tooltip
)
from ipywidgets import HBox, VBox, IntSlider, Play, jslink
initial_year = 1800
"""
Explanation: This is a bqplot recreation of... |
TUW-GEO/ascat | docs/read_eumetsat.ipynb | mit | import os
import cartopy
from datetime import datetime
import matplotlib.pyplot as plt
from ascat.eumetsat.level1 import AscatL1bFile
from ascat.eumetsat.level1 import AscatL1bBufrFile
from ascat.eumetsat.level1 import AscatL1bBufrFileList
from ascat.eumetsat.level1 import AscatL1bNcFile
from ascat.eumetsat.level1 imp... |
arsenovic/clifford | docs/tutorials/g2-quick-start.ipynb | bsd-3-clause | import clifford as cf
layout, blades = cf.Cl(2) # creates a 2-dimensional clifford algebra
"""
Explanation: This notebook is part of the clifford documentation: https://clifford.readthedocs.io/.
Quick Start (G2)
This notebook gives a terse introduction to using the clifford module, using a two-dimensional geometric... |
ga7g08/ga7g08.github.io | _notebooks/2015-09-17-Estimating-the-underlying-distribution-of-Lyne-2010-correlations-in-nudot.ipynb | mit | nu = [1.229, 1.616, 1.543, 10.4, 1.3, 2.579, 2.622, 1.410, 2.631, 1.672,
3.952, 1.524, 0.983, 2.469, 3.256, 2.322, 5.996, 3.728]
nudot = [-21.25, -12.05, -11.76, -135.36, -88.31, -11.84, -7.5, -1.75, -1.18,
-17.7, -3.59, -22.75, -5.33, -365.68, -58.85, -73.96, -604.36, -58.64]
Deltanudot_over_nudot_per... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/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', 'snu', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties: 3... |
raschuetz/foundations-homework | Data_and_Databases_homework/homework_2_schuetz.ipynb | mit | import pg8000
conn = pg8000.connect(database="homework2")
"""
Explanation: Homework 2: Working with SQL (Data and Databases 2016)
This homework assignment takes the form of an IPython Notebook. There are a number of exercises below, with notebook cells that need to be completed in order to meet particular criteria. Yo... |
jphall663/GWU_data_mining | 02_analytical_data_prep/src/py_part_2_discretization.ipynb | apache-2.0 | import pandas as pd # pandas for handling mixed data sets
import numpy as np # numpy for basic math and matrix operations
"""
Explanation: License
Copyright (C) 2017 J. Patrick Hall, jphall@gwu.edu
Permission is hereby granted, free of charge, to any person obtaining a copy of this softwar... |
dkirkby/astroml-study | Chapter5/ParameterEstimation.ipynb | mit | # Author: Jake VanderPlas
# License: BSD
# The figure produced by this code is published in the textbook
# "Statistics, Data Mining, and Machine Learning in Astronomy" (2013)
# For more information, see http://astroML.github.com
# To report a bug or issue, use the following forum:
# https://groups.google.com... |
mbeyeler/opencv-machine-learning | notebooks/05.01-Building-Our-First-Decision-Tree.ipynb | mit | data = [
{'age': 33, 'sex': 'F', 'BP': 'high', 'cholesterol': 'high', 'Na': 0.66, 'K': 0.06, 'drug': 'A'},
{'age': 77, 'sex': 'F', 'BP': 'high', 'cholesterol': 'normal', 'Na': 0.19, 'K': 0.03, 'drug': 'D'},
{'age': 88, 'sex': 'M', 'BP': 'normal', 'cholesterol': 'normal', 'Na': 0.80, 'K': 0.05, 'drug': 'B'},... |
Karuntg/SDSS_SSC | Analysis_2020/recalibration_gray.ipynb | gpl-3.0 | %matplotlib inline
from astropy.table import Table
from astropy.coordinates import SkyCoord
from astropy import units as u
from astropy.table import hstack
import matplotlib.pyplot as plt
import numpy as np
from astroML.plotting import hist
# for astroML installation see https://www.astroml.org/user_guide/installation... |
catherinezucker/dustcurve | tutorial.ipynb | gpl-3.0 | import emcee
from dustcurve import model
import seaborn as sns
import numpy as np
from dustcurve import pixclass
import matplotlib.pyplot as plt
import pandas as pd
import warnings
from dustcurve import io
from dustcurve import hputils
from dustcurve import kdist
%matplotlib inline
#this code pulls snippets from the P... |
SylvainCorlay/bqplot | examples/Marks/Pyplot/HeatMap.ipynb | apache-2.0 | import numpy as np
from ipywidgets import Layout
import bqplot.pyplot as plt
from bqplot import ColorScale
"""
Explanation: Heatmap
The HeatMap mark represents a 2d matrix of values as a color image. It can be used to visualize a 2d function, or a grayscale image for instance.
HeatMap is very similar to the GridHeatMa... |
infilect/ml-course1 | keras-notebooks/Frameworks/2.2 Introduction - Tensorflow.ipynb | mit | # A simple calculation in Python
x = 1
y = x + 10
print(y)
import tensorflow as tf
# The ~same simple calculation in Tensorflow
x = tf.constant(1, name='x')
y = tf.Variable(x+10, name='y')
print(y)
"""
Explanation: <img src="../imgs/tensorflow_head.png" />
Tensorflow
TensorFlow (https://www.tensorflow.org/) is a so... |
jarvis-fga/Projetos | Problema 2/jeferson/.ipynb_checkpoints/sentiment-analysis-checkpoint.ipynb | mit | import pandas
imdb = pandas.read_csv('data/imdb_labelled.txt', sep="\t", names=["sentences", "polarity"])
yelp = pandas.read_csv('data/yelp_labelled.txt', sep="\t", names=["sentences", "polarity"])
amazon = pandas.read_csv('data/amazon_cells_labelled.txt', sep="\t", names=["sentences", "polarity"])
big = pandas.DataF... |
seg/2016-ml-contest | MandMs/03_Facies_classification-MandMs_SFS_v2-validation_set.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.metrics import f1_score, accuracy_score, make_scorer
filename = 'engineered_features.csv'
training_data = pd.read_csv(filename)
training_data.describe()
tr... |
jakevdp/sklearn_tutorial | notebooks/03.1-Classification-SVMs.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
plt.style.use('seaborn')
"""
Explanation: <small><i>This notebook was put together by Jake Vanderplas. Source and license info is on GitHub.</i></small>
Supervised Learning In-Depth: Support Vector Machines
Previously we int... |
kimkipyo/dss_git_kkp | Python 복습/14일차.금_pandas + SQL_2/14일차_4T_Pandas로 배우는 SQL 시작하기 (4) - HAVING, SUB QUERY.ipynb | mit | import pymysql
import curl
db = pymysql.connect(
"db.fastcamp.us",
"root",
"dkstncks",
"sakila",
charset = "utf8",
)
customer_df = pd.read_sql("SELECT * FROM customer;", db)
rental_df = pd.read_sql("SELECT * FROM rental;", db)
df = rental_df.merge(customer_df, on="customer_id")
df.head(1)
rental... |
luizfmoura/datascience | Luiz Fernando De Moura - 2021_2_Practice_2_Implementing_LENET_5_architectures_using_Keras.ipynb | gpl-2.0 | import tensorflow as tf
from keras import callbacks
"""
Explanation: 1 - Hands-on TensorFlow + Keras + LENET-5
Implement and train several times using keras API your own LENET-5 implementation. Notice that you will be urged to derive an implementation somehow distinct to the original proposal of LeCun et al.
1.1 - L... |
joelowj/Udacity-Projects | Udacity-Artificial-Intelligence-Nanodegree/Project-6/RNN_project.ipynb | apache-2.0 | ### Load in necessary libraries for data input and normalization
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
%load_ext autoreload
%autoreload 2
from my_answers import *
%load_ext autoreload
%autoreload 2
from my_answers import *
### load in and normalize the dataset
dataset = np.loadtxt('... |
erccarls/vectorsearch | notebooks/data_challenge/Data Summaries.ipynb | apache-2.0 | import pandas as pd
# Sample code number: id number
# Clump Thickness: 1 - 10
# 3. Uniformity of Cell Size: 1 - 10
# 4. Uniformity of Cell Shape: 1 - 10
# 5. Marginal Adhesion: 1 - 10
# 6. Single Epithelial Cell Size: 1 - 10
# 7. Bare Nuclei: 1 - 10
# 8. Bland Chromatin: 1 - 10
# 9. Normal Nucleoli: 1 - 10
# 10. M... |
antoniomezzacapo/qiskit-tutorial | community/terra/qis_adv/fourier_transform.ipynb | apache-2.0 | import math
# importing Qiskit
from qiskit import Aer, IBMQ
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute
from qiskit.backends.ibmq import least_busy
# useful additional packages
from qiskit.wrapper.jupyter import *
from qiskit.tools.visualization import plot_histogram
IBMQ.load_acc... |
Misteir/Machine_Learning | linear_regression/linear_regression1.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Librairies
End of explanation
"""
data = pd.read_csv('ex1data1.txt', header=None, names=['population', 'profit'])
data.head()
data.plot.scatter('population', 'profit')
"""
Explanation: read file content
End o... |
leriomaggio/code-coherence-analysis | Lexical Analysis.ipynb | bsd-3-clause | %load preamble_directives.py
"""
Explanation: Lexical Information Overlap
This notebook contains some code to process and normalize the lexical information appearing in CodeMethod comments and implementations
(i.e., CodeMethod.comment and CodeMethod.code, respectively).
The overall processing encompasses the followin... |
Rauf-Kurbanov/au_dl_course | seminar_1/homework_task2.ipynb | gpl-3.0 | mnist = input_data.read_data_sets('/data/mnist', one_hot=True)
"""
Explanation: Step 1: Read in data<br>
using TF Learn's built in function to load MNIST data to the folder data/mnist
End of explanation
"""
with tf.Session() as sess:
start_time = time.time()
sess.run(tf.global_variables_initializer())
n_batches... |
CrowdTruth/CrowdTruth-core | tutorial/notebooks/.ipynb_checkpoints/Sparse Multiple Choice Task - Relation Extraction-checkpoint.ipynb | apache-2.0 | import pandas as pd
test_data = pd.read_csv("../data/relex-sparse-multiple-choice.csv")
test_data.head()
"""
Explanation: CrowdTruth for Sparse Multiple Choice Tasks: Relation Extraction
In this tutorial, we will apply CrowdTruth metrics to a sparse multiple choice crowdsourcing task for Relation Extraction from sent... |
mdeff/ntds_2016 | project/reports/youtube_fame/Create_videos_database.ipynb | mit | VIDEOS_REQUEST_ID_LIMIT = 50
CHANNEL_REQUEST_ID_LIMIT = 50
key1 = "KEY"
key2 = "KEY"
DEVELOPER_KEY = key2
import requests
import json
import pandas as pd
from math import *
import numpy as np
import tensorflow as tf
import time
import collections
import os
import timeit
from IPython.display import display
#where ... |
jazracherif/algorithms | tsp/tsp.ipynb | mit | import numpy as np
file = "tsp.txt"
# file = "test2.txt"
data = open(file, 'r').readlines()
n = int(data[0])
graph = {}
for i,v in enumerate(data[1:]):
graph[i] = tuple(map(float, v.strip().split(" ")))
dist_val = np.zeros([n,n])
for i in range(n):
for k in range(n):
dist_val[i,k] = dist_val[k... |
IndicoDataSolutions/SuperCell | plotlines/plotlines.ipynb | mit | import sys
import os
import pandas as pd # dataframes to store text samples + scores
# Plotting
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn # for more appealing plots
seaborn.set_style("darkgrid")
# Pretty printing
import pprint
pp = pprint.PrettyPrinter(indent=4)
# indico API
import indicoio ... |
ljwolf/spvcm | notebooks/spatially-varying-coefficients.ipynb | mit | side = np.arange(0,10,1)
grid = np.tile(side, 10)
beta1 = grid.reshape(10,10)
beta2 = np.fliplr(beta1).T
fig, ax = plt.subplots(1,2, figsize=(12*1.6, 6))
sns.heatmap(beta1, ax=ax[0])
sns.heatmap(beta2, ax=ax[1])
plt.show()
"""
Explanation: Today, we'll sample a spatially-varying coefficient model, like that discusse... |
rrbb014/data_science | fastcampus_dss/2016_05_23/0523_08__SciPy 시작하기.ipynb | mit | rv = sp.stats.norm(loc=10, scale=10) # 정규분포는 노말이고, loc, scale은 선택이다. location = 평균, scale 은 표준편차?
rv.rvs(size=(3,10), random_state=1) # rvs = 실제 샘플 생성. (3x10) , random_state => seed값임.
sns.distplot(rv.rvs(size=10000, random_state=1))
xx = np.linspace(-40, 60, 1000)
pdf = rv.pdf(xx)
plt.plot(xx, pdf) # 확률밀도함수를 그렸다!
... |
mne-tools/mne-tools.github.io | dev/_downloads/0bf55d4c93021947144bdb72823131e5/read_neo_format.ipynb | bsd-3-clause | import neo
import mne
"""
Explanation: How to use data in neural ensemble (NEO) format
This example shows how to create an MNE-Python ~mne.io.Raw object from data
in the neural ensemble_ format. For general
information on creating MNE-Python's data objects from NumPy arrays, see
tut-creating-data-structures.
End of ex... |
drericstrong/Blog | 20170526_FastFourierTransformInPython.ipynb | agpl-3.0 | import numpy as np
from scipy import pi
import matplotlib.pyplot as plt
%matplotlib inline
# Sampling rate and time vector
start_time = 0 # seconds
end_time = 2 # seconds
sampling_rate = 1000 # Hz
N = (end_time - start_time)*sampling_rate # array size
# Frequency domain peaks
peak1_hz = 60 # Hz where the peak occurs
... |
wheeler-microfluidics/teensy-minimal-rpc | teensy_minimal_rpc/notebooks/dma-examples/Example - Scatter array of 4 to 4 separate arrays.ipynb | gpl-3.0 | import numpy as np
num_sources = 4
src_array = np.arange(1, num_sources + 1)
samples_per_source = 5
print src_array
print np.repeat(src_array, samples_per_source)
"""
Explanation: This example demonstrates how to scatter values from a source array to
implement the equivalent of the numpy.repeat function.
TODO
The me... |
PyPSA/PyPSA | examples/notebooks/unit-commitment.ipynb | mit | import pypsa
import pandas as pd
"""
Explanation: Unit commitment
This tutorial runs through examples of unit commitment for generators at a single bus. Examples of minimum part-load, minimum up time, minimum down time, start up costs, shut down costs and ramp rate restrictions are shown.
To enable unit commitment on ... |
zshujon/USDC_Project_02_Traffic_Sign_Classification | 00_TSC_NN_Keras.ipynb | mit | import matplotlib.pyplot as plt
import random as rn
import numpy as np
from sklearn.model_selection import train_test_split
import pickle
from keras.models import Sequential
from keras.layers import Dense, Input, Activation
from keras.utils import np_utils
%matplotlib inline
"""
Explanation: <h1>Traffic Signs Classifi... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-cm2-vhr4/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-cm2-vhr4', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-CM2-VHR4
Topic: Aerosol
Sub-Topics: Transport, Emission... |
CoderDojoTC/python-minecraft | classroom-code/exercises/Exercise 3 -- Basic Python Syntax.ipynb | mit | 1 + 1
2 * 4
(2 * 4) - 2
4 ** 2 # Raise a number to a power
16 / 4
15 / 4
2.5 * 2.0
15.0 / 4
"""
Explanation: Basic Python Syntax
In this exercise, you will work through some simple blocks of code so you learn the essentials of the Python language syntax.
For each of the code blocks below, read the code before ... |
computational-class/cjc2016 | code/09.09-machine-learning-summary.ipynb | mit | %matplotlib inline
import sklearn
from sklearn import datasets
from sklearn import linear_model
import matplotlib.pyplot as plt
from sklearn.metrics import classification_report
from sklearn.preprocessing import scale
# boston data
boston = datasets.load_boston()
y = boston.target
X = boston.data
boston['feature_name... |
tensorflow/cloud | g3doc/tutorials/google_cloud_project_setup_instructions.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... |
google/eng-edu | ml/cc/exercises/linear_regression_with_a_real_dataset.ipynb | apache-2.0 | #@title Run on TensorFlow 2.x
%tensorflow_version 2.x
"""
Explanation: Linear Regression with a Real Dataset
This Colab uses a real dataset to predict the prices of houses in California.
Learning Objectives:
After doing this Colab, you'll know how to do the following:
Read a .csv file into a pandas DataFrame.
Exam... |
plissonf/DeepPlay | notebooks/web_scraping.ipynb | mit | from bs4 import BeautifulSoup
from lxml import html
import requests as rq
import pandas as pd
import re
import logging
"""
Explanation: AIDA Freediving Records
The project DeepPlay aims at exploring and displaying the world of competitive freediving using web-scraping, machine learning and data visualizations (e.g. D3... |
keras-team/keras-io | examples/vision/ipynb/video_classification.ipynb | apache-2.0 | !pip install -q git+https://github.com/tensorflow/docs
"""
Explanation: Video Classification with a CNN-RNN Architecture
Author: Sayak Paul<br>
Date created: 2021/05/28<br>
Last modified: 2021/06/05<br>
Description: Training a video classifier with transfer learning and a recurrent model on the UCF101 dataset.
This ex... |
rishuatgithub/MLPy | torch/PYTORCH_NOTEBOOKS/02-ANN-Artificial-Neural-Networks/05-Neural-Network-Exercises.ipynb | apache-2.0 | import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
%matplotlib inline
df = pd.read_csv('../Data/income.csv')
print(len(df))
df.head()
df['label'].value_counts()
"""
Explanation: <img src="../Pierian-Data-Logo.PNG">
<br>
<stron... |
sthuggins/phys202-2015-work | days/day06/Matplotlib.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Visualization with Matplotlib
Learning Objectives: Learn how to make basic plots using Matplotlib's pylab API and how to use the Matplotlib documentation.
This notebook focuses only on the Matplotlib API, rather that the broader que... |
p0licat/university | Experiments/Crawling/Jupyter Notebooks/Analysis.ipynb | mit | import mariadb
import json
with open('../credentials.json', 'r') as crd_json_fd:
json_text = crd_json_fd.read()
json_obj = json.loads(json_text)
credentials = json_obj["Credentials"]
username = credentials["username"]
password = credentials["password"]
table_name = "publications"
db_name = "ubbcluj"
mariadb... |
Ttl/scikit-rf | doc/source/tutorials/NetworkSet.ipynb | bsd-3-clause | ls data/ro*
"""
Explanation: NetworkSet
Introduction
The NetworkSet object represents an unordered set of networks. It
provides methods iterating and slicing the set, sorting by datetime, calculating statistical quantities, and displaying uncertainty bounds on plots.
Creating a NetworkSet
Lets take a look in the d... |
kbennion/foundations-hw | 6.16Notes.ipynb | mit | #subject lines that have dates, e.g. 12/01/99
[line for line in subjects if re.search("\d\d/\d\d/\d\d", line)]
"""
Explanation: metachars
. any char
\w any alphanumeric (a-z, A-Z, 0-9, _)
\s any whitespace char (" _, \t, \n)
\S any nonwhitespace
\d any digit (0-9)
. searches for an actual period
End of explanation
""... |
gregnordin/ECEn360_W15 | plane_waves/dev_notes.ipynb | mit | %%javascript
IPython.load_extensions('calico-document-tools');
!date
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
"""
Explanation: Table of Contents
Objective: propagating plane wave visualization
How to get docstrings for a class definition
Figure o... |
lmoresi/UoM-VIEPS-Intro-to-Python | Notebooks/Mapping/2 - Images and GeoTIFFs.ipynb | mit | %pylab inline
import cartopy
import gdal
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
globalmarble = gdal.Open("../../Data/Resources/BlueMarbleNG-TB_2004-06-01_rgb_3600x1800.TIFF")
globalmarble_img = globalmarble.ReadAsArray().transpose(1,2,0)
# Note that we convert the gdal object into an image ... |
martadesimone/Protoplanetarydisks | New_Table.ipynb | gpl-2.0 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from astropy.table import Table
from astropy import units as u
from astropy.modeling.blackbody import blackbody_nu
"""
Explanation: NewTable
Code to create a merging table from some tables in input.
After comparing the tables (in this case the one i... |
Geosyntec/pycvc | examples/2 - Hydrologic Summaries.ipynb | bsd-3-clause | %matplotlib inline
import os
import sys
import datetime
import warnings
import numpy as np
import matplotlib.pyplot as plt
import pandas
import seaborn
seaborn.set(style='ticks', context='paper')
import wqio
from wqio import utils
import pybmpdb
import pynsqd
import pycvc
min_precip = 1.9999
big_storm_date = datet... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/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', 'cams', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 ... |
phnmnl/workflow-demo | OpenMS/OpenMS.ipynb | apache-2.0 | import os
workingDir="OpenMS"
if not os.path.exists(workingDir):
os.makedirs(workingDir)
os.chdir(workingDir)
"""
Explanation: OpenMS Workflow
OpenMS is an open source platform for LC/MS data pre-processing and analysis.
Several tools have been developed using OpenMS library including noise reduction, centroiding... |
dcavar/python-tutorial-for-ipython | notebooks/Deep Learning Tutorial.ipynb | apache-2.0 | from typing import Callable
"""
Explanation: Deep Learning Tutorial
(C) 2019 by Damir Cavar
This notebook was inspired by numerous totorials and other notebooks online, and books like Weidman (2019), ...
General Conventions
In the following Python code I will make use of type hints for Python to make explicit the vari... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-vcf2hdf5.ipynb | gpl-3.0 | # conda install ipyrad -c bioconda
# conda install htslib -c bioconda
# conda install bcftools -c bioconda
import ipyrad.analysis as ipa
import pandas as pd
"""
Explanation: <span style="color:gray">ipyrad-analysis toolkit:</span> vcf_to_hdf5
View as notebook
Many genome assembly tools will write variant SNP calls t... |
tiagoft/curso_audio | tdf_audio.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
fs = 44100
T = 3 # segundos
N = fs*T # numero de amostras do sinal
f = 1000 # Frequencia da senoide
t = np.linspace(0, T, N) # Aqui, defino os instantes de tempo em que vou amostrar o sinal
x = np.cos(2 * np.pi * f * t)
plt.plot(t,x)
plt.xlabel('... |
bashalex/datapot | notebooks/DatapotUsageExamples.ipynb | gpl-3.0 | import datapot as dp
from datapot import datasets
import pandas as pd
from __future__ import print_function
import sys
import bz2
import time
import xgboost as xgb
from sklearn.model_selection import cross_val_score
import datapot as dp
from datapot.utils import csv_to_jsonlines
"""
Explanation: Datapot Usage Exampl... |
mne-tools/mne-tools.github.io | stable/_downloads/eb0c29f55af0173daab811d4f4dc2f40/simulated_raw_data_using_subject_anatomy.ipynb | bsd-3-clause | # Author: Ivana Kojcic <ivana.kojcic@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
# Kostiantyn Maksymenko <kostiantyn.maksymenko@gmail.com>
# Samuel Deslauriers-Gauthier <sam.deslauriers@gmail.com>
# License: BSD-3-Clause
import os.path as op
import numpy as np
import mne
from mne.data... |
caseyjlaw/FRB121102 | AOVLA_spectrum.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pylab as pl
import astropy.io.fits as fits
import rtpipe
import rtlib_cython as rtlib
import astropy.units as units
import astropy.coordinates as coord
from astropy.time import Time
# confirm version is is earlier than 1.54 if using old dm scale
print(rtpipe.__version__)... |
tien-le/uranus | machine_learning_project.ipynb | mit | # To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
# Common imports
import numpy as np
import numpy.random as rnd
import os
# to make this notebook's output stable across runs
rnd.seed(42)
# To plot pretty figures
%matplotlib inline
import matplotlib
import matp... |
mne-tools/mne-tools.github.io | 0.23/_downloads/1c191178a3423d922910711c4b574821/50_configure_mne.ipynb | bsd-3-clause | import os
import mne
"""
Explanation: Configuring MNE-Python
This tutorial covers how to configure MNE-Python to suit your local system and
your analysis preferences.
We begin by importing the necessary Python modules:
End of explanation
"""
print(mne.get_config('MNE_USE_CUDA'))
print(type(mne.get_config('MNE_USE_CU... |
jacobdein/alpine-soundscapes | source detection/Region of interest.ipynb | mit | import numpy as np
from scipy.ndimage import label, find_objects
from scipy.ndimage.morphology import generate_binary_structure
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from nacoustik import Wave
from nacoustik.spectrum import psd
from nacoustik.noise import remove_background_noise
%matp... |
jorisvandenbossche/2015-EuroScipy-pandas-tutorial | solved - 06 - Reshaping data.ipynb | bsd-2-clause | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: <p><font size="6"><b>Reshaping data</b></font></p>
© 2016, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbossche&#... |
chengsoonong/crowdastro | notebooks/11_classification.ipynb | mit | import collections
import itertools
import logging
import pprint
import sys
import warnings
import matplotlib.pyplot
import numpy
import scipy.linalg
import skimage.feature
import sklearn.cross_validation
import sklearn.decomposition
import sklearn.ensemble
import sklearn.linear_model
import sklearn.metrics
import skl... |
lyoung13/deep-learning-nanodegree | p2-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'
class DLProgress(tqdm):
last_block = 0
def hoo... |
ajdawson/python_for_climate_scientists | course_content/notebooks/pandas_introduction.ipynb | gpl-3.0 | import pandas as pd
"""
Explanation: Working with pandas DataFrames
Pandas (http://pandas.pydata.org) is great for data analysis, again we met it briefly in the software carpentry course, but it's worth revisiting.
Note the book on that website - 'Python for data analysis', this is a useful text which much of this se... |
szymonm/pyspark-dataproc-workshop | rdds_real_dataset.ipynb | apache-2.0 | ! gsutil ls gs://pyspark-workshop/so-posts
lines = sc.textFile("gs://pyspark-workshop/so-posts/*")
# or a smaller piece of them
lines = sc.textFile("gs://pyspark-workshop/so-posts/Posts.xml-*a")
"""
Explanation: Let's read the data
End of explanation
"""
lines.take(5)
"""
Explanation: Let's check what's inside th... |
policyMetrics/course | lectures/material/06_monte_carlo_exploration/lecture.ipynb | mit | import pickle as pkl
import numpy as np
import copy
from statsmodels.sandbox.regression.gmm import IV2SLS
from mc_exploration_functions import *
import statsmodels.api as sm
import seaborn.apionly as sns
import grmpy
model_base = get_model_dict('mc_exploration.grmpy.ini')
model_base['SIMULATION']['source'] = 'mc_da... |
opengeostat/pygslib | doc/source/Tutorial_1/Tutorial.ipynb | mit | # import third party python libraries
import pandas as pd
import matplotlib.pylab as plt
import numpy as np
# make plots inline
%matplotlib inline
# later try %matplotlib notebook
#%matplotlib notebook
# import pygslib
import pygslib
"""
Explanation: Tutorial: Resource estimation with PyGSLIB
This tutorial will guid... |
AguaParaelPueblo/plant_notebooks | Gracias/ConductionLine.ipynb | mit | from aide_design.play import *
from IPython.display import display
pipe.ID_sch40 = np.vectorize(pipe.ID_sch40)
pipe.ID_sch40 = np.vectorize(pipe.ID_sch40)
################## Constants #################
flow_branch = 60 *u.L/u.s
flow_full = flow_branch * 2
nd_pipe_train_4 = 4 *u.inch
sdr_pipe = 17
nd_pipe_... |
ES-DOC/esdoc-jupyterhub | notebooks/nims-kma/cmip6/models/sandbox-2/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nims-kma', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NIMS-KMA
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Em... |
jdekozak/dirac5d | Pauli with Geometric Algebra 4,0 over the Reals.ipynb | gpl-3.0 | from sympy import *
variables = (x, y, z, w) = symbols('x y z w', real=True)
print(variables)
metric=[ 1
,1
,1
,1]
myBasis='e_1 e_2 e_3 e_4'
sp4d = Ga(myBasis, g=metric, coords=variables,norm=True)
(e_1, e_2, e_3, e_4) = sp4d.mv()
"""
Explanation: ALGEBRA & DEFINITIONS
Clifford algebra is $$... |
ngcm/summer-academy-2017-basics | basics_B/Recap/Basics_examples.ipynb | mit | list1 = [10, 12, 14, 16, 18]
print(list1[0]) # Index starts at 0
print(list1[-1]) # Last index at -1
"""
Explanation: <font color='mediumblue'> Lists
<font color='midnightblue'> Example: Indexed
End of explanation
"""
print(list1[0:3]) # Slicing: exclusive of end value
# i.e. get ... |
bryanwweber/thermostate | docs/regen-reheat-rankine-cycle-example.ipynb | bsd-3-clause | from thermostate import State, Q_, units, SystemInternational as SI
from thermostate.plotting import IdealGas, VaporDome
"""
Explanation: Regen-Reheat Rankine Cycle Example
Imports
End of explanation
"""
substance = 'water'
T_1 = Q_(480.0, 'degC')
p_1 = Q_(12.0, 'MPa')
p_2 = Q_(2.0, 'MPa')
p_3 = p_2
T_3 = Q_(440.0, ... |
okkhoy/pyDataAnalysis | ml-regression/week1/PhillyCrime.ipynb | mit | import graphlab
"""
Explanation: Fire up graphlab create
End of explanation
"""
sales = graphlab.SFrame.read_csv('Philadelphia_Crime_Rate_noNA.csv/')
sales
"""
Explanation: Load some house value vs. crime rate data
Dataset is from Philadelphia, PA and includes average house sales price in a number of neighborhoods... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.