repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/tensorflow_extended/labs/Simple_TFX_Pipeline_for_Vertex_Pipelines.ipynb | apache-2.0 | # Use the latest version of pip.
!pip install --upgrade pip
!pip install --upgrade "tfx[kfp]<2"
"""
Explanation: Creating Simple TFX Pipeline for Vertex Pipelines
Learning objectives
Prepare example data.
Create a pipeline.
Run the pipeline on Vertex Pipelines.
Introduction
In this notebook, you will create a simple... |
minxuancao/shogun | doc/ipython-notebooks/intro/Introduction.ipynb | gpl-3.0 | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
#To import all Shogun classes
from modshogun import *
"""
Explanation: Machine Learning with Shogun
By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a> as a part of <a href="http://w... |
hbwzhsh/pyDataScienceToolkits_Base | NumPy/.ipynb_checkpoints/(10)assert_function-checkpoint.ipynb | mit | #使用assert_almost_equal函数来检查它们是否近似相等
#指定精度,小数点后7位
print "Decimal 6", np.testing.assert_almost_equal(0.123456789, 0.123456780, decimal=7)
#指定精度,小数点后8位
#抛出异常
print "Decimal 7", np.testing.assert_almost_equal(0.123456789, 0.123456780, decimal=8)
"""
Explanation: 断言函数
单元测试通常使用断言函数作为测试的组成部分。在进行数值计算时,我们经常遇到比较两个近似相等的浮点数这样的基... |
tensorflow/examples | tensorflow_examples/lite/model_maker/third_party/recommendation/ml/ondevice_recommendation.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... |
Bortseb/bortseb.github.io | assets/Jupyter Notebooks/Numbers.ipynb | gpl-3.0 | # Addition
2+1
# Subtraction
2-1
# Multiplication
2*2
# Division
3/2
"""
Explanation: Numbers and more in Python!
In this lecture, we will learn about numbers in Python and how to use them.
We'll learn about the following topics:
1.) Types of Numbers in Python
2.) Basic Arithmetic
3.) Differences between Python 2 v... |
jrmontag/Data-Science-45min-Intros | python-asyncio/python_asyncio.ipynb | unlicense | from IPython.display import HTML
HTML('<iframe width="560" height="315" src="https://www.youtube.com/embed/dD9NgzLhbBM" frameborder="0" allowfullscreen></iframe>')
%load_ext autoreload
%autoreload 2
%matplotlib inline
import itertools as it
from functools import partial
import seaborn as sns
import pandas as pd
impo... |
JAmarel/Phys202 | Midterm/.ipynb_checkpoints/AlgorithmsEx03-checkpoint.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact
"""
Explanation: Algorithms Exercise 3
Imports
End of explanation
"""
def char_probs(s):
"""Find the probabilities of the unique characters in the string s.
Parameters
----------
... |
bretthandrews/marvin | docs/sphinx/jupyter/Shanghai_Demo_Queries.ipynb | bsd-3-clause | # Python 2/3 compatibility
from __future__ import print_function, division, absolute_import
# import matplolib just in case
import matplotlib.pyplot as plt
# this line tells the notebook to plot matplotlib static plots in the notebook itself
%matplotlib inline
# this line does the same thing but makes the plots inter... |
ijmbarr/causalgraphicalmodels | notebooks/cgm-examples.ipynb | mit | from causalgraphicalmodels import CausalGraphicalModel
sprinkler = CausalGraphicalModel(
nodes=["season", "rain", "sprinkler", "wet", "slippery"],
edges=[
("season", "rain"),
("season", "sprinkler"),
("rain", "wet"),
("sprinkler", "wet"),
("wet", "slippery")
]
)
... |
ES-DOC/esdoc-jupyterhub | notebooks/bcc/cmip6/models/sandbox-1/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-1', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: BCC
Source ID: SANDBOX-1
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties: 6... |
seg/2016-ml-contest | jpoirier/jpoirier011.ipynb | apache-2.0 | from sklearn import preprocessing
filename = '../facies_vectors.csv'
train = pd.read_csv(filename)
# encode well name and formation features
le = preprocessing.LabelEncoder()
train["Well Name"] = le.fit_transform(train["Well Name"])
train["Formation"] = le.fit_transform(train["Formation"])
data_loaded = train.copy()... |
Mdround/fastai-deeplearning1 | deeplearning1/nbs/statefarm-sample.ipynb | apache-2.0 | from theano.sandbox import cuda
cuda.use('gpu1')
%matplotlib inline
from __future__ import print_function, division
#path = "data/state/"
path = "data/state/sample/"
import utils; reload(utils)
from utils import *
from IPython.display import FileLink
batch_size=64
"""
Explanation: Enter State Farm
End of explanation... |
parrt/msan501 | notes/OO.ipynb | mit | x = 'Hi'
x.lower()
"""
Explanation: Object-oriented programming
The big reveal
So far we've been working with functions and packages of functions, as well as defining our own functions. It turns out, though, that we've been working with objects all along, we just haven't recognize them as such. For example,
End of ex... |
QuantStack/quantstack-talks | pylondinium/notebooks/ipysheet.ipynb | bsd-3-clause | import ipysheet
sheet = ipysheet.sheet()
sheet
"""
Explanation: Spreadsheet widget for the Jupyter Notebook
Installation
To install use pip:
$ pip install ipysheet
To make it work for Jupyter lab:
$ jupyter labextension ipysheet
If you have notebook 5.2 or below, you also need to execute:
$ jupyter nbextension enable ... |
camillescott/boink | examples/dBG Traversal Demo.ipynb | mit | %%time
# import goetia libraries
from goetia import libgoetia
from goetia.dbg import dBG, Graph
from goetia.hashing import CanLemireShifter
from goetia.storage import SparseppSetStorage
"""
Explanation: The dBG: Hashing and Traversal
This notebook demonstrates how to use goetia's $k$-mer hashing and low level de Bruij... |
olivierverdier/demo-notebooks | Newton.ipynb | mit | def f(x):
return log(x) + cos(x) - 1
"""
Explanation: Vi skal tilnærme løsningen av $\ln(x)+cos(x)-1=0$.
End of explanation
"""
x = linspace(1,20,200)
y = f(x)
plot(x,y, lw=2)
plot([1,20],[0,0], lw=2, color='k')
ax = gca()
mpld3.display()
"""
Explanation: Vi tegner for å finne $x_0$:
End of explanation
"""
de... |
ES-DOC/esdoc-jupyterhub | notebooks/cccma/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', 'cccma', 'sandbox-3', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CCCMA
Source ID: SANDBOX-3
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Bal... |
arsenovic/clifford | docs/tutorials/g3-algebra-of-space.ipynb | bsd-3-clause | import clifford as cf
layout, blades = cf.Cl(3) # creates a 3-dimensional clifford algebra
"""
Explanation: This notebook is part of the clifford documentation: https://clifford.readthedocs.io/.
The Algebra Of Space (G3)
In this notebook, we give a more detailed look at how to use clifford, using the algebra of thr... |
aldian/tensorflow | tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb | apache-2.0 | # A comma-delimited list of the words you want to train for.
# The options are: yes,no,up,down,left,right,on,off,stop,go
# All the other words will be used to train an "unknown" label and silent
# audio data with no spoken words will be used to train a "silence" label.
WANTED_WORDS = "yes,no"
# The number of steps and... |
vangj/py-bbn | jupyter/exact-inference.ipynb | apache-2.0 | from pybbn.graph.dag import Bbn
from pybbn.graph.edge import Edge, EdgeType
from pybbn.graph.jointree import EvidenceBuilder
from pybbn.graph.node import BbnNode
from pybbn.graph.variable import Variable
from pybbn.pptc.inferencecontroller import InferenceController
# create the nodes
a = BbnNode(Variable(0, 'a', ['on... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_modifying_data_inplace.ipynb | bsd-3-clause | import mne
import os.path as op
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: Modifying data in-place
It is often necessary to modify data once you have loaded it into memory.
Common examples of this are signal processing, feature extraction, and data
cleaning. Some functionality is pre-buil... |
mdenker/elephant | doc/tutorials/granger_causality.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from elephant.causality.granger import pairwise_granger, conditional_granger
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2)
# Indirect causal influence diagram
node1 = plt.Circle((0.2, 0.2), 0.1, color='red')
node2 = plt.Circle((0.5, 0.6), 0.1, color='red')
node3 = ... |
mne-tools/mne-tools.github.io | 0.24/_downloads/33d5dd5786fed13908838e94d55ac785/90_compute_covariance.ipynb | bsd-3-clause | import os.path as op
import mne
from mne.datasets import sample
"""
Explanation: Computing a covariance matrix
Many methods in MNE, including source estimation and some classification
algorithms, require covariance estimations from the recordings.
In this tutorial we cover the basics of sensor covariance computations... |
AlpineNow/python-alpine-api | doc/JupyterNotebookExamples/Hyperparameter Search.ipynb | mit | import alpine as AlpineAPI
from pprint import pprint
import json
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Hyperparameter search
We can use the Python API to iteratively run a workflow with different injected variables.
End of explanation
"""
filename = "alpine_login.... |
AaronCWong/phys202-2015-work | assignments/assignment04/TheoryAndPracticeEx01.ipynb | mit | from IPython.display import Image
"""
Explanation: Theory and Practice of Visualization Exercise 1
Imports
End of explanation
"""
# Add your filename and uncomment the following line
Image(filename='Assignment04Screenshot.png')
"""
Explanation: Graphical excellence and integrity
Find a data-focused visualization on... |
tpin3694/tpin3694.github.io | python/breaking_up_string_variables.ipynb | mit | variableName = 'This is a string.'
"""
Explanation: Title: Breaking Up String Variables
Slug: breaking_up_string_variables
Summary: Breaking Up String Variables
Date: 2016-05-01 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
Basic name assignment
End of explanation
"""
One, Two, Three = [1, 2, 3]
"""
Ex... |
all-umass/metric-learn | examples/metric_plotting.ipynb | mit | %matplotlib inline
import metric_learn
import numpy as np
from sklearn.datasets import load_iris
# visualisation imports
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
"""
Explanation: Metric Learning and Plotting
This is a small walkthrough which illustrates all the Metric Learning algorith... |
dashee87/blogScripts | Jupyter/2017-06-04-predicting-football-results-with-statistical-modelling.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn
from scipy.stats import poisson,skellam
epl_1617 = pd.read_csv("http://www.football-data.co.uk/mmz4281/1617/E0.csv")
epl_1617 = epl_1617[['HomeTeam','AwayTeam','FTHG','FTAG']]
epl_1617 = epl_1617.rename(columns={'FTHG': 'HomeGoals', ... |
TeamHG-Memex/eli5 | notebooks/sklearn-crfsuite.ipynb | mit | import nltk
import sklearn_crfsuite
import eli5
"""
Explanation: Named Entity Recognition using sklearn-crfsuite
In this notebook we train a basic CRF model for Named Entity Recognition on CoNLL2002 data (following https://github.com/TeamHG-Memex/sklearn-crfsuite/blob/master/docs/CoNLL2002.ipynb) and check its weights... |
nikbearbrown/Deep_Learning | NEU/Tejas_Bawaskar _DL/Deep Network Visualization Diff weights (1).ipynb | mit | from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D
from keras.models import Model
from keras import backend as K
import numpy as np
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D
from keras.models import Model
from keras import backend as K
input_img = Input(shape=(32... |
jc091/deep-learning | autoencoder/Simple_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)
"""
Explanation: A Simple Autoencoder
We'll start off by building a simple autoencoder to compres... |
karlstroetmann/Algorithms | Python/Chapter-07/HashMap.ipynb | gpl-2.0 | %run ListMap.ipynb
"""
Explanation: Hash Tables (Open Hashing)
This notebook provides a simple implementation of a hash table that uses open hashing.
The class ListMap from the notebook ListMap.ipynb implements a map as a linked list.
End of explanation
"""
import string
for c in string.ascii_letters:
print(f'{... |
opencobra/cobrapy | documentation_builder/io.ipynb | gpl-2.0 | from pathlib import Path
from cobra.io import load_json_model_model, save_json_model, load_matlab_model, save_matlab_model, read_sbml_model, write_sbml_model
import logging
data_dir = Path(".") / ".." / "src" / "cobra" / "data"
data_dir = data_dir.resolve()
print("mini test files: ")
print(", ".join(str(i) for i in d... |
tensorflow/docs-l10n | site/en-snapshot/quantum/tutorials/quantum_reinforcement_learning.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
nublia/data-science-playground | nb/boletins_ocorrencia.ipynb | gpl-3.0 | import numpy
import pandas
from matplotlib import pyplot
%matplotlib inline
pyplot.style.use('fivethirtyeight')
pyplot.rcParams['figure.figsize'] = [11, 8]
url = '../dat/boletins_ocorrencia_sp_clean_2016.csv.gz'
dat = pandas.read_csv(url, encoding='ISO-8859-1', low_memory=False)
dat.describe()
dat.head()
"""
Expl... |
sainathadapa/fastai-courses | deeplearning1/nbs-custom-mine/lesson7_02_practice.ipynb | apache-2.0 | (val_classes, train_classes,
val_labels, train_labels,
val_filenames, train_filenames,
test_filenames) = get_classes('data/fish/')
print(val_classes)
print(train_classes)
print(val_labels)
print(train_labels)
print(val_filenames)
print(train_filenames)
print(test_filenames)
# removing path
remove_path = lambda y... |
fccoelho/Curso_Blockchain | lectures/intro_cripto.ipynb | lgpl-3.0 | import hashlib
hashlib.algorithms_available
"""
Explanation: Introdução à criptografia e às funções Hash
As criptomoedas, como o Bitcoin, utilizam-se de tecnologias criptográficas como criptografia de chave publica,e funções de Hash. Neste notebook vamos nos familiarizar com estes conceitos que nos serão úteis em noss... |
tensorflow/docs-l10n | site/zh-cn/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... |
otavio-r-filho/AIND-Deep_Learning_Notebooks | embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import random
from collections import Counter
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about... |
mgalardini/2017_python_course | notebooks/4-Data_visualization.ipynb | gpl-2.0 | # Panda will be usefull for quick data parsing
import pandas as pd
import numpy as np
# Small trick to get a larger display
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:90% !important; }</style>"))
"""
Explanation: Imports
End of explanation
"""
import matplotlib.pyplot as ... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_left_cerebellum_volume_source.ipynb | bsd-3-clause | # Author: Alan Leggitt <alan.leggitt@ucsf.edu>
#
# License: BSD (3-clause)
import numpy as np
from scipy.spatial import ConvexHull
from mayavi import mlab
from mne import setup_source_space, setup_volume_source_space
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_pa... |
leriomaggio/python-in-a-notebook | 09 Exceptions.ipynb | mit | list_of_numbers = [number for number in range(1, 100)]
print(list_of_numbers)
dictionary_of_numbers = {}
for number in list_of_numbers:
dictionary_of_numbers[number**2] = number
try:
index = list_of_numbers.index(2)
value = dictionary_of_numbers[index]
except (ValueError, KeyError):
print('Error R... |
data-cube/agdc-v2-examples | notebooks/04_interactive_time_series.ipynb | apache-2.0 | %pylab notebook
from __future__ import print_function
import datacube
import xarray as xr
from datacube.storage import masking
from datacube.storage.masking import mask_to_dict
from matplotlib import pyplot as plt
from IPython.display import display
import ipywidgets as widgets
dc = datacube.Datacube(app='Interactive ... |
mathcoding/Programmazione2 | Lab 5 - Quick Look at Machine Learning.ipynb | mit | import pandas as pd
# E` necessario convertire il tempo di gara in secondi, per poterlo confrontare nelle regressioni
bm = pd.read_csv('./data/marathon_results_2016.csv')
bm[:3]
type(bm)
bm[['Age', 'Official Time']][:3]
bm.info()
# Vorremmo predire il sesso (label) in base all'età e al tempo ufficiale (covariate)
... |
icane/intro-opendata | demo-uni.ipynb | mit | from pyicane import pyicane
from collections import OrderedDict
#Obtención de datos de Revisión Anual del PMH desde la web del ICANE
rapmh = pyicane.TimeSeries.get('municipal-register-annual-review-municipality')
#Conversión a dataframe
data = rapmh.data_as_dataframe()
#Filtrado de variables y año
varint = data[(dat... |
jangorecki/h2o-3 | examples/deeplearning/notebooks/deeplearning_credit_card_default_risk_prediction.ipynb | apache-2.0 | dw = H2ODeepWaterEstimator(seed=1234) ## GPU, manual learning rate and momentum, needs tuning
dw.train(x=predictors, y=response, training_frame=train, validation_frame=valid)
dw.model_performance(valid=True).auc()
dl = H2ODeepLearningEstimator() ## CPU, features adaptive learning rate
dl.train(x=predictors, y=resp... |
zscore/pavement_analysis | src/Snapping_Readings_OSRM.ipynb | mit | rides, readings = data_munging.read_raw_data()
readings = data_munging.clean_readings(readings)
readings = data_munging.add_proj_to_readings(readings, data_munging.NAD83)
"""
Explanation: Ride Report Method
Here, we use the match method from the OSRM API with the code modified to return only the endpoints of segments.... |
brockk/clintrials | tutorials/EffTox - Nuts and Bolts.ipynb | gpl-3.0 | import numpy as np
from clintrials.dosefinding.efftox import _pi_E, _pi_T, _pi_ab, _L_n, scale_doses
"""
Explanation: EffTox - Nuts and Bolts
This notebook demonstrates the nuts and bolts of EffTox, the technical details rather than the general user interface. For example, I use it to check calculations in implementa... |
jrrembert/cybernetic-organism | dato/deeplearning/.ipynb_checkpoints/Deep Features for Image Retrieval-checkpoint.ipynb | gpl-2.0 | import graphlab
"""
Explanation: Building an image retrieval system with deep features
Fire up GraphLab Create
End of explanation
"""
image_train = graphlab.SFrame('image_train_data/')
"""
Explanation: Load the CIFAR-10 dataset
We will use a popular benchmark dataset in computer vision called CIFAR-10.
(We've red... |
saketkc/hatex | 2015_Fall/MATH-578B/Homework2/Homework2.ipynb | mit | %matplotlib inline
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1)
D = np.random.rand(100,100)
## This is not symmetric, so we make it symmetric
D = (D+D.T)/2
print (D)
import math
N_steps = 10000
def L(sigma):
s=0
for i in range(0, len(sigma)-1):
s... |
sarvex/tensorflow | tensorflow/compiler/xla/g3doc/tutorials/jit_compile.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... |
OceanPARCELS/parcels | parcels/examples/tutorial_delaystart.ipynb | mit | %matplotlib inline
from parcels import FieldSet, ParticleSet, JITParticle, plotTrajectoriesFile
from parcels import AdvectionRK4
import numpy as np
import xarray as xr
from datetime import timedelta as delta
"""
Explanation: Tutorial on how to 'delay' the start of particle advection
In many applications, it is needed ... |
mne-tools/mne-tools.github.io | 0.20/_downloads/3674b896fc4e4a279156fa5c0f61aea8/plot_10_preprocessing_overview.ipynb | bsd-3-clause | import os
import numpy as np
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file)
raw.crop(0, 60).load_data() # just use a fr... |
menpo/menpofit-notebooks | notebooks/LucasKanade/Lucas Kanade Basics.ipynb | bsd-3-clause | %matplotlib inline
from pathlib import Path
import menpo.io as mio
takeo = mio.import_builtin_asset.takeo_ppm()
takeo = takeo.as_greyscale(mode='luminosity')
# Use a bounding box rather than the facial shape
takeo.landmarks['bounding_box'] = takeo.landmarks['PTS'].lms.bounding_box()
takeo.view();
"""
Explanation: ... |
Evfro/RecSys_ISP2017 | polara_intro.ipynb | mit | data, genres = get_movielens_data(get_genres=True)
data.head()
data.info()
genres.head()
%matplotlib inline
"""
Explanation: Get Movielens-1M data
this will download movielens-1m dataset from http://grouplens.org/datasets/movielens/:
End of explanation
"""
data.rating.value_counts().sort_index().plot.bar()
"""
... |
lknelson/text-analysis-2017 | 01-IntroToPython/00-PythonBasics_ExerciseSolutions.ipynb | bsd-3-clause | # copying 'new_string' from the tutorial on Wednesday
new_string = "It seems very strange that one must turn back, \
and be transported to the very beginnings of history, \
in order to arrive at an understanding of humanity as it is at present."
#creat a new variable containing a list of words using the .split() func... |
joeddav/devol | example/demo.ipynb | mit | (x_train, y_train), (x_test, y_test) = mnist.load_data()
K.set_image_data_format("channels_last")
x_train = x_train.reshape(x_train.shape[0], 28, 28, 1).astype('float32') / 255
x_test = x_test.reshape(x_test.shape[0], 28, 28, 1).astype('float32') / 255
y_train = to_categorical(y_train)
y_test = to_categorical(y_test)... |
polyrabbit/hacker-news-digest | [tutorial] How-to-extract-main-content-from-web-pages-using-Machine-Learning.ipynb | lgpl-3.0 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import GaussianNB, Mult... |
wcmckee/ece-display | .ipynb_checkpoints/minuedudata-checkpoint.ipynb | mit | assefol = ('/media/removable/WILLIAMS30G/www.educationcounts.govt.nz/__data/assets/')
assefol
asselis = os.listdir(assefol)
for asse in asselis:
print asse
#allfil = file_paths(filtered_walk(exceldir, depth=100, included_files=['*.xls']))
exceldir = ('/media/removable/WILLIAMS30G/www.educationcounts.govt.nz... |
jphall663/GWU_data_mining | 10_model_interpretability/src/pdp_ice.ipynb | apache-2.0 | # imports
import h2o
import numpy as np
import pandas as pd
from h2o.estimators.gbm import H2OGradientBoostingEstimator
# display matplotlib graphics in notebook
import matplotlib.pyplot as plt
%matplotlib inline
# start h2o
h2o.init()
h2o.remove_all()
"""
Explanation: License
Copyright 2017 J. Patrick Hall, jphal... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/labs/exercise_movielens_notebook.ipynb | apache-2.0 | !pip install --quiet --upgrade --force-reinstall tensorflow==2.4 tensorflow_probability==0.12.1 tensorflow-io==0.17.0 --use-feature=2020-resolver
!pip install tf_agents==0.7.1 --quiet gast==0.3.3 --upgrade --use-feature=2020-resolver
import functools
import os
from absl import app
from absl import flags
import tensor... |
DB2-Samples/db2jupyter | v1/Db2 Jupyter Extensions Tutorial.ipynb | apache-2.0 | %run db2.ipynb
"""
Explanation: Db2 Jupyter Notebook Extensions Tutorial
The SQL code tutorials for Db2 rely on a Jupyter notebook extension, commonly refer to as a "magic" command. The beginning of all of the notebooks begin with the following command which will load the extension and allow the remainder of the noteb... |
gallantlab/cottoncandy | cottoncandy/examples/ccexample_allenbrainobservatory.ipynb | bsd-2-clause | !pip install cottoncandy
"""
Explanation: Using cottoncandy to access the Allen Brain Observatory data from AWS S3
This examples shows how to use cottoncandy to access the data provided by the Allen Brain Observatory.
This notebook is based on this example provided by the Allen Institute.
To find out more about cotton... |
hillairet/analysis-for-safer-roads | Section2b - Data Visualization.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
# Provides better color palettes
import seaborn as sns
from pandas import DataFrame,Series
import matplotlib as mpl
import matplotlib.pyplot as plt
# Command to display the plots in the iPython Notebook
%matplotlib inline
import matplotlib.patches as mpatches
mpl.style.use('sea... |
ES-DOC/esdoc-jupyterhub | notebooks/noaa-gfdl/cmip6/models/gfdl-esm4/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'gfdl-esm4', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NOAA-GFDL
Source ID: GFDL-ESM4
Topic: Aerosol
Sub-Topics: Transport, Emissi... |
KDD-OpenSource/geox-young-academy | day-1/examples/Random Numbers.ipynb | mit | import random # load the module
r = random.random() # equally distributed random number
print("Random 0 <= r == {} < 1".format(r))
μ = 200
σ = 25
g = random.gauss(μ, σ)
print("Gauss distributed random number {} with μ={} and σ={}".format(g, μ, σ))
"""
Explanation: Random Numbers
This document shows you how to crea... |
alfkjartan/control-computarizado | discrete-time-systems/notebooks/Evaluating-polynomials.ipynb | mit | import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
%matplotlib inline
def p1(x): return 4*x + 2 # Our first-order polynomial
# Compute values for x=[0,0.2, 0.4, ... 2] recursively using the difference equation
h = 0.2
x = h*np.arange(11) # Gives the array [0,0.2, 0.4, ... 2]
pd = np.zeros... |
QInfer/qinfer-examples | randomized_benchmarking.ipynb | agpl-3.0 | from __future__ import division, print_function
"""
Explanation: Estimating Randomized Benchmarking Fidelities
Introduction
This Notebook demonstrates how to use QInfer to the fidelity of a gateset using experimental data from randomized benchmarking.
Setup
First, to make sure that this example works in both Python 2 ... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/ucp_pandas.ipynb | apache-2.0 | import pip
REQUIRED_MINIMUM_PANDAS_VERSION = '0.17.1'
try:
import pandas as pd
assert pd.__version__ >= REQUIRED_MINIMUM_PANDAS_VERSION
except:
raise Exception("Version " + REQUIRED_MINIMUM_PANDAS_VERSION + " or above of Pandas is required to run this notebook")
"""
Explanation: The Unit Commitment Problem... |
tralpha/Computer-Vision-Gatech | .ipynb_checkpoints/Lesson 2A-L1-checkpoint.ipynb | apache-2.0 | import cv2
import os
import matplotlib.pyplot as plt
%matplotlib inline
IMG = 'imgs/'
"""
Explanation: This notebook covers:
Lesson 2A-L1 Images as Functions - Lesson 2C-L3 Aliasing
Import Libraries and Dependencies
End of explanation
"""
def show_img(img):
"""
Function takes an image, and shows the image u... |
nerdcommander/scientific_computing_2017 | lesson18/Lesson18_individual.ipynb | mit | ## import libraries we need
import numpy as np
import matplotlib.pyplot as plt
## makes our population of 10,000 numbers from 1-100
## you might get a warning that this function is deprecated, but it still works
population = np.random.random_integers(1, high=100, size=10000)
## look at 1st 25 (don't print out all 10... |
rnder/data-science-from-scratch | notebook/ch22_recommender_systems.ipynb | unlicense | import math, random
from collections import defaultdict, Counter
from linear_algebra import dot
users_interests = [
["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"],
["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"],
["Python", "scikit-learn", "scipy", "numpy", "statsmodels", "pa... |
dseuss/mpnum | examples/mpnum_intro.ipynb | bsd-3-clause | import numpy as np
import numpy.linalg as la
import mpnum as mp
"""
Explanation: Introductory Notebook to mpnum
mpnum implements matrix product arrays (MPA), which are efficient parameterizations of certain multi-partite arrays. Special cases of the MPA structure, which are omnipresent in many-body quantum physics, a... |
dadosgovbr/catalogos-dados-brasil | scripts/uso/como-usar-com-o-pandas.ipynb | mit | import pandas as pd
# Para trabalhar com Frictionless Data – frictionlessdata.io
from tableschema import Storage
from datapackage import Package
# Para visualização
import plotly_express as px
import plotly as py, plotly.graph_objects as go
"""
Explanation: Como usar com o Pandas
Os catálogos de dados abertos podem ... |
jiarong/SSUsearch | notebooks-pc-linux/pipeline-dependency-installation.ipynb | bsd-3-clause | cd ~/Desktop/SSUsearch/
mkdir -p ./external_tools
cd ./external_tools
mkdir -p ./bin
"""
Explanation: Install dependencies
This pipeline requires:
HMMER3.1
mothur
RDP mcclust
python pandas, numpy, scipy, matplotlib, and screed package.
This tutorial is made on a 64 bit linux (ubuntu) machine. If you have 32 bit m... |
keylime1/courses_12-752 | lectures/Lecture5_Assignment2-2014-ReDo.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
%matplotlib inline
"""
Explanation: Assignment #2 from 2014 - ReDo
This is an attempt to complete the tasks laid out on Assignment #2 from this class in 2014.
We begin by importing all of the libraries that are necessary, and setting up the plot... |
fmaschler/networkit | Doc/Notebooks/NetworKit_Tutorial_Part_1.ipynb | mit | from networkit import *
%matplotlib inline
"""
Explanation: Tutorial "Algorithmic Methods for Network Analysis with NetworKit" (Part 1)
Welcome to the hands-on session of our tutorial! This tutorial is based on the user guide of NetworKit, our network analysis software. You will learn in this tutorial how to use Netw... |
PyLCARS/PythonUberHDL | myHDL_DigitalSignalandSystems/Synthesizers/myHDL_SinewaveGenerator.ipynb | bsd-3-clause | import numpy as np
import pandas as pd
from sympy import *
init_printing()
from IPython.display import display, Math, Latex
from myhdl import *
from myhdlpeek import Peeker
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: \title{Continues HDL Sinewave Generator via Chebyshev Polynomial Approximat... |
kimkipyo/dss_git_kkp | 통계, 머신러닝 복습/160620월_17일차_나이브 베이즈 Naive Bayes/1.나이브 베이즈 분류 모형.ipynb | mit | np.random.seed(0)
X0 = sp.stats.norm(-2, 1).rvs(40)
X1 = sp.stats.norm(2, 1).rvs(60)
X = np.hstack([X0, X1])[:, np.newaxis]
y0 = np.zeros(40)
y1 = np.ones(60)
y = np.hstack([y0, y1])
sns.distplot(X0, rug=True, kde=False, norm_hist=True, label="class 0")
sns.distplot(X1, rug=True, kde=False, norm_hist=True, label="clas... |
james-prior/cohpy | 20170522-cohpy-ascii-versus-repr.ipynb | mit | things = (
1/3,
.1,
1+2j,
[1, 'hello'],
('creosote', 3),
{2: 'world'},
{'swallow'},
[1., {"You're": (3, '''tr"'e'''), 1j: 'complexity'}, 17],
"""hello""",
""" """,
""" """,
"""I'm here.""",
"""Foo said "Hello world!".""",
"""I'm saying "Hello world!".""",
"... |
sdpython/pyquickhelper | _unittests/ut_helpgen/data_gallery/notebooks/1a/histogramme_rapide.ipynb | mit | import random
num = [random.randint(0,10) for i in range(1000)]
hist = {}
for i in num:
hist[i] = hist.get(i, 0) + 1
hist
"""
Explanation: Histogramme et dictionnaire
Compter les occurences de nombres dans une liste est assez facile avec un dictionnaire.
End of explanation
"""
def count1(num):
hist = {}
... |
clauwag/WikipediaGenderInequality | notebooks/Lexical Analysis - 03 Annotated PMI keywords with Categories.ipynb | mit | import pandas as pd
import re
import numpy as np
import dbpedia_config
from scipy.stats import chisquare
target_folder = dbpedia_config.TARGET_FOLDER
"""
Explanation: Annotated PMI Keywords with Categories
In this notebook we evaluate the differences in PMI keywords for each gender. We load the data from the previous... |
sharynr/notebooks | Test a model using the WML API client.ipynb | apache-2.0 | # Add API credentials to access your Watson Machine Learning service instance
wml_credentials={
"url": "https://us-south.ml.cloud.ibm.com",
"apikey": "insert_your_apikey_here",
}
# Add the deployment ID from your model deployment from the scoring endpoint
scoring_endpoint = 'insert_your_deployment_ID_here'
"""
E... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/tensorflow_extended/labs/penguin_transform.ipynb | apache-2.0 | try:
import colab
!pip install --upgrade pip
except:
pass
"""
Explanation: Using TFX Pipeline and TensorFlow Transform with Feature Engineering
Learning objectives
Prepare example data.
Create a pipeline.
Run the pipeline.
Introduction
In this notebook, you will create and run a TFX pipeline
to ingest raw inpu... |
tensorflow/docs-l10n | site/ko/hub/tutorials/semantic_similarity_with_tf_hub_universal_encoder_lite.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
root-mirror/training | NCPSchool2021/Examples/CreateAHistogramPython.ipynb | gpl-2.0 | import ROOT
"""
Explanation: Create a Histogram - Python version
Create a histogram, fill it with random numbers, set its colour to blue, draw it.
Can you:
- Can you use the native Python random number generator for this?
- Can you make your plot interactive using JSROOT?
- Can you document what you did in markdown?
E... |
SchwaZhao/networkproject1 | 04_Twitter_Sentiment_Analysis.ipynb | mit | # Let's create a DataFrame with each tweet using pandas
import pandas as pd
import json
import numpy as np
def getTweetID(tweet):
""" If properly included, get the ID of the tweet """
return tweet.get('id')
def getUserIDandScreenName(tweet):
""" If properly included, get the tweet
user ID an... |
percyfal/bokeh | examples/howto/notebook_comms/Numba Image Example.ipynb | bsd-3-clause | from __future__ import print_function, division
from timeit import default_timer as timer
from bokeh.plotting import figure, show, output_notebook
from bokeh.models import GlyphRenderer, LinearColorMapper
from bokeh.io import push_notebook
from numba import jit, njit
from ipywidgets import interact
import numpy as n... |
AllenDowney/ModSim | python/soln/examples/filter_soln.ipynb | gpl-2.0 | # install Pint if necessary
try:
import pint
except ImportError:
!pip install pint
# download modsim.py if necessary
from os.path import exists
filename = 'modsim.py'
if not exists(filename):
from urllib.request import urlretrieve
url = 'https://raw.githubusercontent.com/AllenDowney/ModSim/main/'
... |
opesci/devito | examples/seismic/tutorials/12_time_blocking.ipynb | mit | # NBVAL_IGNORE_OUTPUT
# Install pyzfp package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install blosc
import blosc
"""
Explanation: Implementation of time blocking for compression/serialization and de-serialization/de-compression of wavefields with Devito operators
Introduction
The goal of thi... |
csaladenes/blog | tomtom/parser.ipynb | mit | dc=pd.read_csv('dcg.csv')
"""
Explanation: Load from here
End of explanation
"""
pop2=pd.read_csv('worldcities.csv')
pop2
def ccc(c,country):
if c=='Moscow region (oblast)': return 'Moscow'
if c=='Rostov-on-Don': return 'Rostov-na-Donu'
if c=='Gdansk, Gdynia and Sopot': return 'Gdansk+Gdynia'
if c=... |
MargaritaLubimova/python_park_mail | homework/.ipynb_checkpoints/homework1-checkpoint.ipynb | mit | def is_number(str):
try:
int(str)
return True
except:
return False
isnumber = False
while not isnumber:
year = input('Введите год: ')
isnumber = is_number(year)
if isnumber:
if (int(year) % 4 == 0 and int(year) % 100 != 0) or int(year) % 400 == 0:
print... |
meissnereric/rossman_predictor | .ipynb_checkpoints/cleanData-checkpoint.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
%pwd
#Partial code taken from (https://www.kaggle.com/mmourafiq/rossmann-store-sales/data-viz/notebook):
train = pd.read_csv('data/train.csv')
print(train[:5])
store = pd.read_csv('data/store.csv')
print(store[:5])
all_data = p... |
ramhiser/Keras-Tutorials | notebooks/06_autoencoder.ipynb | mit | from IPython.display import Image, SVG
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
import keras
from keras.datasets import mnist
from keras.models import Model, Sequential
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D, Flatten, Reshape
from keras import regularize... |
opesci/notebooks | AcousticFWI/Visco-Acoustic-wave-equation.ipynb | bsd-3-clause | p=Function('p')
b=Function('b')
m,s,h,r = symbols('m s h r')
m=M(x,y)
q=Q(x,y,t)
d=D(x,y,t)
e=E(x,y)
r=rho(x,y)
"""
Explanation: PDE
The acoustic wave equation for the square slowness m and a source q is given in 3D by :
\begin{cases}
&m \frac{d^2 u(x,t)}{dt^2} - \rho \nabla(\frac{1}{\rho} \text{grad}(u(x,t)) =q \
... |
bjackman/lisa | ipynb/examples/trappy/trappy_example.ipynb | apache-2.0 | import logging
from conf import LisaLogging
LisaLogging.setup()
# Generate plots inline
%pylab inline
import json
import os
# Support to initialise and configure your test environment
import devlib
from env import TestEnv
# Support to configure and run RTApp based workloads
from wlgen import RTA, Periodic, Ramp, St... |
jpn--/larch | book/example/202_exville_mc_logsums.ipynb | gpl-3.0 | # TEST
import larch.numba as lx
from pytest import approx
import os
import numpy as np
import xarray as xr
from addicty import Dict
from larch import P, X
import larch.numba as lx
"""
Explanation: 202: Exampville Mode Choice Logsums
Welcome to Exampville, the best simulated town in this here part of the internet!
Exa... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/structured/labs/1b_prepare_data_babyweight.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: LAB 1b: Prepare babyweight dataset.
Learning Objectives
Setup up the environment
Preprocess natality dataset
Augment natality dataset
Create the train and eval tables in BigQuery
Ex... |
phobson/watershed | examples/Southern California Demo.ipynb | bsd-3-clause | %matplotlib inline
import numpy
from scipy import ndimage
import matplotlib.pyplot as plt
import matplotlib.colors as mcolor
import watershed
"""
Explanation: <div style='color:gray'>Find Upstream Areas in Southern California</div>
End of explanation
"""
socal = watershed.load_example('so_cal')[150:250, 200:300] * ... |
SergioSantGre/project_portfolio | SSG_dlnd_tv_script_generation.ipynb | lgpl-3.0 | # from helper.py change line 10 with open(input_file, "r",encoding='utf_8', errors='ignore') as f:
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.