repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
tensorflow/docs-l10n | site/ja/agents/tutorials/9_c51_tutorial.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
ianhamilton117/deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
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[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
qiu997018209/MachineLearning | 七月在线机器学习在bat工业中应用项目实战/特征工程练习/feature_engineering.ipynb | apache-2.0 | #先把数据读进来
import pandas as pd
data = pd.read_csv('kaggle_bike_competition_train.csv', header = 0, error_bad_lines=False)
#看一眼数据长什么样
data.head()
"""
Explanation: 特征工程小案例
Kaggle上有这样一个比赛:城市自行车共享系统使用状况。
提供的数据为2年内按小时做的自行车租赁数据,其中训练集由每个月的前19天组成,测试集由20号之后的时间组成。
End of explanation
"""
# 处理时间字段
temp = pd.DatetimeIndex(data['d... |
mdda/deep-learning-workshop | notebooks/7-Reinforcement-Learning/3-BubbleBreaker.ipynb | mit | import os
import numpy as np
import shutil, requests
import pickle
"""
Explanation: Bubble Breaker in Python / Javascript
The key 'board' data structure is a numpy array, which is (for efficiency) stored on its side (with the bottom-right phone cell being the board[0,0] cell):
End of explanation
"""
models_dir = '.... |
ES-DOC/esdoc-jupyterhub | notebooks/bnu/cmip6/models/bnu-esm-1-1/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'bnu', 'bnu-esm-1-1', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: BNU
Source ID: BNU-ESM-1-1
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Bal... |
RyanSkraba/beam | examples/notebooks/documentation/transforms/python/elementwise/kvswap-py.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License")
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
akseshina/dl_course | seminar_3/.ipynb_checkpoints/AlexNet-checkpoint.ipynb | gpl-3.0 | import cifar10
"""
Explanation: Load Data
End of explanation
"""
cifar10.maybe_download_and_extract()
"""
Explanation: The CIFAR-10 data-set is about 163 MB and will be downloaded automatically if it is not located in the given path.
End of explanation
"""
class_names = cifar10.load_class_names()
class_names
"""... |
mne-tools/mne-tools.github.io | 0.19/_downloads/d0650bb5ca9f8c789ed4763f3c3f895e/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Romain Trachel <trachelr@gmail.com>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne import io, EvokedArray
from mne.datasets import sample
from mne.decoding import Vectorizer, get_coef
from sklea... |
nbokulich/short-read-tax-assignment | ipynb/runtime/compute-runtimes.ipynb | bsd-3-clause | from os.path import join, expandvars
from joblib import Parallel, delayed
from tax_credit.framework_functions import (runtime_make_test_data,
runtime_make_commands,
clock_runtime,
)
## pr... |
Jim00000/Numerical-Analysis | 9_Random_Numbers_And_Applications.ipynb | unlicense | # Import modules
import time
import math
import random
import numpy as np
import scipy
import sympy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
"""
Explanation: ★ Random Numbers And Applications ★
End of explanation
"""
def linear_congruential_generator(x, a, b, m):
x = (a * x + b) % ... |
4dsolutions/Python5 | Comparing JavaScript with Python.ipynb | mit | %%javascript
class Queue {
constructor(){
this._storage = {};
this._start = -1; //replicating 0 index used for arrays
this._end = -1; //replicating 0 index used for arrays
}
enqueue(val){
this._storage[++this._end] = val;
}
dequeue(){
if(this.size()){
let nextUp = this._storage[... |
ResearchComputing/RMACC2015-Spark | pyspark-exercises/04_parpivot.ipynb | gpl-2.0 | from pyspark import SparkConf, SparkContext
from collections import OrderedDict
partitions = 18
parcsv = sc.textFile("/lustre/janus_scratch/dami9546/lustre_timeseries.csv", partitions)
parcsv.take(5)
"""
Explanation: Example 2: A fast parallel pivot, or preparing for time series analysis
End of explanation
"""
filt... |
phoebe-project/phoebe2-docs | development/examples/legacy_contact_binary.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Comparing Contacts Binaries in PHOEBE 2 vs PHOEBE Legacy
NOTE: PHOEBE 1.0 legacy is an alternate backend and is not installed with PHOEBE 2. In order to run this backend, you'll need to have PHOEBE 1.0 installed and manually install the python wrappers in the phoeb... |
eds-uga/csci1360e-su17 | lectures/MidtermReview.ipynb | mit | number = 3.14159265359
"""
Explanation: Midterm Review
CSCI 1360E: Foundations for Informatics and Analytics
Material
Anything in Lectures 1 through 10 are fair game!
Anything in assignments 1 through 4 are fair game!
Topics
Data Science
- Definition
- Intrinsic interdisciplinarity
- "Greater Data Science"
Py... |
Boussau/Notebooks | Notebooks/Placing convergent events in phylogenies.ipynb | gpl-2.0 | from ete3 import Tree
import string
import scipy.stats as stats
import numpy as np
tl = Tree()
# We create a random tree topology
numTips = 20
candidateNames = list(string.ascii_lowercase)
tipNames = candidateNames[0:20]
tl.populate(numTips, names_library=tipNames)
print (tl)
#Alternatively we could read a tree from ... |
KECB/learn | BAMM.101x/Collections.ipynb | mit | x = [4,2,6,3] #Create a list with values
y = list() # Create an empty list
y = [] #Create an empty list
print(x)
print(y)
"""
Explanation: <h1>Lists</h1>
<li>Sequential, Ordered Collection
<h2>Creating lists</h2>
End of explanation
"""
x=list()
print(x)
x.append('One') #Adds 'One' to the back of the empty list
pri... |
sysid/nbs | cnn/tw_vgg16.ipynb | mit | %matplotlib inline
"""
Explanation: Using Convolutional Neural Networks
This is running on theano!
Welcome to the first week of the first deep learning certificate! We're going to use convolutional neural networks (CNNs) to allow our computer to see - something that is only possible thanks to deep learning.
Introducti... |
gonzmg88/cnn_basic_course | visualization.ipynb | gpl-3.0 | from keras.models import load_model,Model
import dogs_vs_cats as dvc
import numpy as np
modelname = "cnn_model_trained.h5"
cnn_model = load_model(modelname)
# Load some data
from keras.applications.imagenet_utils import preprocess_input
all_files = dvc.image_files()
all_files = np.array(all_files)
files_ten = all_fi... |
cdawei/digbeta | dchen/tour/ssvm_ranksvm_weights.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import os, pickle, random
import pandas as pd
import numpy as np
import cvxopt
random.seed(1234554321)
np.random.seed(123456789)
cvxopt.base.setseed(123456789)
"""
Explanation: SSVM with RankSVM Weights
This experiment is to use the trained RankSVM weights as the no... |
zhangmianhongni/MyPractice | Python/notebook/一个SVM RBF分类调参的例子.ipynb | apache-2.0 | X, y = make_circles(noise=0.2, factor=0.5, random_state=1);
from sklearn.preprocessing import StandardScaler
X = StandardScaler().fit_transform(X)
"""
Explanation: 我们生成一些随机数据来让我们后面去分类,为了数据难一点,我们加入了一些噪音。生成数据的同时把数据归一化
End of explanation
"""
from matplotlib.colors import ListedColormap
cm = plt.cm.RdBu
cm_bright = List... |
NYUDataBootcamp/Projects | UG_F16/DeMichiel-Lee-TennisCountries.ipynb.txt.ipynb | mit | import sys # system module
import pandas as pd # data package
import matplotlib.pyplot as plt # graphics module
import datetime as dt # date and time module
import numpy as np # foundation for pandas
%matplotlib inline ... |
ebenolson/Recipes | examples/imagecaption/RNN Training.ipynb | mit | import pickle
import random
import numpy as np
import theano
import theano.tensor as T
import lasagne
from collections import Counter
from lasagne.utils import floatX
"""
Explanation: Image Captioning with LSTM
This is a partial implementation of "Show and Tell: A Neural Image Caption Generator" (http://arxiv.org/ab... |
sarvex/tensorflow | tensorflow/lite/examples/experimental_new_converter/Keras_LSTM_fusion_Codelab.ipynb | apache-2.0 | !pip install tf-nightly
"""
Explanation: Overview
This CodeLab demonstrates how to build a fused TFLite LSTM model for MNIST recognition using Keras, and how to convert it to TensorFlow Lite.
The CodeLab is very similar to the Keras LSTM CodeLab. However, we're creating fused LSTM ops rather than the unfused versoin.
... |
ES-DOC/esdoc-jupyterhub | notebooks/awi/cmip6/models/awi-cm-1-0-mr/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'awi', 'awi-cm-1-0-mr', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: AWI
Source ID: AWI-CM-1-0-MR
Topic: Ocean
Sub-Topics: Timestepping Framework, Adv... |
NOAA-ORR-ERD/gridded | examples/UGRID_plotting_COMT.ipynb | unlicense | # get set up:
%matplotlib inline
from __future__ import print_function
# lets make sure gridded import first!
import gridded
# other useful packages
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import cartopy
import cartopy.crs as ccrs
from cartopy.... |
zhmz90/CS231N | assign/assignment1/knn.ipynb | mit | %matplotlib
# Run some setup code for this notebook.
import random
import numpy as np
from cs231n.data_utils import load_CIFAR10
import matplotlib.pyplot as plt
# This is a bit of magic to make matplotlib figures appear inline in the notebook
# rather than in a new window.
%matplotlib inline
plt.rcParams['figure.fig... |
tensorflow/neural-structured-learning | workshops/kdd_2020/adversarial_regularization_mnist.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 u... |
somma/ipython_notebook | sqlalchemy_tutorial/sqlalchemy_tutorial.ipynb | mit | import sqlalchemy
sqlalchemy.__version__
"""
Explanation: contents from sqlalchemy ORM tutorial
Version check
End of explanation
"""
from sqlalchemy import create_engine
engine = create_engine('sqlite:///:memory:', echo=True)
"""
Explanation: Connecting
create_engien() 함수 파라미터, database url 형식은 여기에서 확인
End of exp... |
phoebe-project/phoebe2-docs | development/tutorials/intens_weighting.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Intensity Weighting
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
from phoebe import u # units
import numpy as np
im... |
is-cs/druljs | DD_Net_demo.ipynb | mit | import numpy as np
import math
import random
import pandas as pd
import os
import matplotlib.pyplot as plt
import cv2
import glob
from tqdm import tqdm
import pickle
import scipy.ndimage.interpolation as inter
from scipy.signal import medfilt
from scipy.spatial.distance import cdist
from keras.optimizers import *
fro... |
a301-teaching/a301_code | notebooks/qgis/qgis_lesson_1.ipynb | mit | from IPython.display import Image
Image(filename='Images/lesson1_1.png', width=800, height=800)
"""
Explanation: Lesson 1: Set-up and Orientation
Sections:
Installation and Set-up
Introducing Vector layers
Using the Measuring tool & Map projections
Introducing spatial data
Suggested Readings
References
<a id='st... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/Pytorch from scratch/MLP/Part 4 - Fashion-MNIST (Solution).ipynb | apache-2.0 | import torch
from torchvision import datasets, transforms
import helper
# Define a transform to normalize the data
transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
# Download and load the training data
trainset = datasets.Fa... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session02/Day5/ImageVizExercises.ipynb | mit | import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.wcs import WCS
from astropy.visualization import (MinMaxInterval,
LogStretch,
ImageNormalize)
%matplotlib inline
"""
Explanation: Exercises for image visualization
Feel free to p... |
metpy/MetPy | v0.11/_downloads/f8c7f51c50c58b17901913e49a5b977e/Inverse_Distance_Verification.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import cKDTree
from scipy.spatial.distance import cdist
from metpy.interpolate.geometry import dist_2
from metpy.interpolate.points import barnes_point, cressman_point
from metpy.interpolate.tools import calc_kappa
def draw_circle(ax, x, y, r, m, ... |
bigdata-i523/hid335 | project/BDA-Analytics-Classifier-PRL.ipynb | gpl-3.0 | import sklearn
import mglearn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Big Data Applications and Analytics - Term Project
Sean M. Shiverick Fall 2017
Classification of Prescription Opioid Misuse: PRL
Logistic Regression Classifier, Decision Tree Clas... |
tpin3694/tpin3694.github.io | machine-learning/naive_bayes_classifier_from_scratch.ipynb | mit | import pandas as pd
import numpy as np
"""
Explanation: Title: Naive Bayes Classifier From Scratch
Slug: naive_bayes_classifier_from_scratch
Summary: How to build a naive bayes classifier from scratch in Python.
Date: 2016-12-12 12:00
Category: Machine Learning
Tags: Naive Bayes
Authors: Chris Albon
Naive b... |
dsacademybr/PythonFundamentos | Cap06/Notebooks/DSA-Python-Cap06-02-Insert no SQLite.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 6</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Reemo... |
tensorflow/recommenders | docs/examples/basic_ranking.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... |
folivetti/PIPYTHON | Aula06.ipynb | mit | """
A lista de contatos terá o formato:
[ ["nome", "telefone"] ]
"""
def Procura(nome, agenda):
for contato in agenda:
if contato[0] == nome:
return contato[1]
return None
def Adiciona(nome, telefone, agenda):
if Procura(nome, agenda) == None:
agenda.append([nome,telefone])
ag... |
probml/pyprobml | internal/mapping_figures_to_urls.ipynb | mit | from TexSoup import TexSoup
import regex as re
import os
import nbformat as nbf
import pandas as pd
try:
from probml_utils.url_utils import (
extract_scripts_name_from_caption,
check_dead_urls,
is_dead_url,
github_url_to_colab_url,
make_url_from_fig_no_and_script_name,
... |
besser82/shogun | doc/ipython-notebooks/structure/FGM.ipynb | bsd-3-clause | %pylab inline
%matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
import numpy as np
import scipy.io
dataset = scipy.io.loadmat(os.path.join(SHOGUN_DATA_DIR, 'ocr/ocr_taskar.mat'))
# patterns for training
p_tr = dataset['patterns_train']
# patterns for testing
p_ts = dataset['pat... |
drvinceknight/gt | nbs/chapters/04-Nash-equilibria.ipynb | mit | import sympy as sym
import numpy as np
sym.init_printing()
x, y = sym.symbols('x, y')
A = sym.Matrix([[1, -1], [-1, 1]])
B = - A
sigma_r = sym.Matrix([[x, 1-x]])
sigma_c = sym.Matrix([y, 1-y])
A * sigma_c, sigma_r * B
"""
Explanation: Best responses
Definition of a best response
Video
In a two player game $(A,B)\in{... |
gregcaporaso/sketchbook | 2015.07.22-upgma-v-nj/experiments.ipynb | bsd-3-clause | %matplotlib inline
from skbio import Alignment, Protein
aln = Alignment.read('globin-aln.fasta', constructor=Protein)
dm = aln.distances()
print(dm)
"""
Explanation: This notebook is derived from the scikit-bio-cookbook. It contains some experiments that I'm working on for the Phylogenetic Reconstruction chapter of... |
baobabyoo/astrobao | .ipynb_checkpoints/astrobao-checkpoint.ipynb | gpl-3.0 | import math
import numpy as np
from numpy import size
"""
Explanation: Handy small functions related to astronomical research
End of explanation
"""
def Planckfunc_cgs(freq, temperature):
"""
Calculate Planck function.
Inputs:
freq: frequency, in Hz
temperature: temperature in Kelvin
Retur... |
pewen/transferencia_calor | Notebooks/1.0_Explicito.ipynb | mit | import numpy as np
%matplotlib inline
import time
"""
Explanation: Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2015 Franco N. Bellomo, Lucas Bellomo
Método Explicito
Con la discretización que realiamos llegamos a que:
\begin{equation}
\dfrac{T_{i}^{n+1}-T_{i}^{n}}{\Delta t... |
Hugovdberg/timml | notebooks/BuildingPit.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
# import sys
# sys.path.insert(1, "..")
import timml
"""
Explanation: BuildingPit Element
End of explanation
"""
kh = 2. # m/day
f_ani = 0.05 # anisotropy factor
kv = f_ani*kh
ctop = 800. # resistance top leaky layer in days
ztop = 0. # surface elevation
z_wel... |
NYUDataBootcamp/Materials | Code/notebooks/bootcamp_graphics_s17_MBA.ipynb | mit | # make plots show up in notebook
%matplotlib inline
import pandas as pd # data package
import matplotlib.pyplot as plt # pyplot module
"""
Explanation: Python graphics: Matplotlib fundamentals
We illustrate three approaches to graphing data with Python's Matplotlib pack... |
daviddesancho/MasterMSM | examples/brownian_dynamics_1D/1D_smFS_MSM.ipynb | gpl-2.0 | %matplotlib inline
%load_ext autoreload
%autoreload 2
import time
import itertools
import h5py
import numpy as np
from scipy.stats import norm
from scipy.stats import expon
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import seaborn as sns
sns.set(style="ticks", color_codes=True, font_scale=1.5)
sns.set_s... |
deepmind/dm-haiku | examples/vqvae_example.ipynb | apache-2.0 | # Uncomment the line below if running on colab.research.google.com
# !pip install dm-haiku optax
import haiku as hk
import jax
import optax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds
tf.enable_v2_behavior()
print("JA... |
tensorflow/workshops | extras/tensorflow_lattice/03_calibrator_basics.ipynb | apache-2.0 | !pip install tensorflow_lattice
import tensorflow as tf
import tensorflow_lattice as tfl
import matplotlib.pyplot as plt
import numpy as np
import math
"""
Explanation: Basics of 1d calibrators
In this notebook, we'll explain one dimensional calibrators.
First we need to import libraries we're going to use.
End of exp... |
VectorBlox/PYNQ | Pynq-Z1/notebooks/examples/opencv_filters_webcam.ipynb | bsd-3-clause | from pynq import Overlay
Overlay("base.bit").download()
"""
Explanation: OpenCV Filters Webcam
In this notebook, several filters will be applied to webcam images.
Those input sources and applied filters will then be displayed either directly in the notebook or on HDMI output.
To run all cells in this notebook a webcam... |
usantamaria/iwi131 | ipynb/06-Funciones/Funciones.ipynb | cc0-1.0 | r = 0.2
area = 3.14*r**2
print "Circulo de radio", r, "[m] tiene area", area, "[m2]"
r = 1.0
area = 3.14*r**2
print "Circulo de radio", r, "[m] tiene area", area, "[m2]"
r = 42.0
area = 3.14*r**2
print "Circulo de radio", r, "[m] tiene area", area, "[m2]"
"""
Explanation: <header class="w3-container w3-teal">
<img src... |
darkomen/TFG | ipython_notebooks/02_resultados_filawinder/analisis.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
computational-class/cjc2016 | code/pandas_introduction.ipynb | mit | import pandas as pd
# learn more about pandas http://pandas.pydata.org/pandas-docs/stable/indexing.html
"""
Explanation: Pandas使用简介
使用pandas清洗泰坦尼克数据
End of explanation
"""
# Import the Pandas library
import pandas as pd
# Load the train and test datasets to create two DataFrames
train_url = "http://s3.amazonaws.com... |
sevo/pewe-presentations | Vyhodnocovanie.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import warnings
warnings.filterwarnings('ignore')
plt.rcParams['figure.figsize'] = 9, 6
"""
Explanation: Obsah
Trenovacia / testovacia / validacna vzorka
Krizova validacia
Metriky vyhodnocovania
Hyperparameter tu... |
statsmodels/statsmodels.github.io | v0.13.2/examples/notebooks/generated/glm_formula.ipynb | bsd-3-clause | import statsmodels.api as sm
import statsmodels.formula.api as smf
star98 = sm.datasets.star98.load_pandas().data
formula = "SUCCESS ~ LOWINC + PERASIAN + PERBLACK + PERHISP + PCTCHRT + \
PCTYRRND + PERMINTE*AVYRSEXP*AVSALK + PERSPENK*PTRATIO*PCTAF"
dta = star98[
[
"NABOVE",
"NBELOW",
... |
kubeflow/kfp-tekton-backend | samples/core/container_build/container_build.ipynb | apache-2.0 | def add(a: float, b: float) -> float:
'''Calculates sum of two arguments'''
print("Adding two values %s and %s" %(a, b))
return a + b
"""
Explanation: KubeFlow Pipelines - Container building
In this notebook, we will demo:
Buiding a container image to use as base image for component
Reference ... |
Kulbear/deep-learning-nano-foundation | mnist/Handwritten Digit Recognition with TFLearn.ipynb | mit | # Import Numpy, TensorFlow, TFLearn, and MNIST data
import numpy as np
import tensorflow as tf
import tflearn
import tflearn.datasets.mnist as mnist
"""
Explanation: Handwritten Number Recognition with TFLearn and MNIST
In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9.
This... |
srcole/qwm | burrito/Burrito_California.ipynb | mit | %config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: California burritos
Scott Cole
27 August 2016
This notebook formats t... |
Neuroglycerin/neukrill-net-work | notebooks/model_run_and_result_analyses/Analysing Network-Copy1.ipynb | mit | import pylearn2.utils
import pylearn2.config
import theano
import neukrill_net.dense_dataset
import neukrill_net.utils
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import holoviews as hl
%load_ext holoviews.ipython
import sklearn.metrics
"""
Explanation: Goals of this notebook. Take our best m... |
thiagoqd/queirozdias-deep-learning | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
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[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
txemis/txemis.github.io | Hello,_Colaboratory.ipynb | mit | import tensorflow as tf
input1 = tf.ones((2, 3))
input2 = tf.reshape(tf.range(1, 7, dtype=tf.float32), (2, 3))
output = input1 + input2
with tf.Session():
result = output.eval()
result
"""
Explanation: View in Colaboratory
<img height="60px" src="https://colab.research.google.com/img/colab_favicon.ico" align="le... |
f-guitart/data_mining | notes/04 - Pandas Data Structures.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
"""
Explanation: Pandas Data Structures
End of explanation
"""
d = {'a':5.,'b':5.,'c':5.}
i = ['x','y','z']
s1 = pd.Series(d)
print(s1)
s1.index
"""
Explanation: Understanding language's data structures is the most important part for a good programming experience. Poor underst... |
diging/tethne-notebooks | Feature Co-Occurrence.ipynb | gpl-3.0 | from tethne.networks import features
"""
Explanation: Networks of features based on co-occurrence
The features module in the tethne.networks subpackage contains a few functions for generating networks of features based on co-occurrence.
End of explanation
"""
corpus.index_feature('abstract', tokenize=lambda x: x.spl... |
dinrker/PredictiveModeling | Session 1 - Linear_Regression.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation:
End of explanation
"""
#############################################################
# Demonstration - What do Residuals Look Like
#############################################################
np.random.seed(... |
peterchow90/DLND_Projects | Project3_tv_Script_Gen/dlnd_tv_script_generation.ipynb | mit | """
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[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
ShubhamDebnath/Coursera-Machine-Learning | Course 2/Initialization.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import sklearn
import sklearn.datasets
from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation
from init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec
%matplotlib inline
plt.rcParams['f... |
reata/MachineLearning | Logistic Regression.ipynb | mit | import numpy as np
from sklearn import linear_model, datasets
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
%matplotlib inline
"""
Explanation: 分类和逻辑回归 Classification and Logistic Regression
引入科学计算和绘图相关包:
End of explanation
"""
x = np.arange(-10., 10., 0.2)
y = 1 / (1 + np.e ** (... |
pdamodaran/yellowbrick | examples/exbald/data/testing.ipynb | apache-2.0 | import pandas as pd
%matplotlib inline
dataset = pd.read_csv('dataset.csv')
dataset.head(5)
dataset.count_total.describe()
#add a new column to create a binary class for room occupancy
countmed = dataset.count_total.median()
dataset['room_occupancy'] = dataset['count_total'].apply(lambda x: 'occupied' if x > 4 els... |
valentina-s/GLM_PythonModules | notebooks/NHPoissonProcesses.ipynb | bsd-2-clause | N = 10000# number of observations
d = 5 # number of covariates
"""
Explanation: Parameter Estimation in Poisson Processes
Let $Y(t)$ be a non-homogeneous Poisson process on $[0,T]$ with a conditional intensity $\lambda(t)$, and cumulative intensity $\Lambda(t) = \int_0^t\lambda(t)dt$. Then the number of events occur... |
0ppen/introhacking | Exercise Solutions.ipynb | mit | def convert(number):
return str(number), bin(number), hex(number)
convert(0b1001)
"""
Explanation: Selected Exercise Solutions
3. Thinking in Binary
2.
A simple solution:
End of explanation
"""
def convert2(string_number):
if string_number[1] == "x":
num = int(string_number, 16)
return str(n... |
silburt/rebound2 | ipython_examples/Forces.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.integrator = "whfast"
sim.add(m=1.)
sim.add(m=1e-6,a=1.)
sim.move_to_com() # Moves to the center of momentum frame
"""
Explanation: Additional forces
REBOUND is a gravitational N-body integrator. But you can also use it to integrate systems with additional, non-gravitatio... |
walkon302/CDIPS_Recommender | notebooks/.ipynb_checkpoints/Plotting_Sequences_in_low_dimensions-checkpoint.ipynb | apache-2.0 | # our lib
from lib.resnet50 import ResNet50
from lib.imagenet_utils import preprocess_input, decode_predictions
#keras
from keras.preprocessing import image
from keras.models import Model
import glob
def preprocess_img(img_path):
img = image.load_img(img_path, target_size=(224, 224))
x = image.img_to_array(... |
mayankjohri/LetsExplorePython | Section 1 - Core Python/Chapter 14 - Properties/property.ipynb | gpl-3.0 | CONST = 10 # some constant
class Weather_balloon():
temp = 222
def convert_temp_to_f(self):
return self.temp * CONST
w = Weather_balloon()
w.temp = 122
print(w.convert_temp_to_f())
class Circle():
area = None
radius = None
def __init__(self, radius):
self.radius = radius
... |
bgroveben/python3_machine_learning_projects | learn_kaggle/pandas/pandas_cookbook.ipynb | mit | import pandas as pd
import numpy as np
"""
Explanation: Pandas Cookbook
End of explanation
"""
df = pd.DataFrame({'AAA' : [4,5,6,7],
'BBB' : [10,20,30,40],
'CCC' : [100,50,-30,-50]})
df
"""
Explanation: Idioms
If-then-else
Override calculations and reassign variables:
End of expl... |
GoogleCloudPlatform/mlops-with-vertex-ai | 05-continuous-training.ipynb | apache-2.0 | import json
import os
import logging
import tensorflow as tf
import tfx
import IPython
logging.getLogger().setLevel(logging.INFO)
print("Tensorflow Version:", tfx.__version__)
"""
Explanation: 05 - Continuous Training
After testing, compiling, and uploading the pipeline definition to Cloud Storage, the pipeline is ... |
nwfpug/meetings | 2017-05-08/widgets_list.ipynb | gpl-3.0 | import ipywidgets as widgets
"""
Explanation: Widget List (verbatim from the github page of ipywidgets)
End of explanation
"""
widgets.IntSlider(
value=7,
min=0,
max=10,
step=1,
description='Test:',
disabled=False,
continuous_update=False,
orientation='horizontal',
readout=True,
... |
phoebe-project/phoebe2-docs | 2.3/tutorials/LP.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: 'lp' (Line Profile) Datasets and Options
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
logger = phoebe.logger()
b ... |
gastonstat/stat259 | tutorials/genotypes.ipynb | mit | genos = ['AA', 'GG', 'AG', 'AG', 'GG']
genos_new = []
# Use your knowledge of if/else statements and loop structures below.
"""
Explanation: Python Basics
This notebook will allow you to practice some basic skills for using python: working with different data types, using various data structures, reading and writing t... |
jpilgram/phys202-2015-work | assignments/assignment05/InteractEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
"""
Explanation: Interact Exercise 01
Import
End of explanation
"""
def print_sum(a, b):
"""Print the sum of the arguments a and b."""
... |
befelix/Safe-RL-Benchmark | examples/GettingStarted.ipynb | mit | # import the classes we need
from SafeRLBench.envs import LinearCar
from SafeRLBench.policy import LinearPolicy
from SafeRLBench.algo import PolicyGradient
# get an instance of `LinearCar` with the default arguments.
linear_car = LinearCar()
# we need a policy which maps R^2 to R
policy = LinearPolicy(2, 1)
# setup pa... |
seg/2016-ml-contest | itwm/Facies_classification_ITWM_01.ipynb | apache-2.0 | %matplotlib notebook
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
import random
from sklearn.kernel_ridge import KernelRidge
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import f1_score, confusion_matrix
import classification_utilities as ut... |
bhermanmit/openmc | docs/source/examples/mg-mode-part-ii.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import os
import openmc
%matplotlib inline
"""
Explanation: The previous Notebook in this series used multi-group mode to perform a calculation with previously defined cross sections. However, in many circumstances the multi-group data is not given and one must ins... |
jmquintana/-git-clone-https-github.com-ksoichiro-Android-ObservableScrollView | DS_Bitácora_10_Clases.ipynb | apache-2.0 | class Persona:
"""
Esta es una clase donde se agregan todos los datos
respecto a una persona
"""
def __init__(self, nombre, edad):
# Todo lo que definamos en __init__ se corre
# al crear una instancia de la clase
self.nombre = nombre
self.edad = edad
"""
Explanation:... |
tensorflow/docs-l10n | site/zh-cn/tensorboard/get_started.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... |
KMFleischer/PyEarthScience | Visualization/matplotlib/PyEarthScience_xy_matplotlib.ipynb | mit | #-- load python packages
import numpy as np
from matplotlib import pyplot as plt
"""
Explanation: PyEarthScience: Python examples for Earth Scientists
XY-plots
Using matplotlib
Line plot with
- marker
- different colors
- legend
- title
- x-axis label
- y-axis label
End of explanation
"""
%matplotlib inline
"""
Ex... |
materialsvirtuallab/matgenb | notebooks/2013-01-01-Units.ipynb | bsd-3-clause | import pymatgen as mg
#The constructor is simply the value + a string unit.
e = mg.Energy(1000, "Ha")
#Let's perform a conversion. Note that when printing, the units are printed as well.
print "{} = {}".format(e, e.to("eV"))
#To check what units are supported
print "Supported energy units are {}".format(e.supported_uni... |
andrzejkrawczyk/python-course | workshops/Gr4-31-07-2018/Tresci zadan.ipynb | apache-2.0 | assert duplicates((1, 1, 2, 3, 4, 5, 6, 8, 2, 4, -7, 12, -7)) == (1, 2, 4, -7)
assert duplicates([1, 1, 2, 3, 4, 5, "asd", 8, "asd", 4, -7, 12, -7]) == (1, 2, 4, "asd", -7)
"""
Explanation: Napisz funkcje, ktora znajdzie duplikaty w kolekcji
Napisz za pomoca jednego polecenia wyswietlenie 300-krotne liczby "1.44e+4+50... |
DistrictDataLabs/yellowbrick | examples/ndanielsen/Yellowbrick in the Flower Garden.ipynb | apache-2.0 | # read the iris data into a DataFrame
import pandas as pd
url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'
col_names = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species']
iris = pd.read_csv(url, header=None, names=col_names)
iris.head()
"""
Explanation: Using Yello... |
NeuralEnsemble/elephant | doc/tutorials/parallel.ipynb | bsd-3-clause | import numpy as np
import quantities as pq
from elephant.spike_train_generation import homogeneous_poisson_process
from elephant.statistics import mean_firing_rate, time_histogram
from elephant.parallel import SingleProcess, ProcessPoolExecutor
try:
import mpi4py
from elephant.parallel.mpi import MPIPoolExec... |
metpy/MetPy | v0.10/_downloads/e379551d6fc4f1810666043df78073ac/upperair_soundings.ipynb | bsd-3-clause | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import Hodograph, SkewT
from metpy.units import units
"""
Explanation: Upper Air Sounding Tutorial
Uppe... |
dwhswenson/openpathsampling | examples/tests/storage_mem_test.ipynb | mit | tmpl = paths.engines.openmm.tools.snapshot_from_pdb('../resources/AD_initial_frame.pdb')
"""
Explanation: Test for caching of storage
Create the template from a .pdb file
End of explanation
"""
st = paths.Storage('memtest.nc', template=tmpl, mode='w')
"""
Explanation: Create a fresh storage
End of explanation
"""
... |
edosedgar/xs-pkg | NLAhw/hw2/kaziakhmedov_edgar_2.ipynb | gpl-2.0 | # Implement function in the ```pset2.py``` file
from pset2 import band_lu
import scipy.sparse
import scipy as sp # can be used with broadcasting of scalars if desired dimensions are large
import numpy as np
import scipy.linalg as lg
import time
import matplotlib.pyplot as plt
%matplotlib inline
def build_diag(diag_bro... |
seanpquig/study-group | nn-from-scratch/MNIST-nn-scipy.ipynb | mit | # Import libraries
import numpy as np
import scipy.io
import matplotlib.pyplot as plt
import math
from scipy.optimize import fmin_l_bfgs_b
from sklearn.metrics import accuracy_score
import pickle
"""
Explanation: A neural network from first principles
The code below was adpated from the code supplied in Andrew Ng's Co... |
jcmgray/xarray | examples/xarray_multidimensional_coords.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pandas as pd
import xarray as xr
import cartopy.crs as ccrs
from matplotlib import pyplot as plt
print("numpy version : ", np.__version__)
print("pandas version : ", pd.__version__)
print("xarray version : ", xr.version.version)
"""
Explanation: Working with Multidimens... |
minxuancao/shogun | doc/ipython-notebooks/classification/HashedDocDotFeatures.ipynb | gpl-3.0 | %matplotlib inline
import os
SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data')
from modshogun import StringCharFeatures, RAWBYTE, HashedDocDotFeatures, NGramTokenizer
"""
Explanation: Large scale document classification with the Shogun Machine Learning Toolbox
By Evangelos Anagnostopoulos (GitHub ID: <a hr... |
Vvkmnn/books | AutomateTheBoringStuffWithPython/lesson27.ipynb | gpl-3.0 | import re
beginsWithTheHelloRegex = re.compile(r'^Hello') # String must start exactly with 'Hello'
print(beginsWithTheHelloRegex.findall('Hello there'))
print(beginsWithTheHelloRegex.findall('Wait, did he say Hello just now?'))
print(beginsWithTheHelloRegex.findall('He said Hello'))
endsWithTheHelloRegex = re.compil... |
pyexcel/pyexcel-chart | notebook/life expectancy.ipynb | bsd-3-clause | import pyexcel as p
from IPython.display import HTML, display
sheet = p.get_sheet(url='https://raw.githubusercontent.com/pyexcel/pyexcel-chart/master/API_SP.DYN.LE00.IN_DS2_en_csv_v2.csv')
sheet.top_left()
"""
Explanation: Data visualization on life expectancy using pyexcel and pyexcel-chart
Data source: Life Expectan... |
jochym/abinitio-workshop | notebooks/01_Wizualizacja.ipynb | cc0-1.0 | diament=bulk(name='C', crystalstructure='diamond', a=4, cubic=True)
ase.io.write('diament.png', # Nazwa pliku
diament, # obiekt zawierający definicję struktury
show_unit_cell=2, # Rysowanie komórki elementarnej
rotation='115y,15x', # Obrót 115st wokół osi Y i... |
cgivre/oreilly-sec-ds-fundamentals | Notebooks/Visualization/Data Visualization Worksheet - Answers.ipynb | apache-2.0 | data = pd.read_csv('../../data/dailybots.csv')
data.head()
"""
Explanation: Data Visualization Worksheet
This worksheet will walk you through the basic process of preparing a visualization using Python/Pandas/Matplotlib.
For this exercise, we will be creating a line plot comparing the number of hosts infected by the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.