repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
Lattecom/HYStudy | scripts/[HYStudy 26th] Decorator Pattern 1.ipynb | mit | def mean(first, second, *rest):
"""평균값 반환 함수"""
numbers = (first, second) + rest
return sum(numbers) / len(numbers)
"""
Explanation: Decorator Pattern 1
End of explanation
"""
(1, 2) + (3,)
"""
Explanation: Tip. 튜플 결합
End of explanation
"""
def float_args_and_return(function):
def wrapper(*args, *... |
yvesdubief/UVM-ME249-CFD | .ipynb_checkpoints/ME249-Pb1-steady-laminar-channel-flow-Copy1-checkpoint.ipynb | gpl-2.0 | PDF('figures/channel.pdf',size=(200,400))
"""
Explanation: <h1>Steady Laminar Channel Flow</h1>
The objective of this first assignment is to compute the well-known Poiseuille velocity profile in a channel flow. Assuming that the channel length and width are both very large, the governing equations for an incompressib... |
ixkael/AstroHackWeek2015 | day1/day1_io.ipynb | gpl-2.0 | import os
import numpy as np
import requests
# get some CSV data from the SDSS SQL server
URL = "http://skyserver.sdss.org/dr12/en/tools/search/x_sql.aspx"
cmd = """
SELECT TOP 1000
p.u, p.g, p.r, p.i, p.z, s.class, s.z, s.zerr
FROM
PhotoObj AS p
JOIN
SpecObj AS s ON s.bestobjid = p.objid
WHERE
p.u BE... |
AllenDowney/ModSimPy | notebooks/chap15.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/labs/1b_prepare_data_babyweight.ipynb | apache-2.0 | import os
from google.cloud import bigquery
"""
Explanation: LAB 2b: Prepare babyweight dataset.
Learning Objectives
Setup up the environment
Preprocess natality dataset
Augment natality dataset
Create the train and eval tables in BigQuery
Export data from BigQuery to GCS in CSV format
Introduction
In this noteboo... |
google/starthinker | colabs/dbm_to_storage.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: DV360 Report To Storage
Move existing DV360 report into a Storage bucket.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may ... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/green_truck.ipynb | apache-2.0 | import sys
try:
import docplex.mp
except:
raise Exception('Please install docplex. See https://pypi.org/project/docplex/')
"""
Explanation: Use decision optimization to help a trucking company manage its shipments.
This tutorial includes everything you need to set up decision optimization engines, build mathem... |
laurentperrinet/elasticite | posts/2015-02-26-elastic-grids-of-edges.ipynb | mit | import moviepy.editor as mpy
from elasticite import EdgeGrid
e = EdgeGrid()
"""
Explanation: Dans un notebook précédent, on a vu comment créer une grille hexagonale et comment l'animer.
On va maintenant utiliser MoviePy pour animer ces plots.
<!-- TEASER_END -->
End of explanation
"""
import os
name = 'sinc_vispy'
... |
tensorflow/docs-l10n | site/zh-cn/model_optimization/guide/quantization/training_comprehensive_guide.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... |
diegocavalca/Studies | programming/Python/tensorflow/exercises/Seq2Seq.ipynb | cc0-1.0 | # Inputs and outputs: ten digits
x = tf.placeholder(tf.int32, shape=(32, 10))
y = tf.placeholder(tf.int32, shape=(32, 10))
# One-hot encoding
enc_inputs = tf.one_hot(x, 10)
dec_inputs = tf.concat((tf.zeros_like(y[:, :1]), y[:, :-1]), -1)
dec_inputs = tf.one_hot(dec_inputs, 10)
# encoder
encoder_cell = tf.contrib.rnn.... |
leedtan/SparklesSunshinePuppies | plots/notebook.ipynb | mit | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
import plotly.offline as py
py.init_notebook_mode(connected=True)
import plotly.graph_objs as go
import plotly.tools as tls
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: Introduction
Mac... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 4 Stats for data analysis/Lectures notebooks/10 non-parametric tests rel/stat.non_parametric_tests_rel.ipynb | mit | import numpy as np
import pandas as pd
import itertools
from scipy import stats
from statsmodels.stats.descriptivestats import sign_test
from statsmodels.stats.weightstats import zconfint
%pylab inline
"""
Explanation: Непараметрические криетрии
Критерий | Одновыборочный | Двухвыборочный | Двухвыборочный (связанные ... |
JKeun/lecture-statistics | .ipynb_checkpoints/ch07-continuous-probability-distributioin-checkpoint.ipynb | mit | import numpy as np
import scipy.stats as sp
import matplotlib.pylab as plt
mu1 = 90; mu2 = 60; std1 = 5; std2 = 10
rv1 = sp.norm(mu1, std1); rv2 = sp.norm(mu2, std2)
xx1 = np.linspace(70, 110, 100); xx2 = np.linspace(30, 90, 100)
fig = plt.figure(figsize=(8, 3))
plt.subplot(1, 2, 1)
plt.plot(xx1, rv1.pdf(xx1))
plt.t... |
mne-tools/mne-tools.github.io | 0.20/_downloads/03db2d983950efa77a26beb0ac22b422/plot_20_rejecting_bad_data.ipynb | bsd-3-clause | import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_filt-0-40_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False)
events_file = os.path.join(sample_data... |
hparik11/Deep-Learning-Nanodegree-Foundation-Repository | sentiment-rnn/.ipynb_checkpoints/Sentiment_RNN-checkpoint.ipynb | mit | import numpy as np
import tensorflow as tf
with open('../sentiment-network/reviews.txt', 'r') as f:
reviews = f.read()
with open('../sentiment-network/labels.txt', 'r') as f:
labels = f.read()
reviews[:2000]
"""
Explanation: Sentiment Analysis with an RNN
In this notebook, you'll implement a recurrent neural... |
kimkipyo/dss_git_kkp | Python 복습/13일차.목_pandas + SQL/13일차_3T_Pandas로 배우는 SQL 시작하기 (3) - GROUP BY.ipynb | mit | import pymysql
db = pymysql.connect(
"db.fastcamp.us",
"root",
"dkstncks",
"sakila",
charset='utf8',
)
rental_df = pd.read_sql("SELECT * FROM rental;", db)
rental_df = rental_df[["rental_id", "rental_date"]]
rental_df["month"] = rental_df["rental_date"].apply(lambda x: str(x)[:7])
re... |
statsmodels/statsmodels | examples/notebooks/statespace_forecasting.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
macrodata = sm.datasets.macrodata.load_pandas().data
macrodata.index = pd.period_range('1959Q1', '2009Q3', freq='Q')
"""
Explanation: Forecasting in statsmodels
This notebook describes forecasting u... |
martinjrobins/hobo | examples/optimisation/multi-objective.ipynb | bsd-3-clause | import pints
import pints.toy as toy
import numpy as np
import matplotlib.pyplot as plt
# Create two models with a different initial population size
model_1 = toy.LogisticModel(initial_population_size=15)
model_2 = toy.LogisticModel(initial_population_size=2)
# Both models share a single set of parameters: it's the s... |
SSDS-Croatia/SSDS-2017 | Day-2/classification/mnist.ipynb | mit | import tensorflow as tf
tf.set_random_seed(1337)
"""
Explanation: This is a basic TensorFlow tutorial on image classification
End of explanation
"""
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
"""
Explanation: The MNIST dataset
Contains i... |
metpy/MetPy | v0.11/_downloads/62a1acd718d4c5b9717787544d4cf09f/Gradient.ipynb | bsd-3-clause | import numpy as np
import metpy.calc as mpcalc
from metpy.units import units
"""
Explanation: Gradient
Use metpy.calc.gradient.
This example demonstrates the various ways that MetPy's gradient function
can be utilized.
End of explanation
"""
data = np.array([[23, 24, 23],
[25, 26, 25],
... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/dev/.ipynb_checkpoints/n05_missing_data-checkpoint.ipynb | mit | import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
%matplotlib inline
%pylab inline
pylab.rcParams['figure.figsize'] = (20.0, 10.0)
%load_ext a... |
VVard0g/ThreatHunter-Playbook | docs/notebooks/windows/05_defense_evasion/WIN-190101151110.ipynb | mit | from openhunt.mordorutils import *
spark = get_spark()
"""
Explanation: Active Directory Replication User Backdoor
Metadata
| Metadata | Value |
|:------------------|:---|
| collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] |
| creation date | 2019/01/01 |
| modification date | 2020/09/20 |
| playboo... |
bearing/dosenet-analysis | Class Notebooks/Air Quality Activity.ipynb | mit | # Plotting related python libraries
import matplotlib.pyplot as plt
# Standard csv python library
import csv
# Main python library for mathematical calculations
import numpy as np
# Python libraries for manipulating dates and times as objects
import time
import datetime
import dateutil
from IPython.display import M... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/ukesm1-0-mmh/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'ukesm1-0-mmh', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NERC
Source ID: UKESM1-0-MMH
Topic: Atmoschem
Sub-Topics: Transport, Emis... |
methylDragon/news-anaCrawler | Experiments/Printing Colour.ipynb | gpl-3.0 | print("\x1b[31m\"red\"\x1b[0m")
print('\x1b[1;31m'+'Hello world'+'\x1b[0m')
import sys
from termcolor import colored, cprint
text = colored('Hello, World!', 'red', attrs=['reverse', 'blink'])
print(text)
cprint('Hello, World!', 'green', 'on_red')
print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan')
print_red_o... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/launching_into_ml/labs/python.BQ_explore_data.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: Exploratory Data Analysis Using Python and BigQuery
Learning Objectives
Analyze a Pandas Dataframe
Create Seaborn plots for Exploratory Data Analysis in Python
Write a SQL query to p... |
ghvn7777/ghvn7777.github.io | content/fluent_python/5_1_function.ipynb | apache-2.0 | def factorial(n):
'''return n!'''
return 1 if n < 2 else n * factorial(n - 1)
factorial(42)
factorial.__doc__
type(factorial)
"""
Explanation: 这篇文章需要看 ipynb 文件,这个 html 没有转换全,而且还有很多格式不对
在 Python 中,函数是一等对象。编程语言理论家把 “一等对象” 定义为满足下面条件的程序实体:
在运行时创建
能赋值给变量或者数据结构中的元素
能作为参数传给函数
能作为函数返回结果
Python 中,整数、字符串和字典都是一等对象。人... |
ES-DOC/esdoc-jupyterhub | notebooks/dwd/cmip6/models/sandbox-1/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'dwd', 'sandbox-1', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: DWD
Source ID: SANDBOX-1
Sub-Topics: Radiative Forcings.
Properties: 85 (42 re... |
chubbymaggie/almc | order_extend/boat_example.ipynb | gpl-2.0 | %matplotlib inline
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from model import OrderExtend
img = ndimage.imread('images/boat.jpeg', flatten=True)
img /= np.max(img) #normalize image [0,1]
plt.imshow(img, cmap = cm.Greys_r)
"""
Explanation: OrderExtend ... |
dwhswenson/contact_map | examples/performance.ipynb | lgpl-2.1 | %matplotlib inline
# dask and distributed are extra installs
from dask.distributed import Client, LocalCluster
import matplotlib.pyplot as plt
import mdtraj as md
traj = md.load("5550217/kras.xtc", top="5550217/kras.pdb")
topology = traj.topology
"""
Explanation: Improving performance
End of explanation
"""
from con... |
QuantScientist/Deep-Learning-Boot-Camp | day02-PyTORCH-and-PyCUDA/PyTorch/21-PyTorch-CIFAR-10-Custom-data-loader-from-scratch.ipynb | mit | # !pip install pycuda
%reset -f
import numpy
import numpy as np
from __future__ import print_function
from __future__ import division
import math
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
import os
import torch
from torch.utils.data.dataset import Dataset
from torch.utils... |
GoogleCloudPlatform/ml-design-patterns | 05_resilience/nlp_api.ipynb | apache-2.0 | %pip install --upgrade --quiet apache-beam[gcp]
"""
Explanation: Invoking an ML API
This notebook demonstrates how to invoke a deployed ML model (in this case, the Google Cloud Natural Language API)
from a batch or streaming pipeline
We will use Apache Beam.
Install Beam
Restart the kernel after installing Beam
End of... |
yevheniyc/Python | 1m_ML_Security/notebooks/day_1/Worksheet 2 - Exploring Two Dimensional Data.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
%pylab inline
"""
Explanation: Worksheet 2: Exploring Two Dimensional Data
Import the Libraries
For this exercise, we will be using:
* Pandas (http://pandas.pydata.org/pandas-docs/stable/)
* Numpy (https://docs.scipy.org/do... |
fionapigott/Data-Science-45min-Intros | pos-tagging/pos-tagging-accuracy.ipynb | unlicense | from pprint import pprint
"""
Explanation: Outline
Collect some tweets
Annotate the tweets
Calculate the accuracy
End of explanation
"""
# we'll use data from a job that collected tweets about parenting
tweet_bodies = [body for body in open('tweet_bodies.txt')]
# sanity checks
pprint(len(tweet_bodies))
# sanity ... |
miaecle/deepchem | examples/tutorials/21_Introduction_to_Bioinformatics.ipynb | mit | %tensorflow_version 1.x
!curl -Lo deepchem_installer.py https://raw.githubusercontent.com/deepchem/deepchem/master/scripts/colab_install.py
import deepchem_installer
%time deepchem_installer.install(version='2.3.0')
"""
Explanation: Tutorial Part 21: Introduction to Bioinformatics
So far in this tutorial, we've primar... |
mommermi/Introduction-to-Python-for-Scientists | notebooks/Functions_Modules_StandardLibrary.ipynb | mit | def area_circle(radius, pi=3.14):
"""determine area of a circle, given its radius""" # documentation!
return pi*radius*radius
print area_circle(3) # uses the default value of 'pi'
print area_circle(3, pi=3) # uses your own value of 'pi'
print area_circle.__doc__
"""
Explanation: Functions, Modules, and th... |
jsignell/MpalaTower | inspection/.ipynb_checkpoints/data_dictionary-checkpoint.ipynb | mit | from __future__ import print_function
import pandas as pd
import datetime as dt
import numpy as np
import os
import xray
from posixpath import join
ROOTDIR = 'C:/Users/Julia/Documents/GitHub/MpalaTower/raw_netcdf_output/'
data = 'Table1'
datas = ['upper', 'Table1', 'lws', 'licor6262', 'WVIA',
'Manifold', 'fl... |
jsharpna/DavisSML | lectures/lecture9/lecture9p2.ipynb | mit | import os
import matplotlib.pyplot as plt
import tensorflow as tf
import pandas as pd
print("TensorFlow version: {}".format(tf.__version__))
print("Eager execution: {}".format(tf.executing_eagerly()))
"""
Explanation: Classification with Tensorflow
Davis SML: Lecture 9 Part 2
Prof. James Sharpnack
Importing and insta... |
Islast/BrainNetworksInPython | tutorials/global_network_viz.ipynb | mit | import scona as scn
import scona.datasets as datasets
import numpy as np
import networkx as nx
import pandas as pd
from IPython.display import display
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%load_ext autoreload
%autoreload 2
"""
Explanation: Gloabl network visualisation tutorial
In ... |
StephenHarrington/CS521 | Module 1.ipynb | mit | '''
This is a multi-line comment useful for module or overall program information.
Every assignment submission should include at the very beginning a multi-line
comment consisting of:
Name: Stephen Harrington
Course: CS521
Date: January 21, 2017
Assignment: Module #1 Extra Material - Simple Input... |
cloudedbats/cloudedbats_dsp | notebooks/experimental/zero_crossing_in_frequency_domain.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
# Math and sound processing.
import numpy as np
import pandas as pd
import scipy.signal
import wave
import librosa
import librosa.display
"""
Explanation: Zero Crossing - in frequency domain.
Zero Crossing is a great technique to process sound fast and to store it in... |
eford/rebound | ipython_examples/UniquelyIdentifyingParticles.ipynb | gpl-3.0 | import rebound
sim = rebound.Simulation()
sim.add(m=1.)
sim.add(a=0.32)
sim.add(a=1.)
sim.add(a=2.)
"""
Explanation: Uniquely Identifying Particles
In many cases, one can just identify particles by their position in the particle array, e.g. using sim.particles[5]. However, in cases where particles might get reordered ... |
mmaelicke/scikit-gstat | tutorials/07_maximum_likelihood_fit.ipynb | mit | import skgstat as skg
from skgstat.util.likelihood import get_likelihood
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import warnings
from time import time
import matplotlib.pyplot as plt
warnings.filterwarnings('ignore')
"""
Explanation: 7. Maximum Likelihood fit
End of expla... |
bataeves/kaggle | instacart/Model.ipynb | unlicense | priors = priors.join(orders, on='order_id', rsuffix='_')
priors = priors.join(products, on='product_id', rsuffix='_')
priors.drop(['product_id_', 'order_id_'], inplace=True, axis=1)
"""
Explanation: Features
https://www.kaggle.com/c/instacart-market-basket-analysis/discussion/35468
Here are some feature ideas that can... |
tensorflow/docs-l10n | site/ja/tutorials/generative/deepdream.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... |
mikekestemont/ghent1516 | Chapter 5 - Functions and Files.ipynb | mit | f = open('data/austen-emma-excerpt.txt', 'rt', 'utf-8')
text = f.read()
f.close()
print(text)
"""
Explanation: Chapter 5: Functions and Files
File Input/Output
Input for your programs often comes from files on your disk, such as 'corpora' (a 'corpus' is what we call a large collection of digital text in linguistics). ... |
biocommons/hgvs | examples/using-hgvs.ipynb | apache-2.0 | import hgvs
hgvs.__version__
"""
Explanation: Using hgvs
This notebook demonstrates major features of the hgvs package.
End of explanation
"""
# You only need to do this once per process
import hgvs.parser
hp = hgvsparser = hgvs.parser.Parser()
"""
Explanation: Variant I/O
Initialize the parser
End of explanation
"... |
drabastomek/learningPySpark | Chapter05/LearningPySpark_Chapter05.ipynb | gpl-3.0 | import pyspark.sql.types as typ
labels = [
('INFANT_ALIVE_AT_REPORT', typ.StringType()),
('BIRTH_YEAR', typ.IntegerType()),
('BIRTH_MONTH', typ.IntegerType()),
('BIRTH_PLACE', typ.StringType()),
('MOTHER_AGE_YEARS', typ.IntegerType()),
('MOTHER_RACE_6CODE', typ.StringType()),
('MOTHER_EDUCA... |
diegocavalca/Studies | phd-thesis/nilmtk/data.ipynb | cc0-1.0 | !! pip install -U Pillow==6.1.0
"""
Explanation: Convert data to NILMTK format and load into NILMTK
End of explanation
"""
from nilmtk.dataset_converters import convert_redd
convert_redd('../datasets/REDD/low_freq', '../datasets/REDD/low_freq.h5')
"""
Explanation: NILMTK uses an open file format based on the HDF5 b... |
bayesimpact/bob-emploi | data_analysis/notebooks/datasets/rome/update_from_v344_to_v345.ipynb | gpl-3.0 | import collections
import glob
import os
from os import path
import matplotlib_venn
import pandas as pd
rome_path = path.join(os.getenv('DATA_FOLDER'), 'rome/csv')
OLD_VERSION = '344'
NEW_VERSION = '345'
old_version_files = frozenset(glob.glob(rome_path + '/*{}*'.format(OLD_VERSION)))
new_version_files = frozenset(... |
NuGrid/NuPyCEE | ChETEC_school/GCE Lab 3 - Constrain Galaxy Model.ipynb | bsd-3-clause | # Import the standard Python packages
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
# Two-zone galactic chemical evolution code
import JINAPyCEE.omega_plus as omega_plus
# Matplotlib option
%matplotlib inline
"""
Explanation: GCE Lab 3 - Constrain Galaxy Model
This notebook presents how to plo... |
materialsvirtuallab/ceng114 | lectures/Statistical software demo.ipynb | bsd-2-clause | # Cumulative probability P(X<120) where X ~ N(100, 10^2)
print("P(X<120) where X ~ N(100, 10^2) = %.3f" % stats.norm.cdf(120, loc=100, scale=10))
# Calculate value
print("x for which P(X < x = 0.97) = %.1f" % stats.norm.ppf(0.97, loc=100, scale=10))
# Cumulative probability P(X<120) where X ~ N(100, 10^2)
print("P(X<... |
andrewosh/notebooks | worker/notebooks/thunder/tutorials/thunder_context.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('notebook')
from thunder import Colorize
image = Colorize.image
"""
Explanation: Thunder context
The ThunderContext is the entry point for loading data and interacting with remote services (e.g. Amazon).
Setup plotting
End of exp... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Class_07.ipynb | mit | # Initialize variables: y0, rho, w1
# Compute the period 1 value of y
# Print the result
"""
Explanation: Class 7: Deterministic Time Series Models
Time series models are at the foundatation of dynamic macroeconomic theory. A time series model is an equation or system of equations that describes how the variables... |
harishkrao/DSE200x | Week-7-MachineLearning/Weather Data Clustering using k-Means.ipynb | mit | from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
#import utils
import pandas as pd
import numpy as np
from itertools import cycle, islice
import matplotlib.pyplot as plt
from pandas.tools.plotting import parallel_coordinates
%matplotlib inline
"""
Explanation: <p style="font-family:... |
AEW2015/PYNQ_PR_Overlay | 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... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-lm/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-lm', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-LM
Topic: Atmoschem
Sub-Topics: Transport, Emissions ... |
tpin3694/tpin3694.github.io | python/pandas_join_merge_dataframe.ipynb | mit | import pandas as pd
from IPython.display import display
from IPython.display import Image
"""
Explanation: Title: Join And Merge Pandas Dataframe
Slug: pandas_join_merge_dataframe
Summary: Join And Merge Pandas Dataframe
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
import modules... |
dsm054/pandas | doc/source/user_guide/style.ipynb | bsd-3-clause | import matplotlib.pyplot
# We have this here to trigger matplotlib's font cache stuff.
# This cell is hidden from the output
import pandas as pd
import numpy as np
df = pd.DataFrame([[38.0, 2.0, 18.0, 22.0, 21, np.nan],[19, 439, 6, 452, 226,232]],
index=pd.Index(['Tumour (Positive)', 'Non-Tumour (N... |
srcole/qwm | burrito/Burrito_linear models.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 statsmodels.api as sm
import seaborn as sns
sns.set_style("white")
"""
Explanation: San Diego Burrito Analytics: Linear models
Scott Cole
21 May 2016
This... |
pucdata/pythonclub | sessions/06-mcmc/MCMC with emcee.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import emcee
import corner
"""
Explanation: MCMC Demonstration
Markov Chain Monte Carlo is a useful technique for fitting models to data and obtaining estimates for the uncertainties of the model parameters.
There are a slew of python modules and in... |
deepmind/reverb | examples/demo.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... |
simon-clematide/GDI-task-2017 | lib/dataprep_runs1and3.ipynb | mit | char_replacement = {u'é':u'e1', u'è':u'e2', u'ẽ':u'e3',
u'ò':u'o2', u'õ':u'o2',
u'ú':u'u1', u'ù':u'u2',
u'à':u'a2', u'ã':u'a3',
u'ǜ':u'ü2',
u'ì':u'i2',
}
def replace_ngraphs(s):
for old, new in [(... |
karlstroetmann/Formal-Languages | Ply/Exam-Evaluation.ipynb | gpl-2.0 | data = '''Class: Algorithms and Complexity
Group: TIT09AID
MaxPoints = 60
Exercise: 1. 2. 3. 4. 5. 6.
Jim Smith: 9 12 10 6 6 0
John Slow: 4 4 2 0 - -
Susi Sorglos: 9 12 12 9 9 6
'''
"""
Explanation: Evaluating an Exam Using... |
jgarciab/wwd2017 | class4/class4_timeseries.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import pylab as plt
import seaborn as sns
from scipy.stats import chi2_contingency,ttest_ind
#This allows us to use R
%load_ext rpy2.ipython
#Visualize in line
%matplotlib inline
#Be able to plot images saved in the hard drive
from IPython.display import Image,display
#Make t... |
JanetMatsen/Machine_Learning_CSE_546 | HW1/Q7_lasso/Q7-4-1_useful_features_regularization_path.ipynb | mit | # Load a text file of integers:
y = np.loadtxt("yelp_data/upvote_labels.txt", dtype=np.int)
# Load a text file with strings identifying the 1000 features:
featureNames = open("yelp_data/upvote_features.txt").read().splitlines()
featureNames = np.array(featureNames)
# Load a csv of floats, which are the values of 1000 f... |
turbomanage/training-data-analyst | quests/dei/xgboost_caip_e2e.ipynb | apache-2.0 | #You'll need to install XGBoost on the TF instance
!pip3 install xgboost witwidget --user
"""
Explanation: Cloud AI Platform + What-if Tool: end-to-end XGBoost example
This notebook shows how to:
* Build a binary classification model with XGBoost trained on a mortgage dataset
* Deploy the model to Cloud AI Platform
*... |
Bio204-class/bio204-notebooks | inclass-2016-03-23-PandasMatplotlib-Refresher-Seaborn.ipynb | cc0-1.0 | premieAndSmoke = births.query('(premature == "premie") and (smoke == "smoker")')
premieAndSmoke
"""
Explanation: query
The DataFrame.query method provides another interface for querying the columns of a DataFrame with a Boolean expression. It is convenient because it allows for more compact expressions.
End of explan... |
sdpython/ensae_teaching_cs | _doc/notebooks/2a/ml_timeseries_base.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
"""
Explanation: 2A.ml - Timeseries et machine learning
Série temporelle et prédiction. Module statsmodels.
End of explanation
"""
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: Les séries temporelles diffèrent des problèmes de mac... |
NeuroDataDesign/fngs | docs/02agarwalt/project1/week_0424/specs.ipynb | apache-2.0 | %%script false
## disklog.sh
#!/bin/bash -e
# run this in the background with nohup ./disklog.sh > disk.txt &
#
while true; do
echo "$(du -s $1 | awk '{print $1}')"
sleep 30
done
##cpulog.sh
import psutil
import time
import argparse
def cpulog(outfile):
with open(outfile, 'w') as outf:
while(Tr... |
ucsd-ccbb/jupyter-genomics | notebooks/awsCluster/BasicCFNClusterSetup.ipynb | mit | import os
import sys
sys.path.append(os.getcwd().replace("notebooks/awsCluster", "src/awsCluster"))
## Input the AWS account access keys
aws_access_key_id = "/**aws_access_key_id**/"
aws_secret_access_key = "/**aws_secret_access_key**/"
## CFNCluster name
your_cluster_name = "cluster_name"
## The private key pair ... |
EmuKit/emukit | notebooks/Emukit-tutorial-multi-fidelity.ipynb | apache-2.0 | # General imports
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS)
%matplotlib inline
np.random.seed(20)
"""
Explanation: An Introduction to Multi-fidelity Modeling in Emukit
Overview
A common issue encountered when ... |
debsankha/network_course_python | talks/06-visualization.ipynb | gpl-2.0 | G = nx.Graph() #create a graph
G.add_nodes_from([0,1,2,3]) #add some nodes
G.add_edges_from([(0,1),(1,2),(2,3),(3,0)]) #add some edges
pos = {0:[1,1],1:[1,2],2:[2,3],3:[3,2]} #dictionary of positions
nx.draw_networkx(G,pos) #plot edges as lines, nodes as... |
seg/2016-ml-contest | MandMs/04_faciesClassification_MandMs_SFStop45_XGB_ypred.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import pandas as pd
import scipy as sp
from scipy.signal import medfilt
from sklearn import preprocessing
from sklearn.metrics import f1_score
from sklearn.model_selection import LeaveOneGroupOut
import xgboost as xgb
from xgboost.sklearn import XGBClassifier
import matplotlib... |
mne-tools/mne-tools.github.io | 0.19/_downloads/1af5a35cbb809b9480120842884536c5/plot_brainstorm_auditory.ipynb | bsd-3-clause | # Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: BSD (3-clause)
import os.path as op
import pandas as pd
import numpy as np
import mne
from mne import combine_evoked
from mne.minimum_norm impor... |
peterwittek/qml-rg | Archiv_Session_Spring_2018/Coding_Exercises/autoencoders.ipynb | gpl-3.0 | import numpy as np
from keras.datasets import mnist
from keras.layers import Input, Dense
from keras.models import Model
from sklearn import decomposition
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Autoencoders
End of explanation
"""
# this is our input placeholder
input_img = Input(shape=(7... |
dtamayo/reboundx | ipython_examples/TrackMinDistance.ipynb | gpl-3.0 | import rebound
import reboundx
import numpy as np
sim = rebound.Simulation()
sim.add(m=1., hash="Sun")
sim.add(a=1., e=0.5, f=np.pi)
rebx= reboundx.Extras(sim)
ps = sim.particles
"""
Explanation: Tracking a particle's minimum distance
While you can always check particles' states after every call to sim.integrate, you ... |
ericmjl/Network-Analysis-Made-Simple | archive/8-US-airports-case-study-instructor.ipynb | mit | %matplotlib inline
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import warnings
warnings.filterwarnings('ignore')
pass_air_data = pd.read_csv('datasets/passengers.csv')
"""
Explanation: Exploratory analysis of the US Airport Dataset
This dataset contains data for 25 yea... |
NYUDataBootcamp/Projects | UG_S16/Shu.ipynb | mit | import numpy.random as rand
import matplotlib.pyplot as plt
import pandas as pd
import sys
%matplotlib inline
print('Python version: ', sys.version)
print('Pandas version: ', pd.__version__)
plt.style.use('seaborn-dark-palette')
"""
Explanation: Visualizing Price Changes a la Reis (2006)
Richar... |
arcyfelix/Courses | 18-05-28-Complete-Guide-to-Tensorflow-for-Deep-Learning-with-Python/04-Recurrent-Neural-Networks/04-Word2Vec.ipynb | apache-2.0 | import collections
import math
import os
import errno
import random
import zipfile
import numpy as np
from six.moves import urllib
from six.moves import xrange
import tensorflow as tf
"""
Explanation: Word2Vec
The code for this lecture is based off the great tutorial example from tensorflow!
Walkthrough:
https://www... |
informatics-isi-edu/deriva-py | docs/derivapy-datapath-example-4.ipynb | apache-2.0 | # Import deriva modules and pandas DataFrame (for use in examples only)
from deriva.core import ErmrestCatalog, get_credential
from pandas import DataFrame
# Connect with the deriva catalog
protocol = 'https'
hostname = 'www.facebase.org'
catalog_number = 1
credential = None
# If you need to authenticate, use Deriva A... |
CNS-OIST/STEPS_Example | user_manual/source/surface_diffusion_boundary.ipynb | gpl-2.0 | import steps.model as smodel
import steps.geom as stetmesh
import steps.utilities.meshio as smeshio
import steps.rng as srng
import steps.solver as solvmod
import pylab
import math
"""
Explanation: Surface Diffusion Boundary
The simulation script described in this chapter is available at STEPS_Example repository.
Jus... |
sunsistemo/mozzacella-automato-salad | results-two-colors.ipynb | gpl-3.0 | # Plot Entropy of all rules against the langton parameter
ax1 = plt.gca()
d_five.plot("langton", "Entropy", ax=ax1, kind="scatter", marker='o', alpha=.5, s=40)
d_five_p10_90.plot("langton", "Entropy", ax=ax1, kind="scatter", color="r", marker='o', alpha=.5, s=40)
plt.show()
ax1 = plt.gca()
d_five.plot("langton", "Entr... |
graphistry/pygraphistry | demos/more_examples/graphistry_features/Workbooks.ipynb | bsd-3-clause | import time
from IPython.display import IFrame
"""
Explanation: Workbooks
Workbooks allow users to persist the analytic state of a visualization, including active filters, exclusions, and color encodings.
PyGraphistry users can set the workbook via .settings(url_params={'workbook': 'my_workbook_id'})
See bottom exam... |
QuantStack/quantstack-talks | 2019-05-22-pydata-frankfurt/notebooks/bqplot.ipynb | bsd-3-clause | from __future__ import print_function
from IPython.display import display
from ipywidgets import *
from traitlets import *
import numpy as np
import pandas as pd
import bqplot as bq
import datetime as dt
np.random.seed(0)
size = 100
y_data = np.cumsum(np.random.randn(size) * 100.0)
y_data_2 = np.cumsum(np.random.rand... |
dbkinghorn/blog-jupyter-notebooks | ML-Logistic-Regression-Multinomial.ipynb | gpl-3.0 | import pandas as pd # data handeling
import numpy as np # numerical computing
from scipy.optimize import minimize # optimization code
import matplotlib.pyplot as plt # plotting
import seaborn as sns
%matplotlib inline
sns.set()
import itertools # combinatorics functions for multinomial code
#
# Main Logistic R... |
plafl/notebooks | replication.ipynb | mit | import itertools
from abc import ABCMeta, abstractmethod
import numpy as np
def add_constraints(constraints):
"""Given a list of constraints combine them in a single one.
A constraint is a function that accepts a selection and returns True
if the selection is valid and False if not.
"""
if c... |
mathinmse/mathinmse.github.io | Lecture-21-Calculus-of-Variations.ipynb | mit | %matplotlib notebook
import sympy as sp
sp.init_printing()
f = sp.symbols('f', cls=sp.Function)
x, y = sp.symbols('x, y', real=True)
"""
Explanation: Lecture 21: The Calculus of Variations
What to Learn?
The concept of a "function of functions" and the definition of a functional
The concept of finding a function t... |
infilect/ml-course1 | keras-notebooks/Frameworks/2.1 Introduction - Theano.ipynb | mit | import theano
import theano.tensor as T
"""
Explanation: Theano
A language in a language
Dealing with weights matrices and gradients can be tricky and sometimes not trivial.
Theano is a great framework for handling vectors, matrices and high dimensional tensor algebra.
Most of this tutorial will refer to Theano howev... |
ercius/openNCEM | ncempy/data/L2083-K-4-1/ReconstructEDSTomo/ReconstructEDSTomo.ipynb | gpl-3.0 | import sys, os, shutil
import numpy as np
import matplotlib.pyplot as plt
import genfire
import ipyvolume
import os
# It annoys me that I have a large screen and these notebooks are a tiny -- narrow -- itsy bitsy column down the middle.
# The following two lines make jupyter notebook use the whole window! Comment the... |
tensorflow/privacy | tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/codelabs/codelab.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... |
tpin3694/tpin3694.github.io | machine-learning/one-vs-rest_logistic_regression.ipynb | mit | # Load libraries
from sklearn.linear_model import LogisticRegression
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
"""
Explanation: Title: One Vs. Rest Logistic Regression
Slug: one-vs-rest_logistic_regression
Summary: How to train a one-vs-rest logistic regression in scikit-learn.
Date... |
CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | Chapter4_TheGreatestTheoremNeverTold/Ch4_LawOfLargeNumbers_PyMC3.ipynb | mit | %matplotlib inline
import numpy as np
from IPython.core.pylabtools import figsize
import matplotlib.pyplot as plt
figsize( 12.5, 5 )
sample_size = 100000
expected_value = lambda_ = 4.5
poi = np.random.poisson
N_samples = range(1,sample_size,100)
for k in range(3):
samples = poi( lambda_, sample_size )
... |
1x0r/pspis | labs/PSPIS_lab_03.ipynb | mit | import numpy as np
import pandas as pd
"""
Explanation: Лабораторная работа №3
Тема работы: «Решение задачи классификации»
Цели работы
исследование процесса решения задачи классификации
изучение библиотек Python: scikit-learn и Pandas
Пояснения к работе
Ход работы
В своей рабочей папке открыть командное окно и запус... |
tensorflow/docs-l10n | site/zh-cn/tutorials/text/image_captioning.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... |
Kyubyong/numpy_exercises | 6_Linear_algebra_Solutions.ipynb | mit | import numpy as np
np.__version__
"""
Explanation: Linear algebra
End of explanation
"""
x = [1,2]
y = [[4, 1], [2, 2]]
print np.dot(x, y)
print np.dot(y, x)
print np.matmul(x, y)
print np.inner(x, y)
print np.inner(y, x)
"""
Explanation: Matrix and vector products
Q1. Predict the results of the following code.
En... |
zzsza/Datascience_School | 12. 추정 및 검정/02. 검정과 유의 확률.ipynb | mit | xx1 = np.linspace(-4, 4, 100)
xx2 = np.linspace(-4, -2, 100)
xx3 = np.linspace(2, 4, 100)
plt.subplot(3, 1, 1)
plt.fill_between(xx1, sp.stats.norm.pdf(xx1), facecolor='green', alpha=0.1)
plt.fill_between(xx2, sp.stats.norm.pdf(xx2), facecolor='blue', alpha=0.35)
plt.fill_between(xx3, sp.stats.norm.pdf(xx3), facecolor=... |
gregnordin/ECEn360_Winter2016 | temp/161014_super_resolution_with_documentation.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: G. Nordin<br>
October 14, 2016
Purpose
We need to accurately measure the image plane optical irradiance of the layer exposure images for the 3D printer we are developing. In the current implemenation, the pixel pitch in the image pl... |
fionapigott/Data-Science-45min-Intros | time-series/01 - Time series data in pandas.ipynb | unlicense | import random
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Time Series Data In Pandas
2017-02-03, Josh Montague
This is Part 1 of the "Time Series Modeling in Python" series. In this session, we spend time working through creation and manipulation of time series data in the ... |
davofis/computational_seismology | 06_finite_elements/fe_static_elasticity.ipynb | gpl-3.0 | # Import all necessary libraries, this is a configuration step for the exercise.
# Please run it before the simulation code!
import numpy as np
import matplotlib.pyplot as plt
# Show the plots in the Notebook.
plt.switch_backend("nbagg")
"""
Explanation: <div style='background-image: url("../../share/images/header.sv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.