repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
tclaudioe/Scientific-Computing | SC5/04 Numerical Example of Spectral Differentiation.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import scipy.sparse.linalg as sp
from scipy import interpolate
import scipy as spf
from sympy import *
import sympy as sym
from scipy.linalg import toeplitz
from ipywidgets import interact
from ipywidgets import IntSlider
from mpl_toolkits.mplot3d im... |
xesscorp/pygmyhdl | docs/_build/singlehtml/notebooks/2_hierarchy/.ipynb_checkpoints/hierarchy_and_abstraction_and_ursidae_oh_my-checkpoint.ipynb | mit | from pygmyhdl import *
@chunk
def dff(clk_i, d_i, q_o):
'''
Inputs:
clk_i: Rising edge on this input stores data on d_i into q_o.
d_i: Input that brings new data into the flip-flop:
Outputs:
q_o: Output of the data stored in the flip-flop.
'''
@seq_logic(clk_i.posedge)
def log... |
fpavogt/pyqz | docs/source/pyqz_demo_param.ipynb | gpl-3.0 | %matplotlib inline
import pyqz
import pyqz.pyqz_plots as pyqzp
import numpy as np
"""
Explanation: The parameters of pyqz
pyqz is designed to be easy and quick to use, but without withholding any information from the user. As such, all parameters of importance for deriving the estimates of LogQ and Tot[O]+12 can be m... |
tata-antares/tagging_LHCb | Stefania_files/track-tagging.ipynb | apache-2.0 | import pandas
import numpy
from folding_group import FoldingGroupClassifier
from rep.data import LabeledDataStorage
from rep.report import ClassificationReport
from rep.report.metrics import RocAuc
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import roc_curve, roc_auc_score
from utils impo... |
christophmark/bayesloop | docs/source/tutorials/firststeps.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt # plotting
import seaborn as sns # nicer plots
sns.set_style('whitegrid') # plot styling
import bayesloop as bl
S = bl.Study()
"""
Explanation: First steps with bayesloop
bayesloop models feature a two-level hierarchical structure: the low-level, obse... |
kit-cel/wt | mloc/ch1_Preliminaries/steepest_gradient_descent.ipynb | gpl-2.0 | import importlib
autograd_available = True
# if automatic differentiation is available, use it
try:
import autograd
except ImportError:
autograd_available = False
pass
if autograd_available:
import autograd.numpy as np
from autograd import grad
else:
import numpy as np
import matplotlib.py... |
olgabot/cshl-singlecell-2017 | notebooks/2.4_matrix_decomposition_pca_ica_nmf.ipynb | mit | from __future__ import print_function, division
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# use seaborn plotting style defaults
import seaborn as sns; sns.set()
"""
Explanation: <small><i>The PCA section of this notebook was put together by Jake Vanderplas. Source ... |
tpin3694/tpin3694.github.io | regex/match_any_of_series_of_words.ipynb | mit | # Load regex package
import re
"""
Explanation: Title: Match Any Of A Series Of Words
Slug: match_any_of_series_of_words
Summary: Match Any Of A Series Of Words
Date: 2016-05-01 12:00
Category: Regex
Tags: Basics
Authors: Chris Albon
Based on: Regular Expressions Cookbook
Preliminaries
End of explanation
"""
# Cre... |
jArumugam/python-notes | libraries/DS05 Web Scraping.ipynb | mit | from bs4 import BeautifulSoup
import requests
import pandas as pd
from pandas import Series,DataFrame
"""
Explanation: Web Scraping in Python
Source
In this appendix lecture we'll go over how to scrape information from the web using Python.
We'll go to a website, decide what information we want, see where and how it... |
thiagoqd/queirozdias-deep-learning | sentiment-rnn/Sentiment RNN.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment_network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment_network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session01/Day4/SGRandForestSolutions.ipynb | mit | import numpy as np
from astropy.table import Table
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Supervised Machine Learning Break Out:
Separating Stars and Galaxies from SDSS
Version 0.1
Many (nearly all?) of the science applications for LSST data will rely on the accurate separation of stars an... |
locationtech/geowave | examples/data/notebooks/jupyter/geowave-gpx.ipynb | apache-2.0 | #!pip install --user --upgrade pixiedust
import pixiedust
import geowave_pyspark
"""
Explanation: Geowave GPX Demo
This Demo runs KMeans on the GPX dataset consisting of approximately 285 million point locations. We use a cql filter to reduce the KMeans set to a bounding box over Berlin, Germany. Simply focus a cell ... |
kit-cel/lecture-examples | mloc/ch4_Deep_Learning/pytorch/pytorch_tutorial_1.ipynb | gpl-2.0 | import torch
import numpy as np
device = 'cuda' if torch.cuda.is_available() else 'cpu'
print("We are using the following device for learning:",device)
"""
Explanation: PyTorch Tutorial - Part 1
This code is provided as supplementary material of the lecture Machine Learning and Optimization in Communications (MLOC).<... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/sandbox-2/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-2', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: SANDBOX-2
Sub-Topics: Radiative Forc... |
ARM-software/bart | docs/notebooks/sched/SchedDeadline.ipynb | apache-2.0 | from trappy.stats.Topology import Topology
from bart.sched.SchedMultiAssert import SchedMultiAssert
from bart.sched.SchedAssert import SchedAssert
import trappy
import os
import operator
import json
#Define a CPU Topology (for multi-cluster systems)
BIG = [1, 2]
LITTLE = [0, 3, 4, 5]
CLUSTERS = [BIG, LITTLE]
topology ... |
gargraghav/tensorflow | Learning Tensorflow/Working_of_TensorFlow.ipynb | mit | import tensorflow as tf
"""
Explanation: <div style="text-align:center"><img src = "https://www.tensorflow.org/_static/images/tensorflow/logo.png"></div>
<a id="ref2"></a>
How does TensorFlow work?
TensorFlow defines computations as Graphs, and these are made with operations (also know as “ops”). So, when we work wi... |
tylere/docker-tmpnb-ee | notebooks/1 - IPython Notebook Examples/IPython Project Examples/Interactive Widgets/Custom Widget - Hello World.ipynb | apache-2.0 | from __future__ import print_function # For py 2.7 compat
"""
Explanation: Index - Back
End of explanation
"""
from IPython.html import widgets
from IPython.utils.traitlets import Unicode
class HelloWidget(widgets.DOMWidget):
_view_name = Unicode('HelloView', sync=True)
"""
Explanation: Building a Custom Widge... |
oemof/examples | oemof_examples/oemof.solph/v0.2.x/sector_coupling/sector_coupling.ipynb | gpl-3.0 | from oemof.solph import EnergySystem
import pandas as pd
# initialize energy system
energysystem = EnergySystem(timeindex=pd.date_range('1/1/2016',
periods=168,
freq='H'))
"""
Explanation: Multisectoral energy sy... |
mne-tools/mne-tools.github.io | 0.22/_downloads/5514ea6c90dde531f8026904a417527e/plot_10_evoked_overview.ipynb | bsd-3-clause | import os
import mne
"""
Explanation: The Evoked data structure: evoked/averaged data
This tutorial covers the basics of creating and working with :term:evoked
data. It introduces the :class:~mne.Evoked data structure in detail,
including how to load, query, subselect, export, and plot data from an
:class:~mne.Evoked ... |
PBrockmann/ipython_ferretmagic | notebooks/ferretmagic_06_InteractWidget.ipynb | mit | %load_ext ferretmagic
"""
Explanation: <hr>
Patrick BROCKMANN - LSCE (Climate and Environment Sciences Laboratory)<br>
<img align="left" width="40%" src="http://www.lsce.ipsl.fr/Css/img/banniere_LSCE_75.png" ><br><br>
<hr>
Updated: 2019/11/13
Load the ferret extension
End of explanation
"""
%%ferret -s 600,400
set ... |
pagutierrez/tutorial-sklearn | notebooks-spanish/21-reduccion_dimensionalidad_no_lineal.ipynb | cc0-1.0 | from sklearn.datasets import make_s_curve
X, y = make_s_curve(n_samples=1000)
from mpl_toolkits.mplot3d import Axes3D
ax = plt.axes(projection='3d')
ax.scatter3D(X[:, 0], X[:, 1], X[:, 2], c=y)
ax.view_init(10, -60);
"""
Explanation: Aprendizaje de variedades
Una de las debilidades del PCA es que no puede detectar c... |
googlesamples/mlkit | tutorials/mlkit_image_labeling_model_maker.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... |
detcitty/intro-numerical-methods | 1_intro_to_python.ipynb | mit | 2 + 2
32 - (4 + 2)**2
1 / 2
"""
Explanation: Discussion 1: Introduction to Python
So you want to code in Python? We will do some basic manipulations and demonstrate some of the basics of the notebook interface that we will be using extensively throughout the course.
Topics:
- Math
- Variables
- Lists
- Control... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/statespace_news.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
macrodata = sm.datasets.macrodata.load_pandas().data
macrodata.index = pd.period_range('1959Q1', '2009Q3', freq='Q')
"""
Explanation: Forecasting, updating datasets, and the "news"
In this notebook,... |
mbeyeler/opencv-machine-learning | notebooks/12.00-Wrapping-Up.ipynb | mit | import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
class MyClassifier(BaseEstimator, ClassifierMixin):
"""An example classifier"""
def __init__(self, param1=1, param2=2):
"""Called when initializing the classifier
The constructor is used to define some optional... |
arsenovic/galgebra | examples/ipython/Smith Sphere.ipynb | bsd-3-clause | #from IPython.display import SVG
#SVG('pics/smith_sphere.svg')
from galgebra.printer import Format, Fmt
from galgebra import ga
from galgebra.ga import Ga
from sympy import *
Format()
(o3d,er,ex,es) = Ga.build('e_r e_x e_s',g=[1,1,1])
(o2d,zr,zx) = Ga.build('z_r z_x',g=[1,1])
Bz = er^ex # impedance plance
Bs = es^e... |
ceos-seo/data_cube_notebooks | notebooks/training/ardc_training/Training_TaskA_Mosaics.ipynb | apache-2.0 | import datacube
import utils.data_cube_utilities.data_access_api as dc_api
from datacube.utils.aws import configure_s3_access
configure_s3_access(requester_pays=True)
api = dc_api.DataAccessApi()
dc = datacube.Datacube(app = 'ardc_task_a')
api.dc = dc
"""
Explanation: ARDC Training: Python Notebooks
Task-A: Cloud-... |
radhikapc/foundation-homework | homework12/311 time series homework.ipynb | mit | #200,000 rows giving errors, so imported only 200,00 rows :-) to solve the loading issues and memory error.
df = pd.read_csv("small-311-2015.csv")
df.head(5)
df.columns.values
dateutil.parser.parse("07/04/2015 03:33:09 AM")
df.info()
def parse_date(str_date):
return dateutil.parser.parse(str_date)
df['created_... |
Benedicto/ML-Learning | Analyzing product sentiment.ipynb | gpl-3.0 | import graphlab
"""
Explanation: Predicting sentiment from product reviews
Fire up GraphLab Create
End of explanation
"""
products = graphlab.SFrame('amazon_baby.gl/')
"""
Explanation: Read some product review data
Loading reviews for a set of baby products.
End of explanation
"""
products.head()
"""
Explanation... |
edosedgar/xs-pkg | blockchain/edgar_kaziakhmedov_HW1.ipynb | gpl-2.0 | #instructor key info
n1 = 11 * 7
e1 = 37
d1 = 13
#student key info
n2 = 13 * 19
e2 = 41
d2 = 137
grade = 5
m = pow(grade, e2, n2)
signature = pow(m, d1, n1)
print(f'message|signature: {m}|{signature}')
if (pow(m, e1, n1) != signature):
print("Failed to verify")
"""
Explanation: Introduction to blockcha... |
bioe-ml-w18/bioe-ml-winter2018 | homeworks/Week2-Statistics.ipynb | mit | # This line tells matplotlib to include plots here
% matplotlib inline
import numpy as np # We'll need numpy later
from scipy.stats import kstest, ttest_ind, ks_2samp, zscore
import matplotlib.pyplot as plt # This lets us access the pyplot functions
"""
Explanation: Week 2 - Implementation of Shaffer et al
Due January... |
termoshtt/ndarray-odeint | CLV.ipynb | mit | %matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Covariant Lyapunov Vectors
ndarray-odeint has calculator of Covariant Lyapunov Vector (CLV).
The algorithm of CLV has introduced in Ginelli et al. PRL(2007) to analyze collective motions.
End of explanation
"""
... |
Mayurji/Machine-Learning | Statistics/Pandas and ThinkStat.ipynb | gpl-3.0 | ############ First we import pandas ############
import pandas as pd
import numpy as np
import math
from collections import Counter, defaultdict
import matplotlib.pyplot as plt
import scipy.stats as stat
import random
from IPython.display import Image
%matplotlib inline
############ Declaration of Series ############... |
jehan60188/improved-octo-carnival | irisExample..ipynb | unlicense | import matplotlib.pyplot as plt
from sklearn import datasets, svm
from sklearn.decomposition import PCA
import seaborn as sns
import pandas as pd
import numpy as np
# import some data to play with
iris = datasets.load_iris()
dfX = pd.DataFrame(iris.data,columns = ['sepal_length','sepal_width','petal_length','petal_wid... |
srnas/barnaba | examples/example_06_single_strand_motif.ipynb | gpl-3.0 | import barnaba as bb
# find all GNRA tetraloops in H.Marismortui large ribosomal subunit (PDB 1S72)
query = "../test/data/GNRA.pdb"
target = "../test/data/1S72.pdb"
# call function.
results = bb.ss_motif(query,target,threshold=0.6,out='gnra_loops',bulges=1)
"""
Explanation: Search for single-stranded RNA motifs
... |
intel-analytics/analytics-zoo | docs/docs/colab-notebook/chronos/chronos_nyc_taxi_tsdataset_forecaster.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed un... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/sdk/sdk_automl_image_classification_batch.ipynb | apache-2.0 | import os
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex SDK: AutoML training image classification model for batch prediction
<table align="left"... |
endlesspint8/endlesspint8.github.io | code/spence_garcia/spence_garcia.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
%matplotlib inline
from scipy.stats import binom, poisson, zscore
"""
Explanation: Spence/Garcia, What Were the Odds of That?
post @ endlesspint.com
End of explanation
"""
np.random.seed(8)
sim_cnt_poi = 10000
spenc... |
brookthomas/GeneDive | preprocessing/AdjacencyMatrix.ipynb | mit | import sqlite3
import json
DATABASE = "data.sqlite"
conn = sqlite3.connect(DATABASE)
cursor = conn.cursor()
"""
Explanation: Build Adjacency Matrix
End of explanation
"""
# For getting the maximum row id
QUERY_MAX_ID = "SELECT id FROM interactions ORDER BY id DESC LIMIT 1"
# Get interaction data
QUERY_INTERACTION... |
WyoARCC/arcc-106-python | ARCC+Bootcamp+Machine+Learning.ipynb | mit | #NumPy is the fundamental package for scientific computing with Python
import numpy as np
# Matplotlib is a Python 2D plotting library
import matplotlib.pyplot as plt
#Number of data points
n=50
x=np.random.randn(n)
y=np.random.randn(n)
#Create a figure and a set of subplots
fig, ax = plt.subplots()
#Find best fit... |
fabm-model/code | src/models/bb/lorenz63/lorenz63.ipynb | gpl-2.0 | import numpy
import scipy.integrate
"""
Explanation: The Lorenz63 model implemented in FABM
The equations read:
$ \frac{dx}{dt} = \sigma ( y - x ) - \beta x y$
$ \frac{dy}{dt} = x ( \rho - z ) - y$
$ \frac{dz}{dt} = x y - \beta z$
For further information see
Import standard python packages and pyfabm
End of explanatio... |
queirozfcom/python-sandbox | python3/notebooks/boosting/effect-of-categories-credit-default.ipynb | mit | def fix_status(current_value):
if current_value == -2: return 'no_consumption'
elif current_value == -1: return 'paid_full'
elif current_value == 0: return 'revolving'
elif current_value in [1,2]: return 'delay_2_mths'
elif current_value in [3,4,5,6,7,8,9]: return 'delay_3+_mths'
else: return 'o... |
lwahedi/CurrentPresentation | talks/MDI5/Scraping+Lecture.ipynb | mit | import pandas as pd
import numpy as np
import pickle
import statsmodels.api as sm
from sklearn import cluster
import matplotlib.pyplot as plt
%matplotlib inline
from bs4 import BeautifulSoup as bs
import requests
import time
# from ggplot import *
"""
Explanation: Collecting and Using Data in Python
Laila A. Wahedi, P... |
miklevin/pipulate | examples/LESSON11_Formatting.ipynb | mit | '{}'.format(1) # String formatting is actually the best way to FORMAT NUMBERS.
'{0}'.format(1) # I'm putting the optional index placholder in so that it's clearer as we build up the API.
'{0:}'.format(1) # After the placeholder, you can put an optional colon for a format_spec
'{:}'.format(1) # Because the number... |
streety/biof509 | Wk06-classification-and-clustering.ipynb | mit | digits = datasets.load_digits()
# X - how digits are handwritten
X = digits['data']
# y - what these digits actually are
y = digits['target']
print("Digits are classes:", set(y))
print("For instance this 64 pixel image is assigned class label", y[3])
plt.imshow(X[3].reshape((8,8)), cmap=plt.cm.gray)
plt.show()
"""... |
daniel-koehn/Theory-of-seismic-waves-II | 01_Analytical_solutions/5_Greens_function_acoustic_1-3D.ipynb | gpl-3.0 | # Execute this cell to load the notebook's style sheet, then ignore it
from IPython.core.display import HTML
css_file = '../style/custom.css'
HTML(open(css_file, "r").read())
"""
Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 parts of this notebook are... |
GoogleCloudPlatform/analytics-componentized-patterns | retail/recommendation-system/bqml-scann/01_train_bqml_mf_pmi.ipynb | apache-2.0 | from google.cloud import bigquery
from datetime import datetime
import matplotlib.pyplot as plt, seaborn as sns
"""
Explanation: Part 1: Learn item embeddings based on song co-occurrence
This notebook is the first of five notebooks that guide you through running the Real-time Item-to-item Recommendation with BigQuery ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/e47923b6fb0438d171cc375f56ae6765/plot_time_frequency_simulated.ipynb | bsd-3-clause | # Authors: Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Chris Holdgraf <choldgraf@berkeley.edu>
#
# License: BSD (3-clause)
import numpy as np
from matplotlib import pyplot as plt
from mne import create_info, EpochsArray
from mne.baseline import rescale
fro... |
skdaccess/skdaccess | skdaccess/examples/Demo_UAVSAR.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.dpi'] = 150
from skimage.measure import block_reduce
import numpy as np
"""
Explanation: The MIT License (MIT)<br>
Copyright (c) 2017 Massachusetts Institute of Technology<br>
Author: Cody Rude<br>
This software has been created in projects suppo... |
BrainIntensive/OnlineBrainIntensive | resources/nipype/nipype_tutorial/notebooks/basic_iteration.ipynb | mit | from nipype import Node, Workflow
from nipype.interfaces.fsl import BET, IsotropicSmooth
# Initiate a skull stripping Node with BET
skullstrip = Node(BET(mask=True,
in_file='/data/ds102/sub-01/anat/sub-01_T1w.nii.gz'),
name="skullstrip")
"""
Explanation: <img src="../static/ima... |
CELMA-project/CELMA | derivations/divOfExBOperator/divOfVectorAdvectionWithN.ipynb | lgpl-3.0 | from IPython.display import display
from sympy import symbols, simplify, sympify, expand
from sympy import init_printing
from sympy import Eq, Function
from clebschVector import ClebschVec
from clebschVector import div, grad, gradPerp, advVec
from common import rho, theta, poisson
from common import displayVec
init_pr... |
DawesLab/LabNotebooks | Double Slit Model.ipynb | mit | import matplotlib.pyplot as plt
from numpy import pi, sin, cos, linspace, exp, real, imag, abs, conj, meshgrid, log, log10, angle
from numpy.fft import fft, fftshift, ifft
from mpl_toolkits.mplot3d import axes3d
import BeamOptics as bopt
%matplotlib inline
b=.08*1e-3 # the slit width
a=.5*1e-3 # the slit spacing
k... |
paulvangentcom/heartrate_analysis_python | examples/2_regular_ECG/Analysing_a_regular_ECG_signal.ipynb | mit | #import packages
import heartpy as hp
import matplotlib.pyplot as plt
sample_rate = 250
"""
Explanation: Analysing a regular ECG signal
In this notebook I'll show you three examples of using HeartPy to analyse good-to-reasonable quality ECG signals you may encounter.
We'll be looking at three excerpts from the Europe... |
nproctor/phys202-2015-work | assignments/assignment10/ODEsEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed
import math
"""
Explanation: Ordinary Differential Equations Exercise 1
Imports
End of explanation
"""
def solve_euler(derivs, y0, x):
""... |
as595/AllOfYourBases | TIARA/RadioImaging/FourierCat.ipynb | gpl-3.0 | %matplotlib inline
"""
Explanation: FourierCats.ipynb
‹ FourierCats.ipynb › Copyright (C) ‹ 2017 › ‹ Anna Scaife - anna.scaife@manchester.ac.uk ›
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, eith... |
variani/study | 02-intro-python/projects/pandas/babynames.ipynb | cc0-1.0 | %qtconsole
%matplotlib inline
"""
Explanation: About
R data-munging idioms and their equvalents in pandas/python:
Subset with multiple-choise %in%:
R: `subset(df, name %in% c("Andrew", "Andre"))
python: df.query('name in ["Andrew", "Andre"]') via link
Set up
End of explanation
"""
import numpy as np
import matp... |
mne-tools/mne-tools.github.io | 0.18/_downloads/5834d0f519577e60275c6ef3c9fb0dbc/plot_read_inverse.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator
print(__doc__)
data_path = sample.data_path()
fname = data_path
fname += '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif'
inv = read_... |
karthikrangarajan/intro-to-sklearn | 03.Feature Engineering.ipynb | bsd-3-clause | # PCA for dimensionality reduction
from sklearn import decomposition
from sklearn import datasets
iris = datasets.load_iris()
X, y = iris.data, iris.target
# perform principal component analysis
pca = decomposition.PCA(.95)
pca.fit(X)
X_t = pca.transform(X)
(X_t[:, 0])
# import numpy and matplotlib for plotting (a... |
rsterbentz/phys202-2015-work | assignments/assignment03/NumpyEx04.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 4
Imports
End of explanation
"""
import networkx as nx
K_5=nx.complete_graph(5)
nx.draw(K_5)
"""
Explanation: Complete graph Laplacian
In discrete mathematics a Graph is a set of vertices or n... |
newworldnewlife/TensorFlow-Tutorials | 03C_Keras_API.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import math
"""
Explanation: TensorFlow Tutorial #03-C
Keras API
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
Tutorial #02 showed how to implement a Convolutional Neural Network in TensorFlow. We ma... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage3/get_started_with_automl_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 = ... |
cathywu/flow | tutorials/tutorial01_sumo.ipynb | mit | from flow.scenarios.loop import LoopScenario
"""
Explanation: Tutorial 01: Running Sumo Simulations
This tutorial walks through the process of running non-RL traffic simulations in Flow. Simulations of this form act as non-autonomous baselines and depict the behavior of human dynamics on a network. Similar simulations... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/09_sequence/poetry.ipynb | apache-2.0 | %%bash
pip freeze | grep tensor
%%bash
pip install tensor2tensor==1.13.1 tensorflow==1.13.1 tensorflow-serving-api==1.13 gutenberg
pip install tensorflow_hub
# install from sou
#git clone https://github.com/tensorflow/tensor2tensor.git
#cd tensor2tensor
#yes | pip install --user -e .
"""
Explanation: Text generati... |
fonnesbeck/PyMC3_Oslo | notebooks/1. Introduction to PyMC3.ipynb | cc0-1.0 | %load ../data/melanoma_data.py
%matplotlib inline
import seaborn as sns; sns.set_context('notebook')
from pymc3 import Normal, Model, DensityDist, sample, log, exp
with Model() as melanoma_survival:
# Convert censoring indicators to indicators for failure event
failure = (censored==0).astype(int)
# Para... |
texib/deeplearning_homework | tensorflow-lite/export_model.ipynb | mit | from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
from keras import backend as K
import tensorflow as tf
from tensorflow.python.tools import freeze_graph, optimize_for_inference_lib
import numpy as np
"""
Explanation: 以下為 Export 成 freeze_gra... |
OSGeoLabBp/tutorials | english/data_processing/lessons/img_def.ipynb | cc0-1.0 | import glob # to extend file name pattern to list
import cv2 # OpenCV for image processing
from cv2 import aruco # to find ArUco markers
import numpy as np # for matrices
import matplotlib.pyplot as plt # to show images
"""
Explanation... |
relopezbriega/mi-python-blog | content/notebooks/MachineLearningPractica2.ipynb | gpl-2.0 | # <!-- collapse=True -->
# Importando las librerías que vamos a utilizar
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cross_validation import train_test_split
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_classif... |
trangel/Insight-Data-Science | analysis-data/Length-forum-posts.ipynb | gpl-3.0 |
# Set up paths/ os
import os
import sys
this_path=os.getcwd()
os.chdir("../data")
sys.path.insert(0, this_path)
# Load datasets
import pandas as pd
df = pd.read_csv("MedHelp-posts.csv",index_col=0)
df.head(2)
df_users = pd.read_csv("MedHelp-users.csv",index_col=0)
df_users.head(2)
# 1 classify users as professi... |
NervanaSystems/neon_course | 02 VGG Fine-tuning.ipynb | apache-2.0 | from neon.backends import gen_backend
be = gen_backend(batch_size=64, backend='cpu')
"""
Explanation: Tutorial: Fine-tuning VGG on CIFAR-10
One of the most common questions we get is how to use neon to load a pre-trained model and fine-tune on a new dataset. In this tutorial, we show how to load a pre-trained convolu... |
SJSlavin/phys202-2015-work | assignments/assignment06/InteractEx05.ipynb | mit | # YOUR CODE HERE
import matplotlib as plt
import numpy as np
import IPython as ipy
from IPython.display import SVG
from IPython.html.widgets import interactive, fixed
from IPython.html import widgets
from IPython.display import display
"""
Explanation: Interact Exercise 5
Imports
Put the standard imports for Matplotl... |
tensorflow/docs-l10n | site/es-419/guide/keras/functional.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... |
rasbt/biopandas | docs/tutorials/Working_with_MOL2_Structures_in_DataFrames.ipynb | bsd-3-clause | %load_ext watermark
%watermark -d -u -p pandas,biopandas
from biopandas.mol2 import PandasMol2
import pandas as pd
pd.set_option('display.width', 600)
pd.set_option('display.max_columns', 8)
"""
Explanation: BioPandas
Author: Sebastian Raschka mail@sebastia&... |
IS-ENES-Data/submission_forms | test/forms/CORDEX/CORDEX_ki_1234.ipynb | apache-2.0 | from dkrz_forms import form_widgets
form_widgets.show_status('form-submission')
"""
Explanation: CORDEX ESGF submission form
General Information
Data to be submitted for ESGF data publication must follow the rules outlined in the Cordex Archive Design Document <br /> (https://verc.enes.org/data/projects/documents/c... |
ampl/amplpy | notebooks/efficient_frontier.ipynb | bsd-3-clause | from google.colab import auth
auth.authenticate_user()
!pip install -q amplpy ampltools gspread --upgrade
"""
Explanation: Install needed modules and authenticate user to use google sheets
End of explanation
"""
MODULES=['ampl', 'cplex']
from ampltools import cloud_platform_name, ampl_notebook
from amplpy import AM... |
hhain/sdap17 | notebooks/robin_ue2/mustererkennung_in_funkmessdaten.ipynb | mit | # imports
import re
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pprint as pp
"""
Explanation: Mustererkennung in Funkmessdaten
Aufgabe 1: Laden der Datenbank in Jupyter Notebook
End of explanation
"""
hdf = pd.HDFStore('../../data/raw/TestMessungen_NEU.hdf')
pr... |
ES-DOC/esdoc-jupyterhub | notebooks/cams/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', 'cams', 'sandbox-2', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: CAMS
Source ID: SANDBOX-2
Topic: Atmoschem
Sub-Topics: Transport, Emissions ... |
jArumugam/python-notes | P10Decorators.ipynb | mit | def func():
return 1
func()
"""
Explanation: Decorators
Decorators can be thought of as functions which modify the functionality of another function. They help to make your code shorter and more "Pythonic".
To properly explain decorators we will slowly build up from functions. Make sure to restart the Python and... |
eshlykov/mipt-day-after-day | statistics/python/python_2.ipynb | unlicense | (1, 2, 3)
()
(1,)
"""
Explanation: Кафедра дискретной математики МФТИ
Курс математической статистики
Никита Волков
На основе http://www.inp.nsk.su/~grozin/python/
Кортежи
Кортежи (tuples) очень похожи на списки, но являются неизменяемыми. Как мы видели, использование изменяемых объектов может приводить к неприятным ... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/cnrm-cm6-1-hr/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'cnrm-cm6-1-hr', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: CNRM-CM6-1-HR
Topic: Seaice
Sub-Topics: Dynami... |
tensorflow/docs-l10n | site/en-snapshot/probability/examples/Gaussian_Process_Latent_Variable_Model.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... |
geektoni/shogun | doc/ipython-notebooks/ica/bss_audio.ipynb | bsd-3-clause | import numpy as np
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
from scipy.io import wavfile
from scipy.signal import resample
import shogun as sg
def load_wav(filename,samplerate=44100):
# load file
rate, data = wavfile.read(filename)
# convert stereo to mono
if len(da... |
johanvdw/niche_vlaanderen | docs/flooding.ipynb | mit | import niche_vlaanderen as nv
%matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: Flooding module
Niche Vlaanderen also contains a module to model the influence of flooding more precisely. This is done using the Flooding class.
The first step is importing the niche_vlaanderen module. For convenience, ... |
astroumd/GradMap | notebooks/Lectures2018/Lecture3/Lecture3_Gaussians-Answer Key.ipynb | gpl-3.0 | lifemean = np.mean(lifetimes) #get mean
lifestd = np.std(lifetimes) #get standard deviation
"""
Explanation: Gaussians
You just learned a little about what a Gaussian distribution looks like. As a reminder, a Gaussian curve is sometimes called a bell curve because the shape looks like a bell.
To review, the equation f... |
PiercingDan/mat245 | Labs/Lab9/MAT245 Lab 9.ipynb | mit | from sklearn import datasets
bc = datasets.load_breast_cancer()
samples, targets = bc.data, bc.target
"""
Explanation: MAT245 Lab 9
Classifcation using Logistic Regression
Background
In a binary classification problem we have samples of data $x \in \mathbb{R}^n$, and we want to predict the value of a target variable ... |
xtr33me/deep-learning | 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... |
LaubachLab/Spikes-and-Fields | Save your workspace.ipynb | gpl-3.0 | import dill
import numpy as np
from scipy.io import loadmat, savemat
import h5py
import hdf5storage
"""
Explanation: Save your workspace in Python
A major issue for me coming to Python from Matlab was how to save my workspaces. This is especially crucial when finalizing results in support of a manuscript. It is painfu... |
bismayan/MaterialsMachineLearning | notebooks/old_ICSD_Notebooks/Understanding ICSD data.ipynb | mit | # How many ternaries have been assigned a structure type?
structure_types = [line[3] for line in data if line[3] is not '']
unique_structure_types = set(structure_types)
print("There are {} ICSD ternaries entries.".format(len(data)))
print("Structure types are assigned for {} entries.".format(len(structure_types)))
pri... |
dacr26/CompPhys | 01_01_euler.ipynb | mit | T0 = 10. # initial temperature
Ts = 83. # temp. of the environment
r = 0.1 # cooling rate
dt = 0.05 # time step
tmax = 60. # maximum time
nsteps = int(tmax/dt) # number of steps
T = T0
for i in range(1,nsteps+1):
new_T = T - r*(T-Ts)*dt
T = new_T
print i,i*dt, T
# we can also do t = t - r*(t-t... |
dwhswenson/openpathsampling | examples/misc/alanine_dipeptide_committor/4_analysis_help.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import openpathsampling as paths
import numpy as np
import pandas as pd
pd.options.display.max_rows = 10
storage = paths.Storage("committor_results.nc", "r")
phi = storage.cvs['phi']
psi = storage.cvs['psi']
%%time
C_7eq = storage.volumes['C_7eq']
alpha_R = storage.... |
sbenthall/bigbang | examples/experimental_notebooks/Walkers and Talkers.ipynb | agpl-3.0 | # Load the raw email and git data
url = "http://mail.python.org/pipermail/scipy-dev/"
arx = Archive(url,archive_dir="../archives")
mailInfo = arx.data
repo = repo_loader.get_repo("bigbang")
gitInfo = repo.commit_data;
"""
Explanation: Introduction
In group efforts, there is sometimes the impression that there are thos... |
kjschiroo/mlip | Machine_Learning_in_Python.ipynb | mit | from sklearn.datasets import load_digits
data_set = load_digits()
"""
Explanation: Machine learning in Python
The data set
End of explanation
"""
data_set.keys()
data_set.data
"""
Explanation: Let's poke around and see what is in the data set.
End of explanation
"""
%matplotlib inline
import matplotlib.pyplot as... |
FractalFlows/DAOResearch | notebooks/LS-LMSR.ipynb | mit | result1_task1 = {
'description': 'Attempt to reproduce the result 1 of this article',
'doi': '10.1051/itmconf/20140201004',
'reference': 'result 1, p. 4',
'type': 'scientific task',
'possible_outcomes': [
'the result is reproducible',
'the result is not reproducible'
]
}
"""... |
phoebe-project/phoebe2-docs | development/tutorials/21_22_pblum_mode.ipynb | gpl-3.0 | import phoebe
b = phoebe.default_binary()
b.add_dataset('lc', dataset='lc01')
print(b.filter(qualifier='pblum*', dataset='lc01'))
print(b.get_parameter('pblum_mode'))
"""
Explanation: 2.1 - 2.2 Migration: pblum_mode and pblum vs pblum_ext
PHOEBE 2.2 introduces new modes for handling the scaling between absolute and r... |
ktmud/deep-learning | sentiment-network/Sentiment_Classification_Projects.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
yaoxx151/UCSB_Boot_Camp_copy | Day01_ComputerBasics/notebooks/03 - Version Control.ipynb | cc0-1.0 | from IPython.display import Image
Image(url='http://www.phdcomics.com/comics/archive/phd101212s.gif')
"""
Explanation: Why Version Control?
Here's why.
End of explanation
"""
%%bash
git status
"""
Explanation: If that hasn't convinced you, here are some other benefits:
http://stackoverflow.com/questions/1408450/why... |
dataworkshop/webinar-jupyter | pandas.ipynb | mit | sq = pd.Series({'row1': 'row1 col a', 'row 2': 'row2 col a'})
sq
sq.index
df = pd.DataFrame(
{
'column_a': {'row1': 'row1 col a', 'row 2': 'row2 col a'},
'column_b': {'row1': 'row1 col b', 'row 2': 'row2 col b'},
})
df
df.index
df.columns
df.columns = ['new_column_a', 'new_column_b']
df
print(... |
joseerlang/PySpark_docker | notebook/Trabajando con Spark SQL y dataframes.ipynb | apache-2.0 | from pyspark.sql import SparkSession
spark= SparkSession.builder.appName("Trabajando con Spark SQL").getOrCreate()
"""
Explanation: Punto de entrada
Vamos a crear un punto de entrada al API de dataframes y dataset.
End of explanation
"""
import json
with open('sql/PeriodicTableJSON.json') as data_file:
dat... |
xdnian/pyml | code/bonus/scikit-model-to-json.ipynb | mit | %load_ext watermark
%watermark -a '' -v -d -p scikit-learn,numpy,scipy
# to install watermark just uncomment the following line:
#%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
"""
Explanation: Sebastian Raschka, 2016
https://github.com/1iyiwei/pyml
Note that the optional watermark... |
Luke035/dlnd-lessons | into-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... |
taiducvu/NudityDetection | VNG_MODEL_EXPERIMENT.ipynb | apache-2.0 | %matplotlib inline
import glob
import os
import numpy as np
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
import tensorflow as tf
raw_image = imread('model/datasets/nudity_dataset/3.jpg')
# Define a tensor placeholder to store an image
image = tf.placeholder("uint8", [None, None, 3])
image1 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.