repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
turbomanage/training-data-analyst | courses/machine_learning/deepdive/11_taxifeateng/tftransform.ipynb | apache-2.0 | !pip install --user apache-beam[gcp]==2.16.0
!pip install --user tensorflow-transform==0.15.0
"""
Explanation: Lab: TfTransform #
Learning Objectives
1. Preproccess data and engineer new features using TfTransform
1. Create and deploy Apache Beam pipeline
1. Use processed data to train taxifare model locally then s... |
Wei1234c/Elastic_Network_of_Things_with_MQTT_and_MicroPython | notebooks/demo/PyCon TW 2017 demo.ipynb | gpl-3.0 | import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.sep.join(['..', 'codes']), 'client')))
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.sep.join(['..', 'codes']), 'node')))
sys.path.append(os.path.abspath(os.path.join(os.path.pardir, os.path.se... |
amandersillinois/landlab | notebooks/tutorials/flow_direction_and_accumulation/the_FlowAccumulator.ipynb | mit | %matplotlib inline
# import plotting tools
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib as mpl
# import numpy
import numpy as np
# import necessary landlab components
from landlab im... |
mne-tools/mne-tools.github.io | dev/_downloads/3d564af6b3f1e758cf01cd38abefd45f/50_epochs_to_data_frame.ipynb | bsd-3-clause | import os
import matplotlib.pyplot as plt
import seaborn as sns
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_fil... |
wmvanvliet/jocn2017 | task.ipynb | bsd-2-clause | # Import Pandas data handing module
import pandas as pd
# For pretty display of tables
from IPython.display import display
# Load the data
data = pd.read_csv('data.csv', index_col=['subject', 'cue-english', 'association-english'])
data = data.sort_index()
# Transform the "raw" N400 amplitudes into distance measureme... |
zunio/python-recipes | 00-BestPractices/Decorator.ipynb | apache-2.0 | def shout(word="yes"):
return word.capitalize()+"!"
shout()
# As an object, you can assign the function to a variable like any other object
scream = shout
# Notice we don't use parentheses: we are not calling the function,
# we are putting the function "shout" into the variable "scream".
# It means you can then... |
skdaccess/skdaccess | skdaccess/examples/Demo_Sentinel_1.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.dpi'] = 150
import numpy as np
from getpass import getpass
from skdaccess.geo.sentinel_1.cache import DataFetcher as S1DF
"""
Explanation: The MIT License (MIT)<br>
Copyright (c) 2018 Massachusetts Institute of Technology<br>
Author: Cody Rude<b... |
yvesalexandre/bandicoot | demo/demo.ipynb | mit | # Records for the user 'ego'
!head -n 5 data/ego.csv
# GPS locations of cell towers
!head -n 5 data/antennas.csv
"""
Explanation: Bandicoot notebook
bandicoot is an open-source python toolbox to analyze mobile phone metadata. For more information, see: http://bandicoot.mit.edu/
The source code of the notebook is avai... |
atlury/deep-opencl | DL0110EN/5.1.2dropoutRegressionAssignemnt.ipynb | lgpl-3.0 | import torch
import matplotlib.pyplot as plt
import torch.nn as nn
import numpy as np
"""
Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px">
<a href="http://cocl.us/pytorch_link_top"><img src = "http://cocl.us/Pytorch_top" width = 950, align = "center"></a>
<img src = "https://ibm.box.... |
farrajota/dbcollection | notebooks/tutorial_dbcollection_api.ipynb | mit | # import tutorial packages
from __future__ import print_function
import os
import sys
import numpy as np
import dbcollection.manager as dbclt
"""
Explanation: dbcollection package usage tutorial
This tutorial shows how to use the dbcollection package to load and manage datasets in a simple and easy way. It is divided ... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/labs/2_dataset_api.ipynb | apache-2.0 | import json
import math
import os
from pprint import pprint
import numpy as np
import tensorflow as tf
print(tf.version.VERSION)
"""
Explanation: TensorFlow Dataset API
Learning Objectives
1. Learn how to use tf.data to read data from memory
1. Learn how to use tf.data in a training loop
1. Learn how to use tf.data t... |
yangw1234/BigDL | python/chronos/use-case/network_traffic/network_traffic_multivariate_multistep_tcnforecaster.ipynb | apache-2.0 | def plot_predict_actual_values(date, y_pred, y_test, ylabel):
"""
plot the predicted values and actual values (for the test data)
"""
fig, axs = plt.subplots(figsize=(12,5))
axs.plot(date, y_pred, color='red', label='predicted values')
axs.plot(date, y_test, color='blue', label='actual values')... |
surfer1-dev/who_is_resigning | hr_predictions.ipynb | mit | %matplotlib inline
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import... |
PyLCARS/PythonUberHDL | myHDL_DigitalSignalandSystems/myHDL_UpDownSamping.ipynb | bsd-3-clause | import numpy as np
import scipy.signal as sig
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{Upsampling and Downsampling in myHDL}
\a... |
gamaanderson/2017-AMS-Short-Course-on-Open-Source-Radar-Software | 5b_PyART_visualization.ipynb | bsd-2-clause | import pyart
from matplotlib import pyplot as plt
import numpy as np
import os
from datetime import datetime as dt
%matplotlib inline
print(pyart.__version__)
import warnings
warnings.simplefilter("ignore", category=DeprecationWarning)
#warnings.simplefilter('ignore')
"""
Explanation: Visualizations with Py-ART
Firs... |
drericstrong/Blog | 20170304_AbaloneWithKerasPart1.ipynb | agpl-3.0 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense
import keras
%matplotlib inline
# Load the data from the CSV file
abalone_df = pd.read_csv('abalone.csv',n... |
kdestasio/online_brain_intensive | nipype_tutorial/notebooks/basic_configuration.ipynb | gpl-2.0 | from nipype import config, logging
import os
os.makedirs('/output/log_folder', exist_ok=True)
os.makedirs('/output/crash_folder', exist_ok=True)
config_dict={'execution': {'remove_unnecessary_outputs': 'true',
'keep_inputs': 'false',
'poll_sleep_... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/06_structured/labs/3_tensorflow.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
# Ensure the right version of Tensorflow is installed.
!pip freeze | grep tensorflow==2.1
# change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'... |
RyanSkraba/beam | examples/notebooks/get-started/try-apache-beam-java.ipynb | apache-2.0 | # Run and print a shell command.
def run(cmd):
print('>> {}'.format(cmd))
!{cmd} # This is magic to run 'cmd' in the shell.
print('')
# Copy the input file into the local filesystem.
run('mkdir -p data')
run('gsutil cp gs://dataflow-samples/shakespeare/kinglear.txt data/')
"""
Explanation: <a href="https://col... |
f-guitart/data_mining | notes/99 - Exercices.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
#read csv as data frame
df_gdp_raw = pd.read_csv("../data/countries_GDP.csv")
#select columns and use these that have data in 'Unamed:0', which
#actually is the country code
df_gdp = df_gdp_raw[[0,1,3,4]][df_gdp_raw['Unnamed: 0'].notnull()]
#rename columns and index
df_gdp.column... |
Olsthoorn/TransientGroundwaterFlow | Assignment/VScode/AssJan2022.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import exp1, erfc
"""
Explanation: Assignment Jan 2022. Wells along a river
:author: Prof. dr.ir. T.N.Olsthoorn
2021-12-22, june 2022
Consider a region to the right of a straight river which is in direct contact with a water table aquifer that has a... |
PMEAL/OpenPNM-Examples | PaperRecreations/Gostick2007.ipynb | mit | import openpnm as op
import matplotlib.pyplot as plt
import numpy as np
import openpnm.models as mods
Lc = 40.5e-6
#1 setting up network
sgl = op.network.Cubic(shape=[26, 26, 10], spacing=Lc, name='SGL10BA')
sgl.add_boundary_pores()
proj = sgl.project
wrk=op.Workspace()
wrk.loglevel=50
#2 set up geometries
Ps = sgl.po... |
eds-uga/cbio4835-sp17 | lectures/Lecture12.ipynb | mit | def our_function():
pass
"""
Explanation: Lecture 12: Functions
CBIO (CSCI) 4835/6835: Introduction to Computational Biology
Overview and Objectives
In this lecture, we'll introduce the concept of functions, critical abstractions in nearly every modern programming language. Functions are important for abstracting ... |
benjamin-recht/benjamin-recht.github.io | code/logistic_logodds_example.ipynb | mit | p_hi = 0.8 # probability of success in the high probability subpopulation
p_lo = 0.2 # probability of success in the low probability subpopulation
delta_p = 0.05 # effect size
# probability of success under treatment
P_T_additive = delta_p + 0.5*p_hi+0.5*p_lo
# probability of success under control
P_C_additive = 0.5*p... |
tuanvu216/udacity-course | deep_learning/examples/4_convolutions.ipynb | mit | # These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
import cPickle as pickle
import numpy as np
import tensorflow as tf
pickle_file = 'notMNIST.pickle'
with open(pickle_file, 'rb') as f:
save = pickle.load(f)
train_dataset = save['train_dataset']
train_la... |
gfrias/udacity | 2_traffic_signs/Traffic_Sign_Classifier.ipynb | mit | # Load pickled data
import pickle
from sklearn.model_selection import train_test_split
# TODO: Fill this in based on where you saved the training and testing data
training_file = '/Users/gfrias/Downloads/traffic-signs-data/train.p'
testing_file = '/Users/gfrias/Downloads/traffic-signs-data/test.p'
with open(training... |
liumengjun/cn-deep-learning | tutorials/transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
paris-saclay-cds/python-workshop | Day_2_Software_engineering_best_practices/03_functions.ipynb | bsd-3-clause | def the_answer_to_the_universe():
print(42)
the_answer_to_the_universe()
"""
Explanation: This notebook is largely based on material of the Python Scientific Lecture Notes (https://scipy-lectures.github.io/), adapted with some exercises.
Reusing code
<div class="alert alert-danger">
<b>Rule of thumb</b>: <br><br... |
fantasycheng/udacity-deep-learning-project | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
source_text[:1000]
target_text[:1000]
"""
Explanation: Language T... |
m2dsupsdlclass/lectures-labs | labs/07_seq2seq/Translation_of_Numeric_Phrases_with_Seq2Seq.ipynb | mit | from french_numbers import to_french_phrase
for x in [21, 80, 81, 300, 213, 1100, 1201, 301000, 80080]:
print(str(x).rjust(6), to_french_phrase(x))
"""
Explanation: Translation of Numeric Phrases with Seq2Seq
In the following we will try to build a translation model from french phrases describing numbers to the c... |
ramabrahma/data-sci-int-capstone | data-exploration-life-insurance.ipynb | gpl-3.0 | # Importing libraries
%pylab inline
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from sklearn import preprocessing
import numpy as np
# Convert variable data into categorical, continuous, discrete,
# and dummy variable lists the following into a dictio... |
MatthewDaws/TileMapBase | notebooks/Projections.ipynb | mit | import tilemapbase
tilemapbase.start_logging()
tilemapbase.tiles.build_OSM().get_tile(0,0,0)
"""
Explanation: Projections
Web mapping tools using tiles use a variant of the Mercator Projection.
- OpenStreetMap Wiki
- Mercator projection
- Web Mercator
This can lead to some significant distortions: you can see this for... |
tensorflow/docs | site/en/r1/tutorials/eager/automatic_differentiation.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... |
fastai/fastai | nbs/24_tutorial.image_sequence.ipynb | apache-2.0 | ! pip install rarfile av
! pip install -Uq pyopenssl
"""
Explanation: some dependencies to get the dataset
End of explanation
"""
#|all_slow
from fastai.vision.all import *
"""
Explanation: Tutorial - Using fastai on sequences of Images
How to use fastai to train an image sequence to image sequence job.
This tut... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-3/cmip6/models/sandbox-3/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'test-institute-3', 'sandbox-3', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: TEST-INSTITUTE-3
Source ID: SANDBOX-3
Topic: Landice
Sub-Topics: Gla... |
SlipknotTN/udacity-deeplearning-nanodegree | DLND-your-first-network/dlnd-your-first-neural-network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
nikodtbVf/aima-si | agents.ipynb | mit | from agents import *
class BlindDog(Agent):
def eat(self, thing):
print("Dog: Ate food at {}.".format(self.location))
def drink(self, thing):
print("Dog: Drank water at {}.".format( self.location))
dog = BlindDog()
"""
Explanation: AGENT
An agent, as defined in 2.1 is anything th... |
qutip/qutip-notebooks | examples/atom-cavity-correlation-function.ipynb | lgpl-3.0 | kappa = 2
gamma = 0.2
g = 5
wc = 0
w0 = 0
wl = 0
N = 5
E = 0.5
tlist = np.linspace(0,10.0,500)
"""
Explanation: Model and parameters
We use the Jaynes-Cumming model of a single two-level atom interacting with a single-mode cavity via a dipole interaction and under the rotating wave approximation.
End of explanatio... |
rsignell-usgs/notebook | CSW/CSW_test-NGDC.ipynb | mit | from pylab import *
from owslib.csw import CatalogueServiceWeb
from owslib import fes
import random
import netCDF4
import pandas as pd
import datetime as dt
"""
Explanation: CSW access with OWSLib using ISO queryables
Demonstration of how to use the OGC Catalog Services for the Web (CSW) to search for find all dataset... |
andre-martini/advanced-comp-2017 | 03-neural-networks/lecture.ipynb | gpl-3.0 | %config InlineBackend.figure_format='retina'
%matplotlib inline
# Silence warnings
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)
warnings.simplefilter(action="ignore", category=UserWarning)
warnings.simplefilter(action="ignore", category=RuntimeWarning)
import numpy as np
np.random.se... |
keras-team/autokeras | docs/ipynb/image_classification.ipynb | apache-2.0 | (x_train, y_train), (x_test, y_test) = mnist.load_data()
print(x_train.shape) # (60000, 28, 28)
print(y_train.shape) # (60000,)
print(y_train[:3]) # array([7, 2, 1], dtype=uint8)
"""
Explanation: A Simple Example
The first step is to prepare your data. Here we use the MNIST dataset as an example
End of explanation... |
GoogleCloudPlatform/mlops-on-gcp | workshops/kfp-caip-sklearn/lab-03-kfp-cicd/exercises/lab-03.ipynb | apache-2.0 | ENDPOINT = '<YOUR_ENDPOINT>'
PROJECT_ID = !(gcloud config get-value core/project)
PROJECT_ID = PROJECT_ID[0]
"""
Explanation: CI/CD for a KFP pipeline
Learning Objectives:
1. Learn how to create a custom Cloud Build builder to pilote CAIP Pipelines
1. Learn how to write a Cloud Build config file to build and push all ... |
brentjm/Impurity-Predictions | notebooks/.ipynb_checkpoints/Impurity Prediction Example 1-checkpoint.ipynb | bsd-2-clause | # kinetic parameters (kcal/mol)
A1f = 1e4
E1f = 22
A1r = 1e4
E1r = 26
A2 = 1e6
E2 = 20
A3 = 1e5
E3 = 21
Po = 0
Io = .1
Do = 0.9
# temperatures (up to 4 different temperatures)
Temperatures = [25, 40, 60, 80]
# time points in days
days = [[0, 7, 14], # days at first temperature
[0, 5, 10], # days at second... |
bjedwards/NetworkXTutorial | II. Creating, Reading and Writing Graphs.ipynb | bsd-3-clause | import numpy as np
n = 25
A = np.random.binomial(1,1.1/n,size=(n,n)) # Random 1/s with probability 1/25
G = nx.from_numpy_matrix(A)
G.order()
G.size()
G.degree()
"""
Explanation: NetworkX Data Capabilities
NetworkX has many built in functions to read data from a variety of formats. Because formats can be pretty es... |
dietmarw/EK5312_ElectricalMachines | Chapman/Ch4-Problem_4-10.ipynb | unlicense | %pylab notebook
%precision 2
"""
Explanation: Excercises Electric Machinery Fundamentals
Chapter 4
Problem 4-10
End of explanation
"""
Pn = 100e6 # [W]
PF = 0.8
f_nl_A = 61.0 # [Hz]
SD_A = 3 # [%]
f_nl_B = 61.5 # [Hz]
SD_B = 3.4 # [%]
f_nl_C = 60.5 # [Hz]
SD_C = 2.6 # [%]
"""
Explanation:... |
xMyrst/BigData | python/howto/013_Módulo_Pandas_DataFrames.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
"""
Explanation: MÓDULO PANDAS
Ya hemos visto que el módulo NumPy proporciona funciones y rutinas matemáticas para la manipulación de array y matrices de datos numéricos.
La librería pandas de Python proporciona estructuras de datos de alto nivel y herramientas diseñadas específi... |
jplattel/notebooks | parkeren-utrecht.ipynb | mit | df = pd.read_csv('totaal.csv')
df = df.set_index('id')
df['start'] = pd.to_datetime(df['start']) # Starttijden converteren naar datetimes
df['einde'] = pd.to_datetime(df['einde']) # Eindtijden converteren naar datetimes
df['duur'] = df['einde'] - df['start'] # Hoe lang parkeert iedereen?
"""
Explanation: Parkeren in U... |
karlstroetmann/Artificial-Intelligence | Python/6 Classification/Iris-Classification-with-SVM.ipynb | gpl-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Classifying Flowers using a Support Vector Machine
I have adapted this notebook from https://scikit-learn.org/stable/auto_examples/svm/plot_iris.html.
In this notebook we will ... |
hpparvi/PyTransit | notebooks/osmodel_example_1.ipynb | gpl-2.0 | %pylab inline
from pytransit import OblateStarModel, QuadraticModel
tmo = OblateStarModel(sres=100, pres=8, rstar=1.65)
tmc = QuadraticModel(interpolate=False)
times = linspace(-0.35, 0.35, 500)
tmo.set_data(times)
tmc.set_data(times)
"""
Explanation: Oblate fast-rotating star model example
End of explanation
"""
... |
greenelab/GCB535 | 24_Prelab_Python-II/Lesson2.ipynb | bsd-3-clause | construction = False
print "Turn right onto Main Street"
print "Turn left onto Maple Ave"
if construction:
print "Continue straight on Maple Ave"
print "Turn right onto Cat Lane"
print "Turn left onto Fake Street"
else:
print "Cut through the empty lot to Fake Street"
print "Go straight on Fake S... |
whitead/numerical_stats | unit_12/lectures/lecture_4.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, pi, erf
import seaborn
seaborn.set_context("notebook")
seaborn.set_style("whitegrid")
import scipy.stats
"""
Explanation: Ordinary Least-Squares with Measurement Error
Unit 12, Lecture 4
Numerical Methods and Statistics
Prof.... |
CompPhysics/MachineLearning | doc/pub/week34/ipynb/.ipynb_checkpoints/week34-checkpoint.ipynb | cc0-1.0 | import numpy as np
"""
Explanation: <!-- dom:TITLE: Week 34: Introduction to the course, Logistics and Practicalities -->
Week 34: Introduction to the course, Logistics and Practicalities
<!-- dom:AUTHOR: Morten Hjorth-Jensen at Department of Physics, University of Oslo & Department of Physics and Astronomy and Nation... |
woters/ds101 | 0-intro.ipynb | mit | from IPython.display import IFrame
IFrame('http://jupyter.org/', width='100%', height=350)
"""
Explanation: План
Введение
Data processing с Pandas
Построение моделей с Scikit-learn
<hr/>
Data Science 101
<hr/>
1. Скачайте репозиторий
https://github.com/woters/ds101
2. Или откройте его через binder
http://mybinder.... |
wei-Z/Python-Machine-Learning | code/ch10/ch10.ipynb | mit | %load_ext watermark
%watermark -a 'Sebastian Raschka' -u -d -v -p numpy,pandas,matplotlib,scikit-learn,seaborn
# to install watermark just uncomment the following line:
#%install_ext https://raw.githubusercontent.com/rasbt/watermark/master/watermark.py
"""
Explanation: Sebastian Raschka, 2015
https://github.com/rasbt... |
evanmiltenburg/python-for-text-analysis | Chapters-colab/Chapter_22_Sentiment_analysis_with_VADER.ipynb | apache-2.0 | %%capture
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Data.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/images.zip
!wget https://github.com/cltl/python-for-text-analysis/raw/master/zips/Extra_Material.zip
!unzip Data.zip -d ../
!unzip images.zip -d ./
!unzip Ext... |
datahac/jup | v01/user-groups_00.ipynb | apache-2.0 | %matplotlib inline
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import pandas as pd
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('display.notebook_repr_html', True)
import seaborn as sns #sets ... |
deepfield/ibis | docs/source/notebooks/tutorial/9-Adding-a-new-elementwise-expression.ipynb | apache-2.0 | import ibis.expr.datatypes as dt
import ibis.expr.rules as rlz
from ibis.expr.operations import ValueOp, Arg
class SHA1(ValueOp):
arg = Arg(rlz.string)
output_type = rlz.shape_like('arg', 'string')
"""
Explanation: Extending Ibis Part 1: Adding a New Elementwise Expression
There are two parts of ibis that u... |
darioflute/CS4A | Lecture-astronomy.ipynb | gpl-3.0 | from astropy.utils.data import download_file
from astropy.io import fits
image_file = download_file('http://data.astropy.org/tutorials/FITS-images/HorseHead.fits',
cache=True)
"""
Explanation: Astronomical python packages
In this lecture we will introduce the astropy library and the
affilia... |
empet/Math | Animating a family-of-complex-functions.ipynb | bsd-3-clause | import plotly.graph_objects as go
import numpy as np
Plotly version of the HSV colorscale, corresponding to S=1, V=1, where S is saturation and V is the value.
pl_hsv = [[0.0, 'rgb(0, 255, 255)'],
[0.0833, 'rgb(0, 127, 255)'],
[0.1667, 'rgb(0, 0, 255)'],
[0.25, 'rgb(127, 0, 255)'],
[0.3333, 'rgb(255, 0, 255)'],
... |
MattiWe/clickbait-detection | clickbait.ipynb | gpl-3.0 | # POS Tag frequencies
from nltk.tag import pos_tag_sents
all_pos_tags = [pos_tag_sents(pos_tokenize(tokens)) for tokens in cb_feat_postText]
tag_list = []
for tweets in all_pos_tags:
tweet_tokens=""
for elements in tweets:
tweet_tokens += elements[0][1] + " "
tag_list.append(tweet_tokens)
pos_tag_... |
xR86/ml-stuff | presentations/template_notebook.ipynb | mit | # BASE ------------------------------------
from datetime import datetime as dt
nb_start = dt.now()
# Be mindful when you have this activated.
# import warnings
# warnings.filterwarnings('ignore')
import json
from pathlib import Path
from time import sleep
# Display libs
from IPython.display import display, HTML
f... |
landmanbester/fundamentals_of_interferometry | 5_Imaging/5_5_widefield_effect.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML
HTML('../style/course.css') #apply general CSS
"""
Explanation: Outline
Glossary
5. Imaging
Previous: 5.4 Imaging weights
Next: 5.5 References and further reading
Import standard modules:
End of explanation
"""... |
Kreiswolke/gensim | docs/notebooks/gensim Quick Start.ipynb | lgpl-2.1 | raw_corpus = ["Human machine interface for lab abc computer applications",
"A survey of user opinion of computer system response time",
"The EPS user interface management system",
"System and human system engineering testing of EPS",
"Relation of user pe... |
brunoalano/hdbscan | notebooks/How HDBSCAN Works.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn.datasets as data
%matplotlib inline
sns.set_context('poster')
sns.set_style('white')
sns.set_color_codes()
plot_kwds = {'alpha' : 0.5, 's' : 80, 'linewidths':0}
"""
Explanation: How HDBSCAN Works
HDBSCAN is a clustering algorithm d... |
sbethune-uw/cp400 | Assignments/CP-400 - Assignment 1.ipynb | mit | # a. take a list of [2, 3, 4] and multiply it by 3 to get [6, 9, 12]
a = [1, 2, 3]
# b Return count of 'white' values in the list
colors = ['red', 'white', 'blue', 'white', 'purple', 'brown', 'white']
# c Add value 'green' to color list below
colors = ['red', 'white', 'blue', 'white', 'purple', 'brown', 'white']... |
djfan/wifind | viz/hp_target_ct_cb.ipynb | mit | import shapefile as shp
import math
import pandas as pd
import geopandas as gpd
import pylab as pl
from fiona.crs import from_epsg
%pylab inline
hp_target = gpd.read_file("./hp_target/hp_target.shp")
hp_target.to_crs(epsg=2263, inplace=True)
ct = gpd.read_file("./nyct2010_17b/nyct2010.shp")
cb = gpd.read_file("./nyc... |
rknLA/pd-blosc | notebook/02-BlepSawtooth.ipynb | mit | pylab inline
import numpy as np
from minblep import generate_min_blep
sample_rate = 44100
"""
Explanation: Using MinBLEP to generate a Saw
End of explanation
"""
plot(generate_min_blep(15, 400))
def gen_pure_saw(osc_freq, sample_rate, num_samples, initial_phase=0):
peak_amplitude = 1.0
two_pi = 2.0 * np.p... |
Archman/beamline | tests/Usage Demo for Python Package beamline.ipynb | mit | import beamline
import os
"""
Explanation: Code demonstration for using beamline python package to do online modeling
Tong Zhang, March, 2016 (draft)
For example, define lattice configuration for a 4-dipole chicane with quads:
|-|---|-|
/ \
... |
sat-utils/sat-search | tutorial-1.ipynb | mit | from satsearch import Search
search = Search(bbox=[-110, 39.5, -105, 40.5])
print('bbox search: %s items' % search.found())
search = Search(datetime='2018-02-12T00:00:00Z/2018-03-18T12:31:12Z')
print('time search: %s items' % search.found())
search = Search(query={'eo:cloud_cover': {'lt': 10}})
print('cloud_cover se... |
kaka0525/Process-Bike-Share-data-with-Pandas | bike_scikit.ipynb | mit | count = usage['station_start'].value_counts()
average_rental_df = DataFrame({ 'average_rental' : count / 365})
average_rental_df
"""
Explanation: To start with, we'll need to compute the number of rentals per station per day. Use pandas to do that.
End of explanation
"""
from sklearn import linear_model
indexed_a... |
hmenke/espresso | doc/tutorials/02-charged_system/02-charged_system-1.ipynb | gpl-3.0 | from __future__ import print_function
from espressomd import System, electrostatics, features
import espressomd
import numpy
import matplotlib.pyplot as plt
plt.ion()
# Print enabled features
required_features = ["EXTERNAL_FORCES", "MASS", "ELECTROSTATICS", "LENNARD_JONES"]
espressomd.assert_features(required_features... |
zzsza/Datascience_School | 10. 기초 확률론3 - 확률 분포 모형/13. 다변수 가우시안 정규 분포.ipynb | mit | mu = [2, 3]
cov = [[1, 0], [0, 1]]
rv = sp.stats.multivariate_normal(mu, cov)
xx = np.linspace(0, 4, 120)
yy = np.linspace(1, 5, 150)
XX, YY = np.meshgrid(xx, yy)
plt.grid(False)
plt.contourf(XX, YY, rv.pdf(np.dstack([XX, YY])))
plt.axis("equal")
plt.show()
"""
Explanation: 다변수 가우시안 정규 분포
다변수 가우시안 정규 분포 혹은 간단히 다변수 정규 ... |
jGaboardi/Transport | Transportation_Simplex_Gurobi.ipynb | gpl-3.0 | # Imports
import pysal as ps
import geopandas as gpd
import numpy as np
import networkx as nx
from shapely.geometry import Point
import shapely
from collections import OrderedDict
import pandas as pd
import qgrid
import gurobipy as gbp
import time
import bokeh
from bokeh.plotting import figure, show, ColumnDataSource
f... |
kubeflow/community | scripts/open_pr_stats.ipynb | apache-2.0 | import argparse
import datetime
from dateutil import parser as date_parser
import json
import logging
import numpy as np
import os
import pandas as pd
import pprint
import requests
from pandas.io.json import json_normalize
query_template="""{{
search(query: "org:kubeflow is:pr is:open created:>2019-01-01", type: I... |
param411singh/inf1340-2015-notebooks | Week 3.ipynb | mit | arthur = "king"
lancelot = -23
robin = 1.99
bedevere = True
"""
Explanation: Overview
Hour 1
Data Types
Decision Structures
Hour 2
git demo
py.test demo
Hour 3
Graded lab exercise
Data Types
Recall that variables are like containers with labels
These containers also have "type." The type of a container dete... |
tensorflow/docs-l10n | site/ja/tutorials/generative/autoencoder.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... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sandbox-1/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sandbox-1', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-1
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
JrtPec/opengrid | notebooks/Analysis/Multivariable_regression_slow.ipynb | apache-2.0 | import os
import pandas as pd
from opengrid.library import houseprint, regression
from opengrid import config
c = config.Config()
import matplotlib.pyplot as plt
plt.style.use('ggplot')
%matplotlib inline
plt.rcParams['figure.figsize'] = 16,8
"""
Explanation: Multivariable regression
Imports and setup
End of explan... |
ernestyalumni/CompPhys | moreCUDA/CUSOLVER/cuSOLVERgesvd.ipynb | apache-2.0 | import numpy as np
from scipy import linalg
# Create an array of the given shape and populate it with
# random samples from a uniform distribution
# over ``[0, 1)``.
a = np.random.randn(9,6) + 1.j * np.random.randn(9,6)
a
U, s, Vh = linalg.svd(a)
U.shape, Vh.shape, s.shape
U
Vh
s
"""
Explanation: from Sc... |
AeroPython/Taller-PyConEs-2015 | Ejercicios/El vecindario racista/El vecindario racista.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import vecindario as vc
"""
Explanation: El vecindario racista: el modelo de segregación de Schelling
La segregación racial es un problema en muchas partes del mundo desde hace mucho tiempo. A pesar de que ciertos colectivos han realizado un gran es... |
liufuyang/ManagingBigData_MySQL_DukeUniv | week3/MySQL_Exercise_05_Summaries_of_Groups_of_Data.ipynb | mit | %load_ext sql
%sql mysql://studentuser:studentpw@mysqlserver/dognitiondb
%sql USE dognitiondb
%config SqlMagic.displaylimit=25
"""
Explanation: Copyright Jana Schaich Borg/Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
MySQL Exercise 5: Summaries of Groups of Data
So far you've learned how to select, refo... |
phoebe-project/phoebe2-docs | development/tutorials/RV_geometry_tutorial.ipynb | gpl-3.0 | b = phoebe.default_binary()
# set parameter values
b.set_value('q', value = 0.6)
b.set_value('incl', component='binary', value = 84.5)
b.set_value('ecc', 0.2)
b.set_value('per0', 63.7)
b.set_value('sma', component='binary', value= 7.3)
b.set_value('vgamma', value= -32.84)
# add an rv dataset
b.add_dataset('rv', comput... |
mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.04 - Database/ORM - Basic Relationship Patterns.ipynb | gpl-3.0 | # SQLAlchemy
from sqlalchemy import Table, Column, Integer, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Date, Integer, String
Base = declarative_base()
"""
Explanation: ORM - Basic Relationship Patterns
Following are the r... |
gfeiden/Notebook | Daily/20151123_agb_inner_boundary.ipynb | mit | rho = (1.26*1.6726219e-24/1.3806488e-16)*(1680./5600.)
print "Density of the gas [g/cm**3] = {:11.5e}.".format(rho)
"""
Explanation: RHD Model Atmosphere Inner Boundary
Exploring the properties of RHD model atmosphere inner boundaries for AGB stars. Liljegren finds that some models fail to converge due to a temperatu... |
EstevesDouglas/UNICAMP-FEEC-IA369Z | dev/checkpoint/2017-05-05-estevesdouglas-compartilhando-notebook.ipynb | gpl-3.0 | -- Campainha IoT - LHC - v1.1
-- ESP Inicializa pinos, Configura e Conecta no Wifi, Cria conexão TCP
-- e na resposta de um "Tocou" coloca o ESP em modo DeepSleep para economizar bateria.
-- Se nenhuma resposta for recebida em 15 segundos coloca o ESP em DeepSleep.
led_pin = 3
status_led = gpio.LOW
ip_servidor = "192.1... |
root-mirror/training | NCPSchool2021/introduction.ipynb | gpl-2.0 | # Entrypoint to all ROOT functions, classes, namespaces
import ROOT
"""
Explanation: ROOT in Jupyter
ROOT can be used in Jupyter notebooks, both in Python and C++. In this course we will focus only on Python, but for people interested in ROOT C++ notebooks some examples can be found here.
There are some specificities ... |
saudijack/unfpyboot | Day_00/02_Strings_and_FileIO/01 File Input and Output.ipynb | mit | f = open('kaiju_movies.dat')
for movie in f:
print movie,
f.close()
"""
Explanation: Reading files
The iterator notation is easiest.
End of explanation
"""
f = file('kaiju_movies.dat')
for movie in f:
print movie,
f.close()
"""
Explanation: (The comma at the end suppresses extra newline). Can also use the o... |
zzsza/Datascience_School | 09. 기초 확률론2 - 확률 변수/01. NumPy를 사용한 난수 발생.ipynb | mit | import numpy as np
"""
Explanation: NumPy를 사용한 난수 발생
파이썬을 이용하여 난수를 발생시키거나 데이터를 무작위로 섞는 방법에 대해 알아본다.
이런 기능들은 주로 NumPy의 random 서브패키지에서 제공한다.
End of explanation
"""
np.random.seed(0)
"""
Explanation: 시드 설정하기
컴퓨터 프로그램에서 무작위와 관련된 모든 알고리즘은 사실 무작위가 아니라 시작 숫자를 정해 주면 그 다음에는 정해진 알고리즘에 의해 마치 난수처럼 보이는 수열을 생성한다. 다만 출력되는 숫자들 간의 ... |
sbenthall/bigbang | examples/experimental_notebooks/Git Interaction Graph.ipynb | agpl-3.0 | %matplotlib inline
from bigbang.git_repo import GitRepo;
from bigbang import repo_loader;
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
repos = repo_loader.get_org_repos("codeforamerica")
repo = repo_loader.get_multi_repo(repos=repos)
full_info = repo.commit_data;
"""
Explanation: This no... |
LimeeZ/phys292-2015-work | assignments/assignment09/IntegrationEx02.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy import integrate
"""
Explanation: Integration Exercise 2
Imports
End of explanation
"""
def integrand(x, a):
return 1.0/(x**2 + a**2)
def integral_approx(a):
# Use the args keyword argument to feed extra a... |
tensorflow/hub | examples/colab/action_recognition_with_tf_hub.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... |
computational-class/cjc2016 | code/01.slides.ipynb | mit | %%latex
\begin{align}
a = \frac{1}{2}\\
\end{align}
"""
Explanation: 使用Jupyter制作Slides的介绍
王成军
wangchengjun@nju.edu.cn
计算传播网 http://computational-communication.com
RISE: "Live" Reveal.js Jupyter/IPython Slideshow Extension
https://github.com/damianavila/RISE
Installation
Downnload from https://github.com/damianavila/... |
ComputationalModeling/spring-2017-danielak | past-semesters/spring_2016/day-by-day/day17-Text-processing-with-shotgun-sequencing-assembly/In-Class-Shotgun_sequencing-SOLUTION.ipynb | agpl-3.0 | start_string_list = ['er_way__in_short_the_period_was_so_far_like_the_pr', \
'__in_short_the_period_was_so_far_like_the_present_', \
'he_present_period_that_some_of_its_noisiest_author', \
'_period_that_some_of_its_noisiest_authorities_insi']
"""
Expla... |
probml/pyprobml | notebooks/book1/14/resnet_torch.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import math
from IPython import display
try:
import torch
except ModuleNotFoundError:
%pip install -qq torch
import torch
try:
import torchvision
except ModuleNotFoundError:
%pip install -qq torchvision
import torchvision
from torch import nn
f... |
shoyer/qspectra | examples/FMO dynamics with Redfield theory.ipynb | bsd-2-clause | import qspectra as qs
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
electronic_fmo = np.array(np.mat("""
12400 -87.7 5.5 -5.9 6.7 -13.7 -9.9;
-87.7 12520 30.8 8.2 0.7 11.8 4.3;
5.5 30.8 12200 -53.5 -2.2 -9.6 6.;
-5.9 8.2 -53.5 12310 -70.7 -17. -63.3;
6.7 0.7 -2.2 -70.7 12470... |
keras-team/keras-io | examples/vision/ipynb/fixres.ipynb | apache-2.0 | from tensorflow import keras
from tensorflow.keras import layers
import tensorflow as tf
import tensorflow_datasets as tfds
tfds.disable_progress_bar()
import matplotlib.pyplot as plt
"""
Explanation: FixRes: Fixing train-test resolution discrepancy
Author: Sayak Paul<br>
Date created: 2021/10/08<br>
Last modified:... |
apdavison/elephant | doc/tutorials/unitary_event_analysis.ipynb | bsd-3-clause | import random
import numpy as np
import matplotlib.pyplot as plt
import quantities as pq
import neo
import elephant.unitary_event_analysis as ue
# Fix random seed to guarantee fixed output
random.seed(1224)
"""
Explanation: The Unitary Events Analysis
The executed version of this tutorial is at https://elephant.read... |
Danghor/Formal-Languages | Ply/Ply-Scanning-Example.ipynb | gpl-2.0 | from IPython.core.display import HTML
with open ("../style.css", "r") as file:
css = file.read()
HTML(css)
"""
Explanation: Note that you have to execute the command jupyter notebook in the parent directory of
this directory for otherwise jupyter won't be able to access the file style.css.
End of explanation
"""
... |
atlury/deep-opencl | DL0110EN/5.1.1dropoutRegression.ipynb | lgpl-3.0 | import torch
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
"""
Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px">
<a href="http://cocl.us/pytorch_link_top"><img src = "http://cocl.us/Pytorch_top" width = 950, align = "center"></a... |
akimbekov/Stock_prediction_using_ML_and_Deep_learning | Project.ipynb | mit | #data munging and feature extraction packages
import requests
import requests_ftp
import requests_cache
import lxml
import itertools
import pandas as pd
import re
import numpy as np
import seaborn as sns
import string
from bs4 import BeautifulSoup
from collections import Counter
from matplotlib import pyplot as plt
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.