repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
GoogleCloudPlatform/professional-services | examples/vertex_pipeline/notebook/training_pipeline_development.ipynb | apache-2.0 | !python3 -c "import kfp; print('KFP SDK version: {}'.format(kfp.__version__))"
import os
import json
from functools import partial
import kfp
import pprint
import yaml
from jinja2 import Template
from kfp.v2 import dsl
from kfp.v2.compiler import compiler
from kfp.v2.dsl import Dataset
from kfp.v2.google.client impor... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/introduction_to_tensorflow/labs/write_low_level_code.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Ensure the right version of Tensorflow is installed.
!pip freeze | grep tensorflow==2.1 || pip install tensorflow==2.1
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
print(tf.__version__)
"""
Explanation: Writing L... |
IsacLira/data-science-cookbook | 2016/network-analysis/(Response) Centrality.ipynb | mit | import network_analysis_utils as nau
import networkx as nx
# Available functions:
#
# - nau.facebook_nx_graph(): Obtém o grafo Networkx do facebook
#
# - nau.random_nx_graph(): Obtém o grafo Networkx randômico
#
# - nau.write_btwns_graph(nx_graph, weight_dict, output_filename):
# Plota o grafo em um arqui... |
donK23/pyData-Projects | EventDec/event_dec/notebook/2_Modeling.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Modeling
ML Tasks
End of explanation
"""
file_path = "../data/df_model01.pkl"
df = pd.read_pickle(file_path)
print(df.shape)
df.head()
"""
Explanation: Input
End of explanation
"""
bins = [10, 40, 120, 180... |
lileiting/goatools | notebooks/relatonships_in_the_go.ipynb | bsd-2-clause | from goatools.obo_parser import GODag
import wget
go_fn = wget.download('http://geneontology.org/ontology/go.obo')
go = GODag(go_fn, optional_attrs=['relationship'])
"""
Explanation: Relationships in the GO
Alex Warwick Vesztrocy, March 2016
For some analyses, it is possible to only use the <code>is_a</code> definiti... |
hmenke/pairinteraction | doc/sphinx/examples_python/vdw_near_surface.ipynb | gpl-3.0 | %matplotlib inline
# Arrays
import numpy as np
# Plotting
import matplotlib.pyplot as plt
# Operating system interfaces
import os
# pairinteraction :-)
from pairinteraction import pireal as pi
# Create cache for matrix elements
if not os.path.exists("./cache"):
os.makedirs("./cache")
cache = pi.MatrixElementCa... |
tensorflow/docs-l10n | site/ko/addons/tutorials/layers_weightnormalization.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0
# 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 the License is d... |
EnergyID/opengrid | scripts/DemoTmpo.ipynb | gpl-2.0 | import sys
import os
import inspect
# add the path to opengrid to sys.path
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
sys.path.append(os.path.join(script_dir, os.pardir, os.pardir))
from opengrid.library import houseprint
from opengrid.library import config
c=config.Config()
... |
Xilinx/BNN-PYNQ | notebooks/CNV-BNN_SVHN.ipynb | bsd-3-clause | import bnn
print(bnn.available_params(bnn.NETWORK_CNVW1A1))
classifier = bnn.CnvClassifier(bnn.NETWORK_CNVW1A1,"streetview",bnn.RUNTIME_HW)
"""
Explanation: BNN on Pynq
This notebook covers how to use Binary Neural Networks on Pynq.
It shows an example of image recognition with a Binarized Neural Network inspired at... |
matousc89/python-web-tutorials | Making_HTTP_requests.ipynb | mit | from urllib.request import urlopen
r = urlopen('http://www.python.org/')
data = r.read()
print("Status code:", r.getcode())
"""
Explanation: HTTP requests
In this tutorial ti is covered how to make requests via HTTP protocol.
For more informations about related stuff see:
* <a href="https://en.wikipedia.org/wiki/Hy... |
ES-DOC/esdoc-jupyterhub | notebooks/niwa/cmip6/models/sandbox-3/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'niwa', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: NIWA
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
DB2-Samples/db2jupyter | v1/Db2 11 JSON Features.ipynb | apache-2.0 | %run db2.ipynb
"""
Explanation: <a id="top"></a>
Db2 11 JSON Features
There are a number of routines are that are built-in to Db2 that are used to manipulate JSON
documents. These routines are not externalized in the documentation because they were originally used by the
internal API's of Db2 for managing the MongoDB... |
c4goldsw/shogun | doc/ipython-notebooks/classification/HashedDocDotFeatures.ipynb | gpl-3.0 | %matplotlib inline
from modshogun import StringCharFeatures, RAWBYTE, HashedDocDotFeatures, NGramTokenizer
"""
Explanation: Large scale document classification with the Shogun Machine Learning Toolbox
By Evangelos Anagnostopoulos (GitHub ID: <a href="http://github.com/van51">van51</a>)
This notebook is about <a href="... |
saullocastro/pyNastran | docs/quick_start/demo/op4_demo.ipynb | lgpl-3.0 | import os
from pyNastran.utils import print_bad_path
from pyNastran.op4.op4 import read_op4
import numpy as np
from numpy import float32, float64, int32, int64, product
# decrease output precision
np.set_printoptions(precision=3, threshold=20)
"""
Explanation: OP4 Demo
The iPython notebook for this demo can be found ... |
napjon/ds-nd | p6-datviz/analysis.ipynb | mit | import pandas as pd
df = pd.read_csv('data/airline_delay_causes_2015.csv')
df.head()
df.columns = df.columns.str.strip()
"""
Explanation: Summary
End of explanation
"""
df['month'] = df['month'].map(lambda x: '0' + str(x) if len(str(x)) < 2 else x)
df.month.unique()
"""
Explanation: Since month in dimple only exc... |
GraysonR/titanic-data-analysis | Titanic Survivor Analysis.ipynb | mit | %matplotlib inline
# Import magic
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
#Set general plot properties
sns.set_style("white")
# Load CSV data
titanic_data = pd.read_csv('titanic_data.csv')
"""
Explanation: Titanic Survivor Analysis
Grayson Ric... |
UWPreMAP/PreMAP2015 | extras/python1_solutions.ipynb | mit | import numpy as np
# This is how we'll access astropy's units module:
import astropy.units as u
# astropy stores fundamental physical constants like
# the mass of the sun M_sun
from astropy.constants import M_sun
masses = u.Quantity([4.31e6*M_sun, 1*M_sun, 1.4*M_sun])
masses
"""
Explanation: Python 1 solutions wi... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/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', 'mpi-m', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: MPI-M
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Propertie... |
ClaudiaEsp/inet | Analysis/misc/Slicing matrices.ipynb | gpl-2.0 | import numpy as np
from inet import utils
nPV = 2
matrix = np.loadtxt('../data/2_170411_01.syn', dtype=int)# load an example matrix
ncells = matrix.shape[0]
matrix
"""
Explanation: <H1>Slicing matrices</H1>
End of explanation
"""
matrix[:2][:,(0,1)] # II = matrix[ :nPV][ :,range(nPV)]
utils.II_slice(matrix,2)
""... |
manoharan-lab/structural-color | montecarlo_tutorial.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import structcol as sc
import structcol.refractive_index as ri
from structcol import montecarlo as mc
from structcol import detector as det
from structcol import model
# For Jupyter notebooks only:
%matplotlib inline
"""
Explanation: Tutorial for the montecarlo modul... |
Ccaccia73/semimonocoque | 04_CorrectiveSolutions.ipynb | mit | from pint import UnitRegistry
import sympy
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import sys
%matplotlib inline
from IPython.display import display
"""
Explanation: Semi-Monocoque Theory: corrective solutions
End of explanation
"""
from Section import Section
"""
Explanation: Impor... |
2015fallhw/user9999 | content/notebook/JSInteraction.ipynb | agpl-3.0 | from IPython.display import HTML
input_form = """
<div style="background-color:gainsboro; border:solid black; width:300px; padding:20px;">
Variable Name: <input type="text" id="var_name" value="foo"><br>
Variable Value: <input type="text" id="var_value" value="bar"><br>
<button onclick="set_value()">Set Value</button>... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/Transducers.ipynb | gpl-3.0 | import vcsn
ctx = vcsn.context("lat<lal_char(abc), lal_char(abc)>, b")
ctx
"""
Explanation: Transducers
Transducers, also called k-tape automata, are finite state machines where transitions are labeled on several tapes. The labelset of a transducer is a cartesian product of the labelsets of each tape: $L = L_1 \times ... |
marcinofulus/ProgramowanieRownolegle | CUDA/iCSE_PR_map2d.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
print("Ok")
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
mod = SourceModule("""
__global__ void sin1d(float *x,float *y)
... |
deercoder/0-PhD | TensorFlow/ex1/ex1.ipynb | mit | # basic imported headers
import tensorflow as tf
Second, learn how to fetch the data from the result
input1 = tf.constant(3.0)
input2 = tf.constant(2.0)
input3 = tf.constant(5.0)
intermd = tf.add(input1, input2)
mult = tf.multiply(input3, intermd)
with tf.Session() as sess:
result = sess.run([mult, intermd... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Winter2017_Homework2_Complete.ipynb | mit | # Question 1
T = 20
w = np.zeros(T)
w[0] = 1
def firstDiff(mu,rho,w,y0,T):
y = np.zeros(T+1)
y[0] = y0
for t in range(T):
y[t+1] = (1-rho)*mu + rho*y[t] + w[t]
return y
y1 = firstDiff(mu=0,rho=0.99,w=w,y0=0,T=T)
y2 = firstDiff(mu=0,rho=1,w=w,y0=0,T=T)
y3 = firstDiff(mu=0,rho=1.01,w=... |
tensorflow/docs-l10n | site/ko/guide/keras/save_and_serialize.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... |
spulido99/Programacion | Alex/Taller 2 - Archivos y Bases de Datos.ipynb | mit | import mysql.connector
"""
Explanation: Archivos y Bases de datos
End of explanation
"""
import pandas as pd
df= pd.read_csv('C:/Users/Alex/Documents/eafit/semestres/X semestre/programacion/taller2.tsv', sep = '\t')
df[:1]
"""
Explanation: La idea de este taller es manipular archivos (leerlos, parsearlos y escribi... |
mne-tools/mne-tools.github.io | 0.21/_downloads/d9e2f27df3a137317d331d3be6f3814d/plot_dics_source_power.ipynb | bsd-3-clause | # Author: Marijn van Vliet <w.m.vanvliet@gmail.com>
# Roman Goj <roman.goj@gmail.com>
# Denis Engemann <denis.engemann@gmail.com>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import mne
from mne.datasets import somato
from... |
ocelot-collab/ocelot | demos/ipython_tutorials/pfs_1_synchrotron_radiation.ipynb | gpl-3.0 | # To activate interactive matplolib in notebook
#%matplotlib notebook
# import main functions from Synchrotron Radation (SR) module
from ocelot.rad import *
# import OCELOT main functions
from ocelot import *
# import OCELOT plotting functions
from ocelot.gui import *
import time
"""
Explanation: This notebook was... |
lilleswing/deepchem | examples/tutorials/07_Going_Deeper_on_Molecular_Featurizations.ipynb | mit | !curl -Lo conda_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import conda_installer
conda_installer.install()
!/root/miniconda/bin/conda info -e
!pip install --pre deepchem
import deepchem
deepchem.__version__
"""
Explanation: Tutorial Part 7: Going Deeper On Molecu... |
andre-martini/advanced-comp-2017 | 02-trees/exercise.ipynb | gpl-3.0 | %config InlineBackend.figure_format='retina'
%matplotlib inline
import numpy as np
np.random.seed(123)
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (8, 8)
plt.rcParams["font.size"] = 14
from sklearn.utils import check_random_state
"""
Explanation: Exercise 2
Work on this before the next lecture on... |
ucsd-ccbb/jupyter-genomics | notebooks/annotation/PP2P_gene_ontology/PP2p.ipynb | mit | !gfortran -ffree-line-length-none PP2p_branch_conditional_exact_pvalues.f90
!ls
"""
Explanation: PP2P protocol
By Roman Sasik (rsasik@ucsd.edu)
This Notebook describes the steps used in Gene Ontology analysis, which produces both conditional and unconditional posterior probabilities that a GO term is differentially ... |
mne-tools/mne-tools.github.io | 0.18/_downloads/b1d326a4c3ddbdebaed097d34d4362a6/plot_dipole_orientations.ipynb | bsd-3-clause | from mayavi import mlab
import mne
from mne.datasets import sample
from mne.minimum_norm import make_inverse_operator, apply_inverse
data_path = sample.data_path()
evokeds = mne.read_evokeds(data_path + '/MEG/sample/sample_audvis-ave.fif')
left_auditory = evokeds[0].apply_baseline()
fwd = mne.read_forward_solution(
... |
lithiumdenis/MLSchool | 3. Котики и собачки (исходные данные).ipynb | mit | visual = pd.read_csv('data/CatsAndDogs/train.csv')
#Сделаем числовой столбец Outcome, показывающий, взяли животное из приюта или нет
#Сначала заполним единицами, типа во всех случах хорошо
visual['Outcome'] = 'true'
#Неудачные случаи занулим
visual.loc[visual.OutcomeType == 'Euthanasia', 'Outcome'] = 'false'
visual.lo... |
lguduy/Data-Structure-and-Algorithms-in-Python | Note/第一章. 绪论.ipynb | mit | range(5)
list(range(5))
"""
Explanation: 绪论
数据结构
End of explanation
"""
a = 1
print 'id(a):{}'.format(id(a)) # Python标准函数取得对象的标示
def b():
print "Hello, world"
print 'id(b):{}'.format(id(b))
# 赋值
a = 1 # 基本数据类型(不可变对象)
b = a
print id(a), id(b)
a = 2
print a, b
print id(a), id(b)
a = [1, 2, 3] # list是可变对象... |
fastai/course-v3 | nbs/dl2/10b_mixup_label_smoothing.ipynb | apache-2.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
#export
from exp.nb_10 import *
path = datasets.untar_data(datasets.URLs.IMAGENETTE_160)
tfms = [make_rgb, ResizeFixed(128), to_byte_tensor, to_float_tensor]
bs = 64
il = ImageList.from_files(path, tfms=tfms)
sd = SplitData.split_by_func(il, partial(grandparent... |
prashantas/MyDataScience | DeepNetwork/Keras/BankChurn.ipynb | bsd-2-clause | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Churn_Modelling.csv')
dataset.head()
"""
Explanation: https://medium.com/@pushkarmandot/build-your-first-deep-learning-neural-network-model-using-keras-in-python-a90b5864116d
Data and Business Problem:
Our basic aim is to ... |
Hvass-Labs/TensorFlow-Tutorials | 19_Hyper-Parameters.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import math
"""
Explanation: TensorFlow Tutorial #19
Hyper-Parameter Optimization
by Magnus Erik Hvass Pedersen
/ GitHub / Videos on YouTube
Introduction
There are many parameters you can select when building and training a N... |
BrownDwarf/ApJdataFrames | notebooks/Malo2014.ipynb | mit | import warnings
warnings.filterwarnings("ignore")
from astropy.io import ascii
import pandas as pd
"""
Explanation: ApJdataFrames Malo et al. 2014
Title: BANYAN. III. Radial velocity, Rotation and X-ray emission of low-mass star candidates in nearby young kinematic groups
Authors: Malo L., Artigau E., Doyon R., Lafr... |
tensorflow/federated | docs/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 ... |
rafaharo/trolling_detection | trolling_detection.ipynb | apache-2.0 | # Global Imports
import numpy as np
from sklearn import metrics
import pandas as pd
import os
import matplotlib.pyplot as plt
# Helpers
TRAIN_FILE = "resources/train/train.csv"
TEST_FILE = "resources/test/test_with_solutions.csv"
BAD_WORDS_FILE = "resources/badwords.txt"
NO_INSULT = 'NoInsult'
INSULT = 'Insult'
# Com... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_artifacts_detection.ipynb | bsd-3-clause | import mne
from mne.datasets import sample
from mne.preprocessing import create_ecg_epochs, create_eog_epochs
# getting some data ready
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(raw_fname, preload=True)
"""
Explanation: Introduction to artifa... |
peterwittek/ipython-notebooks | Citation_Network_SDP.ipynb | gpl-3.0 | import metaknowledge as mk
import ncpol2sdpa as nc
import numpy as np
import re
"""
Explanation: This notebook gives the computational details of the results in the manuscript "Ruling Out Static Latent Homophily in Citation Networks" (arXiv:1605.08185). We are interested in studying causal structures in citation netwo... |
madlib/madlib-examples | Path-demo-4.ipynb | apache-2.0 | %load_ext sql
# %sql postgresql://gpdbchina@10.194.10.68:55000/madlib
%sql postgresql://fmcquillan@localhost:5432/madlib
%sql select madlib.version();
"""
Explanation: Path function
The goal of the MADlib path function is to perform regular pattern matching over a sequence of rows, and to extract useful information ... |
ucsd-ccbb/jupyter-genomics | notebooks/crispr/Dual CRISPR 4-Count Combination.ipynb | mit | g_timestamp = ""
g_dataset_name = "20160510_A549"
g_count_alg_name = "19mer_1mm_py"
g_fastq_counts_dir = '/Users/Birmingham/Repositories/ccbb_tickets/20160210_mali_crispr/data/interim/20160510_D00611_0278_BHK55CBCXX_A549'
g_fastq_counts_run_prefix = "19mer_1mm_py_20160615223822"
g_collapsed_counts_dir = "/Users/Birming... |
probprog/pyprob | examples/gaussian_unknown_mean.ipynb | bsd-2-clause | class GaussianUnknownMean(Model):
def __init__(self):
super().__init__(name='Gaussian with unknown mean') # give the model a name
self.prior_mean = 1
self.prior_std = math.sqrt(5)
self.likelihood_std = math.sqrt(2)
def forward(self): # Needed to specifcy how the generative model... |
jonathanmorgan/msu_phd_work | data/article_loading/proquest_hnp/BostonGlobe/proquest_hnp-article_loading-BostonGlobe.ipynb | lgpl-3.0 | debug_flag = False
"""
Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Introduction" data-toc-modified-id="Introduction-1"><span class="toc-item-num">1 </span>Introduction</a></span></li><li><span><a href="#Setup" data-toc-modifi... |
xpharry/Udacity-DLFoudation | tutorials/autoencoder/Convolutional_Autoencoder.ipynb | mit | %matplotlib inline
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0)
img = mnist.train.images[2]
plt.imshow(img.reshape((28, 28)), cmap='Greys_r')
"""
Explanation: C... |
tensorflow/docs-l10n | site/en-snapshot/io/tutorials/azure.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... |
hethapu/big-data-python-class | Lectures/Lecture5-MapReduce/MapReduce Intro.ipynb | mit | def cube(x): return x*x*x
map(cube,range(1,11))
"""
Explanation: Challenge of processing large amounts of data
<ul>
<li>How to process is quickly?
<li>So how do we go about making the problem map so that it can be distributed computation?
<li> Distributed/Parrallel Programming is hard
</ul>
Mapreduce addresses all t... |
Ttl/scikit-rf | doc/source/examples/metrology/TRL.ipynb | bsd-3-clause | import skrf as rf
from skrf.calibration import TRL
%matplotlib inline
from skrf.plotting import stylely
stylely()
"""
Explanation: TRL
This little example demonstrates how to use scikit-rf for a basic TRL calibration.
Basic Use
Imports
First we import skrf, the TRL class, and setup matplotlib plotting.
End of expl... |
ngcm/training-public | FEEG6016 Simulation and Modelling/07-Finite-Elements-Lab-1.ipynb | mit | from IPython.core.display import HTML
css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css'
HTML(url=css_file)
"""
Explanation: Finite Elements Lab 1 Worksheet
End of explanation
"""
%matplotlib inline
import numpy
from matplotlib import pyplot
from matplotl... |
tensorflow/docs-l10n | site/ja/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... |
McDermott-Group/Simulation | Projects/chargeNoiseMaskDesign.ipynb | gpl-2.0 | ri = (40, 50, 60, 70, 80, 90, 100, 108)
ro = (40.7, 52.9, 69, 90.5, 123, 182, 305, 500)
Cq = (46.3, 47.0, 46.9, 47.0, 47.0, 47.0, 46.9, 46.9)
#Cq = (46.3, 49.5, 46.9, 49.5, 47.0, 51.7, 46.9, 54)
Cg = (1.5, 1.44, 1.47, 1.45, 1.46, 1.49, 1.42, 1.48)
Cgnd = (39.0, 30.9, 32.8, 35.6, 41.9, 54.1,... |
mayank-johri/LearnSeleniumUsingPython | Section 3 - Machine Learning/Supervised Learning Algorithm/Regression Analysis/2. Logistic Regression.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
from sklearn import preprocessing
import matplotlib.pyplot as plt
plt.rc("font", size=14)
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
import seaborn as sns
sns.set(style="white")
sns.set(style="whitegrid", color_codes=T... |
ceos-seo/data_cube_notebooks | notebooks/compositing/Composites.ipynb | apache-2.0 | import sys
import os
sys.path.append(os.environ.get('NOTEBOOK_ROOT'))
from utils.data_cube_utilities.clean_mask import landsat_clean_mask_full
# landsat_qa_clean_mask, landsat_clean_mask_invalid
from utils.data_cube_utilities.dc_mosaic import create_hdmedians_multiple_band_mosaic
from utils.data_cube_utilities.dc_mosa... |
ES-DOC/esdoc-jupyterhub | notebooks/nuist/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', 'nuist', 'sandbox-2', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NUIST
Source ID: SANDBOX-2
Topic: Landice
Sub-Topics: Glaciers, Ice.
Propertie... |
catalyst-cooperative/pudl | notebooks/examples/catalyst-template.ipynb | mit | %load_ext autoreload
%autoreload 2
# Standard libraries
import logging
import os
import pathlib
import sys
# 3rd party libraries
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import pandas as pd
import seaborn as sns
import sqlalchemy as sa
# Local libraries
import pudl
"""
Explanation... |
andreyf/machine-learning-examples | sklearn/sklearn.rf_vs_gb.ipynb | gpl-3.0 | from sklearn import ensemble , cross_validation, learning_curve, metrics
import numpy as np
import pandas as pd
import xgboost as xgb
%pylab inline
"""
Explanation: Sklearn, XGBoost
sklearn.ensemble.RandomForestClassifier
End of explanation
"""
bioresponce = pd.read_csv('bioresponse.csv', header=0, sep=',')
bior... |
StingraySoftware/notebooks | Deadtime/Check FAD correction in Stingray.ipynb | mit | %load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
from stingray import EventList, AveragedCrossspectrum, AveragedPowerspectrum
from stingray.deadtime.fad import calculate_FAD_correction, FAD
from stingray.filters import filter_for_deadtime
import matplotlib.pyplot as plt
"""
Expla... |
evanmiltenburg/python-for-text-analysis | Chapters/Chapter 06 - Lists.ipynb | apache-2.0 | friends = ['John', 'Bob', 'Mary']
stuff_to_pack = ['socks','shirt','toothbrush']
print(friends)
print(stuff_to_pack)
"""
Explanation: Chapter 6 - Lists
This notebook uses code snippets and explanations from this course.
As we have learned before, strings and integers have one value in them. When we put a new value in ... |
edsoncelio/python-class | Aula01.ipynb | gpl-3.0 | print ("hello world!")
"""
Explanation: Aula 01
Instalando os requisitos (Debian, Ubuntu, Mint e Derivados)
sudo apt-get install python3
sudo apt-get install python3-pip
obs: para instalação de bibliotecas de terceiros, usaremos o pip
Modo Script vs Modo Interativo
echo print ("hello world!") > hello.py
End of expl... |
DavidLeoni/relmath | bq-examples/Marks/Market Map.ipynb | apache-2.0 | data = pd.read_csv(os.path.abspath('../data_files/country_codes.csv'), index_col=[0])
country_codes = data.index.values
country_names = data['Name']
"""
Explanation: Get Data
End of explanation
"""
market_map = MarketMap(names=country_codes,
# basic data which needs to set for each map
... |
OpenPIV/openpiv-python | openpiv/docs/src/tutorial1.ipynb | gpl-3.0 | from openpiv import tools, pyprocess, validation, filters, scaling
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import imageio
"""
Explanation: OpenPIV tutorial 1
In this tutorial we read a pair of images and perform the PIV using a standard algorithm. At the end, the velocity vector field ... |
aitatanit/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | Chapter2_MorePyMC/Ch2_MorePyMC_PyMC3.ipynb | mit | import pymc3 as pm
with pm.Model() as model:
parameter = pm.Exponential("poisson_param", 1.0)
data_generator = pm.Poisson("data_generator", parameter)
"""
Explanation: Chapter 2
Original content created by Cam Davidson-Pilon
Ported to Python 3 and PyMC3 by Max Margenot (@clean_utensils) and Thomas Wiecki (@tw... |
sloanesturz/cs224u-final-project | sippycup-unit-3.ipynb | gpl-2.0 | from geo880 import geo880_train_examples, geo880_test_examples
print('train examples:', len(geo880_train_examples))
print('test examples: ', len(geo880_test_examples))
print(geo880_train_examples[0])
print(geo880_test_examples[0])
"""
Explanation: <img src="img/sippycup-small.jpg" align="left" style="padding-right: 3... |
ethen8181/machine-learning | deep_learning/multi_label/product_quantization.ipynb | mit | # code for loading the format for the notebook
import os
# path : store the current path to convert back to it later
path = os.getcwd()
os.chdir(os.path.join('..', '..', 'notebook_format'))
from formats import load_style
load_style(plot_style=False)
os.chdir(path)
# 1. magic for inline plot
# 2. magic to print vers... |
skkandrach/foundations-homework | data-databases/Homework_6.ipynb | mit | !pip3 install Flask
!curl http://localhost:5000/florb
import requests
data = requests.get('http://localhost:5000/lakes').json()
print(len(data), "lakes")
for item in data[:10]:
print(item['name'], "- elevation:", item['elevation'], "m / area:", item['area'], "km^2 / type:", item['type'])
!pip install requests
... |
igor-sokolov/dataminingcapstone | Capstone project 3.ipynb | mit | from pyspark.sql import SQLContext
from pyspark.sql.functions import udf, col, lit
from pyspark.sql.types import BooleanType
basePath = 'dataminingcapstone-001'
workingDir = os.path.join(os.curdir, basePath)
sqlContext = SQLContext(sc)
targetDir = os.path.join(workingDir, 'yelp_dataset_challenge_academic_dataset')
... |
QuantEcon/QuantEcon.notebooks | ddp_ex_MF_7_6_3_py.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import quantecon as qe
from quantecon.markov import DiscreteDP
maxage = 5 # Maximum asset age
repcost = 75 # Replacement cost
mancost = 10 # Maintainance cost
beta = 0.9 # Discount factor
m = 3 # Number of actions; 0: keep, 1: servi... |
mne-tools/mne-tools.github.io | dev/_downloads/fb92190904499e5a95e92ab70177abf7/60_make_fixed_length_epochs.ipynb | bsd-3-clause | import os
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.preprocessing import compute_proj_ecg
from mne_connectivity import envelope_correlation
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
... |
mbakker7/ttim | pumpingtest_benchmarks/14_dawsonville_slug_test.ipynb | mit | %matplotlib inline
from ttim import *
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
"""
Explanation: Slug test for confined aquifer
This test is taken from example of MLU.
End of explanation
"""
b = 98 #aquifer thickness
zt = -24
zb = zt - b
rw = 0.076 #well radius of Ln-2 Well
rc = 0.076 #c... |
Olsthoorn/TransientGroundwaterFlow | exercises_notebooks/exercChap6_3.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import expi
def W(u): return -expi(-u) # Theis well function
"""
Explanation: Exercises chapter 6.3 (Theis)
End of explanation
"""
# sampling times in minutes
t_min = np.array([1, 2, 3, 5, 7, 10, 15, 30, 45, 60, 120, 180, 240, 300, 360,
... |
Neuroglycerin/neukrill-net-work | notebooks/troubleshooting_and_sysadmin/Comparing pip freeze.ipynb | mit | cd ..
!cat magical.freeze
!cat fresh.freeze
"""
Explanation: Comparing the output of pip in the magical venv that can run the alexnet_based and a fresh install that can't. Have saved both of these to different text files:
End of explanation
"""
magical = []
with open("magical.freeze") as f:
for l in f:
... |
junghao/fdsn | examples/GeoNet_FDSN_demo_general.ipynb | mit | from obspy import UTCDateTime
from obspy.clients.fdsn import Client as FDSN_Client
from obspy import read_inventory
"""
Explanation: GeoNet FDSN webservice with Obspy demo - General Examples
This demo introduces some simple code that requests data using GeoNet's FDSN webservices and the obspy module in python. This no... |
google/timesketch | notebooks/OSDFCon Demo.ipynb | apache-2.0 | import os
import re
import datetime
import getpass
import numpy as np
import pandas as pd
import altair as alt
import difflib
from timesketch_api_client import client as timesketch_client
"""
Explanation: Live Demo
Before we do any sort of research into a data set we'll need to know what the goal is.
In this case ... |
Yatekii/glal3 | versuch1/computerversuch.ipynb | gpl-3.0 | # Preparations
import math
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
from scipy import stats
from scipy.optimize import curve_fit
import seaborn as sns
from IPython.display import Latex
import warnings
from PrettyTable import PrettyTable
warnings.filter... |
donaghhorgan/COMP9033 | labs/12 - Spark Streaming.ipynb | gpl-3.0 | !pip install sseclient
"""
Explanation: Lab 12: Spark Streaming
Introduction
In this lab, we're going to look at data streaming with Apache Spark. At the end of the lab, you should be able to:
Create a local StreamingContext object.
Use Spark to analyse the recent Wikipedia edits stream.
Getting started
Let's start ... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/Nested Statements and Scope.ipynb | apache-2.0 | x = 25
def printer():
x = 50
return x
print x
print printer()
"""
Explanation: Nested Statements and Scope
Now that we have gone over on writing our own functions, its important to understand how Python deals with the variable names you assign. When you create a variable name in Python the name is stored in ... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage5/get_started_with_vertex_endpoints.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 = ... |
brclark-usgs/flopy | examples/Notebooks/flopy3_PEST.ipynb | bsd-3-clause | %matplotlib inline
import sys
import numpy as np
import flopy
print(sys.version)
print('numpy version: {}'.format(np.__version__))
print('flopy version: {}'.format(flopy.__version__))
"""
Explanation: FloPy
Parameter Estimation with FloPy
This notebook demonstrates the current parameter estimation functionality that ... |
rayxi2dot71828/FluentPython | Chapter 1 - The Python Data Model.ipynb | mit | class DaysOfWeek:
def __init__(self):
self._days = ["lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi", "dimanche"]
def __getitem__(self, position):
return self._days[position]
def __len__(self):
return len(self._days)
days_of_week = DaysOfWeek()
"'{0}' is day... |
probml/pyprobml | deprecated/gp_mauna_loa.ipynb | mit | try:
import tinygp
except ImportError:
!pip install -q tinygp
from jax.config import config
config.update("jax_enable_x64", True)
"""
Explanation: <a href="https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/gp_mauna_loa.ipynb" target="_parent"><img src="https://colab.researc... |
zzsza/Datascience_School | 29. 추천 시스템/01. 추천 시스템의 기초.ipynb | mit | import surprise
"""
Explanation: 추천 시스템의 기초
추천 시스템(recommender system)이란 사용자(user)가 상품(item)에 대해 어떻게 평가하는지를 예측하는 예측 시스템의 일종이다.
Amazon과 같은 인터넷 쇼핑 사이트나 Netflix 등의 온라인 비디오 콘텐츠 제공 사이트는 사용자가 각각의 상품에 대해 평가한 평점(rate)을 가지고 있다. 이 기록을 기반으로 해서 사용자가 아직 평가하지 않은 상품에 대한 점수를 예측함으로써 그 사용자에게 어떤 상품을 추천할 지 결정할 수 있다.
Surprise 패키지
여기에서는 파이... |
DOV-Vlaanderen/pydov | docs/notebooks/search_formele_stratigrafie.ipynb | mit | %matplotlib inline
import inspect, sys
# check pydov path
import pydov
"""
Explanation: Example of DOV search methods for interpretations (formele stratigrafie)
Use cases explained below
Get 'formele stratigrafie' in a bounding box
Get 'formele stratigrafie' with specific properties
Get 'formele stratigrafie' in a ... |
tBuLi/symfit | docs/examples/ex_bivariate_likelihood.ipynb | mit | import numpy as np
from symfit import Variable, Parameter, Fit
from symfit.core.objectives import LogLikelihood
from symfit.distributions import BivariateGaussian
import matplotlib.pyplot as plt
"""
Explanation: Example: Likelihood fitting a Bivariate Gaussian
In this example, we shall perform likelihood fitting to a... |
turi-code/tutorials | dss-2016/churn_prediction/churn-tutorial.ipynb | apache-2.0 | import graphlab as gl
import datetime
gl.canvas.set_target('ipynb') # make sure plots appear inline
"""
Explanation: Forecasting customer churn
Churn prediction is the task of identifying users that are likely to stop using a service, product or website. In this notebook, you will learn how to:
Train & consume a model... |
fionapigott/Data-Science-45min-Intros | neural-networks-201/Neural Networks - Part 2.ipynb | unlicense | from IPython.display import Image
Image(data="img/mr-t.jpg")
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
seed = 1234; np.random.seed(seed)
import seaborn as sns
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from sklearn.cross_validation import train_te... |
apryor6/apryor6.github.io | visualizations/plotly/line.ipynb | mit | import plotly.plotly as py
import cufflinks as cf
import pandas as pd
import numpy as np
import plotly.graph_objs as go
%matplotlib inline
df = cf.datagen.lines()
df.head()
"""
Explanation: Line Chart
Interactive line charts with plotly and cufflinks
dataset: cufflinks.datagen.lines()
End of explanation
"""
py.ip... |
CfA-Library/Training | 2016/2016-12-07-jupyter/python4astronomers_jupyter.ipynb | mit | from astropy.extern.six.moves.urllib import request
import tarfile
url = 'http://python4astronomers.github.io/_downloads/core_examples.tar'
tarfile.open(fileobj=request.urlopen(url), mode='r|').extractall()
"""
Explanation: python4astronomers
A notebook following the first few steps in the python4astronomers tutorial.... |
Jackporter415/phys202-2015-work | assignments/assignment12/FittingModelsEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
"""
Explanation: Fitting Models Exercise 2
Imports
End of explanation
"""
data = np.load('decay_osc.npz')
tdata = data['tdata']
ydata = data['ydata']
dy = data['dy']
plt.errorbar(tdata, ydata, dy,
fmt='.k... |
prashantas/MyDataScience | Python/100-pandas-puzzles-with-solutions.ipynb | bsd-2-clause | import pandas as pd
"""
Explanation: 100 pandas puzzles
Inspired by 100 Numpy exerises, here are 100* short puzzles for testing your knowledge of pandas' power.
Since pandas is a large library with many different specialist features and functions, these excercises focus mainly on the fundamentals of manipulating data ... |
probml/pyprobml | notebooks/book1/14/densenet_torch.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import math
from IPython import display
try:
import torch
except ModuleNotFoundError:
%pip install -qq torch
import torch
try:
import torchvision
except ModuleNotFoundError:
%pip install -qq torchvision
import torchvision
from torch import nn
f... |
CompPhysics/MachineLearning | doc/Programs/VariousCodes/Reduced_dimensionality.ipynb | cc0-1.0 | #initiate stuff
np.random.seed(2018)
err = []
bi=[]
vari=[]
n = 1000
n_boostraps = 1000
noise=0.1
x = np.sort(np.random.uniform(0,1,n)).reshape(-1,1)
y = true_fun(x).reshape(-1,1) + np.random.randn(len(x)).reshape(-1,1) * noise
y_no_noise= true_fun(x)
degrees = np.arange(1,16)
for degree in degrees:
x_train, x_... |
SHDShim/pytheos | examples/6_p_scale_test_Yokoo_Pt.ipynb | apache-2.0 | %config InlineBackend.figure_format = 'retina'
"""
Explanation: For high dpi displays.
End of explanation
"""
import matplotlib.pyplot as plt
import numpy as np
from uncertainties import unumpy as unp
import pytheos as eos
"""
Explanation: 0. General note
This example compares pressure calculated from pytheos and o... |
Will-So/yelp-workbook | How to think about Latent Dirichlet Allocation.ipynb | mit | #import rpy2.ipython
%load_ext rpy2.ipython
%%R
y = 2
!pip install -U rpy2
rpy2.__version__
"""
Explanation: Motivation and ues cases
Additional Prerequesites
If you are interested in the theory section of this post, learning the theory behind Naive Bayes first is neccessary to understand this topic. There are two... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session04/Day0/TooBriefVizSolutions.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Introduction to Visualization:
Density Estimation and Data Exploration
Version 0.1
There are many flavors of data analysis that fall under the "visualization" umbrella in astronomy. Today, by way of example, we will focus on 2 basic... |
thanhleviet/weed | 2-Refine.ipynb | mit | # Load the libraries
import numpy as np
import pandas as pd
# Load the data again!
df = pd.read_csv("data/Weed_Price.csv", parse_dates=[-1])
"""
Explanation: 2. Refine the Data
"Data is messy"
Missing e.g. Check for missing or incomplete data
Quality e.g. Check for duplicates, accuracy, unusual data
Parse e.g. ext... |
Kaggle/learntools | notebooks/feature_engineering_new/raw/tut3.ipynb | apache-2.0 | #$HIDE_INPUT$
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
plt.style.use("seaborn-whitegrid")
plt.rc("figure", autolayout=True)
plt.rc(
"axes",
labelweight="bold",
labelsize="large",
titleweight="bold",
titlesize=14,
titlepad=10,
)
accidents = pd... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.