repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
pyannote/pyannote-audio | tutorials/applying_a_pipeline.ipynb | mit | from huggingface_hub import HfApi
available_pipelines = [p.modelId for p in HfApi().list_models(filter="pyannote-audio-pipeline")]
available_pipelines
"""
Explanation: Applying a pretrained pipeline
In this tutorial, you will learn how to apply pyannote.audio pipelines on an audio file.
A pipeline takes an audio file ... |
shareactorIO/pipeline | source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/GoogleTraining/workshop_sections/mnist_series/the_hard_way/mnist_onehlayer.ipynb | apache-2.0 | import argparse
import math
import os
import time
from six.moves import xrange
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
# Define some constants.
# The MNIST dataset has 10 classes, representing the digits 0 through 9.
NUM_CLASSES = 10
# The MNIST images ... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_sensors_decoding.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.cross_validation import StratifiedKFold
import mne
from mne.datasets import sample
from mne.decoding import TimeDecoding, GeneralizationAcrossTime
data_path = sample.data_path()
plt.close('all')
"""
Explanatio... |
ellisonbg/talk-2015 | 12-JupyterLab.ipynb | mit | %load_ext load_style
%load_style images.css
from IPython.display import display, Image
"""
Explanation: Building Blocks for Interactive Computing
What are the building blocks for interactive computing?
End of explanation
"""
Image('images/lego-filebrowser.png', width='80%')
"""
Explanation: File browser
End of expl... |
ibm-et/defrag2015 | notebooks/dashboard.ipynb | mit | %matplotlib inline
import shutil
import tempfile
import os
import time
import json
import sys
from tornado.websocket import websocket_connect
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
from functools import re... |
probml/pyprobml | deprecated/schools8_pymc3.ipynb | mit | %matplotlib inline
import sklearn
import scipy.stats as stats
import scipy.optimize
import matplotlib.pyplot as plt
import seaborn as sns
import time
import numpy as np
import os
import pandas as pd
!pip install -U pymc3>=3.8
import pymc3 as pm
print(pm.__version__)
import theano.tensor as tt
import theano
#!pip ins... |
Unidata/MetPy | talks/MetPy Exercise.ipynb | bsd-3-clause | units.define('degrees_north = 1 degree')
units.define('degrees_east = 1 degree')
unit_remap = dict(inches='inHg', Celsius='celsius')
def metpy_units_handler(vals, unit):
arr = np.array(vals)
if unit:
unit = unit_remap.get(unit, unit)
arr = arr * units(unit)
return arr
# Fix dates and sortin... |
cahya-wirawan/SDC-LaneLines-P1 | P1.ipynb | mit | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
%matplotlib inline
"""
Explanation: Self-Driving Car Engineer Nanodegree
Project: Finding Lane Lines on the Road
In this project, you will use the tools you learned about in the lesson to ide... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day19-kinematics-terminal-velocity-of-a-skydiver/skydiver_SOLUTIONS.ipynb | agpl-3.0 | '''
The code in this cell opens up the file skydiver_time_velocities.csv
and extracts two 1D numpy arrays of equal length. One array is
of the velocity data taken by the radar gun, and the second is
the times that the data is taken.
'''
import numpy as np
skydiver_time, skydiver_velocity = np.loadtxt("skydiver_time... |
jpilgram/phys202-2015-work | assignments/assignment06/ProjectEuler17.ipynb | mit | import numpy as np
def number_to_words(n):
"""Given a number n between 1-1000 inclusive return a list of words for the number."""
# YOUR CODE HERE
#raise NotImplementedError()
ones=['one','two','three','four','five','six','seven','eight','nine','ten']
teens=['eleven','twelve','thirteen','fourteen',... |
leyhline/WaifuNet | 01-data-preparation.ipynb | gpl-3.0 | useless_tags = [
"lowres",
"highres",
"bad_id",
"bad_pixiv_id",
"monochrome",
"censored",
"alternate_costume",
"hetero",
"sketch",
"yuri",
"character_name",
"greyscale",
"artist_name",
"artist_request",
"artist_request",
"copyright_request",
"absurdres... |
openfisca/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/examples/notebooks/regressivite_taxation_indirecte.ipynb | agpl-3.0 | from __future__ import division
import pandas
import seaborn
"""
Explanation: L'objectif est de calculer, pour chaque décile de revenu, la part de leur revenu que les ménages dépensent en taxes indirectes. On utilise plusieurs définitions du revenu pour comparer la régressivité de ces taxes. On compare également l'i... |
mne-tools/mne-tools.github.io | 0.17/_downloads/19f42385e184c24343e0e939f7de62b5/plot_forward_sensitivity_maps.ipynb | bsd-3-clause | # Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
import matplotlib.pyplot as plt
print(__doc__)
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
fwd_fname = data_path + '/MEG/sample/sample_audvis-meg-eeg-... |
nwjs/chromium.src | third_party/tensorflow-text/src/docs/tutorials/transformer.ipynb | bsd-3-clause | #@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... |
jplourenco/bokeh | examples/plotting/notebook/interact_numba.ipynb | bsd-3-clause | from __future__ import print_function, division
from timeit import default_timer as timer
from bokeh.plotting import figure, show, output_notebook
from bokeh.models import GlyphRenderer, LinearColorMapper
from numba import jit, njit
from IPython.html.widgets import interact
import numpy as np
import scipy.misc
outp... |
pycam/python-basic | python_basic_2_4.ipynb | unlicense | results = []
with open("data/mydata.txt", "r") as data:
header = data.readline()
for line in data:
results.append(line.split())
print(results)
"""
Explanation: An introduction to solving biological problems with Python
Session 2.4: Delimited files
Data formats
Exercises 2.4.1
Exerci... |
UWSEDS/LectureNotes | Fall2018/06_Projects_Exceptions_Testing/Exceptions.ipynb | bsd-2-clause | def divide(numerator, denominator):
result = numerator/denominator
print("result = %f" % result)
divide(1.0, 0)
def divide1(numerator, denominator):
try:
result = numerator/denominator
print("result = %f" % result)
except:
print("You can't divide by 0!")
divide1(1.0, 0)
divid... |
mperignon/CSDMS-lessons | python/notebooks/02-functions.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
new_column_names = ['Agency', 'Station', 'OldDateTime', 'Timezone', 'Discharge_cfs', 'Discharge_stat', 'Stage_ft', 'Stage_stat']
url = 'http://waterservices.usgs.gov/nwis/iv/?format=rdb&sites=09380000&startDT=2016-01-01&endDT=2016-01-10¶meterC... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/statespace_local_linear_trend.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
"""
Explanation: State space modeling: Local Linear Trends
This notebook describes how to extend the statsmodels statespace classes to create and estimate a custom model.... |
feststelltaste/software-analytics | prototypes/Analyze Dependencies between Business Subdomains (before turncating).ipynb | gpl-3.0 | import py2neo
import pandas as pd
query="""
MATCH
(:Jar:Archive)-[:CONTAINS]->(type:Type)
RETURN
type.fqn AS type, SPLIT(type.fqn, ".")[2] AS subdomain
"""
graph = py2neo.Graph()
subdomaininfo = pd.DataFrame(graph.run(query).data())
subdomaininfo.head()
"""
Explanation: Introduction
In Carola Lilienthal's ta... |
astroumd/GradMap | notebooks/Lectures2017/Lecture2/Lecture_2_Inst_copy.ipynb | gpl-3.0 | #Example conditional statements
x = 1
y = 2
x<y #x is less than y
#x is greater than y
x>y
#x is less-than or equal to y
x<=y
#x is greater-than or equal to y
x>=y
"""
Explanation: Lecture 2 - Logic, Loops, and Arrays
This iPython notebook covers some of the most important aspects of the Python language that is use... |
wasat/JupyTEPIDE | notebooks/deprecated/mapnik_display_product.ipynb | apache-2.0 | import mapnik
class Mapnik:
@staticmethod
def generate_thumb(infile, resolution, outfile="mapnik_tmp.png"):
symb = mapnik.RasterSymbolizer()
rule = mapnik.Rule()
rule.symbols.append(symb)
style = mapnik.Style()
style.rules.append(rule)
layer = mapnik.Layer("mapLa... |
kompgraf/course-material | notebooks/02-hermite-iv/02-hermite-iv.ipynb | mit | %matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def hermite():
t = np.linspace(0, 1, 100)
h0 = (2*(t**3)) + (-3 * (t**2)) + 1
h1 = (-2*(t**3)) + (3 * (t**2))
h2 = t**3 + (-2 * (t**2)) + t
h3 = t**3 + - t**2
fig = plt.figure()
axes = fig.add_axes([0... |
ES-DOC/esdoc-jupyterhub | notebooks/snu/cmip6/models/sandbox-2/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'snu', 'sandbox-2', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: SNU
Source ID: SANDBOX-2
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
mdiaz236/DeepLearningFoundations | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
# Use Floyd's cifar-10 dataset if present
floyd_cifar10... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/sandbox-1/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'sandbox-1', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: MPI-M
Source ID: SANDBOX-1
Topic: Atmoschem
Sub-Topics: Transport, Emission... |
whitead/numerical_stats | unit_7/hw_2017/problem_set_2.ipynb | gpl-3.0 | #example
example_data_do_not_use = [4,3,6,3]
print(sum(example_data_do_not_use))
"""
Explanation: Instructions
Compute the sample statistics on the given data using numpy. Write the equation in LaTeX first and then complete the computation in Python second. You may refer to equations in other problems. For example, t... |
sueiras/training | cs228-python-tutorial.ipynb | gpl-3.0 | def quicksort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) / 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quicksort(left) + middle + quicksort(right)
print quicksort([3,6,8,10,1,2,1])
"""
Explana... |
datacommonsorg/api-python | notebooks/Analyzing_SuperfundSites_with_Data_Commons.ipynb | apache-2.0 | # Refer: https://docs.datacommons.org/api/pandas/
!pip install datacommons_pandas datacommons geopandas plotly descartes --upgrade --quiet
# Import Data Commons
import datacommons as dc
import datacommons_pandas as dpd
# Import other required libraries
import matplotlib.pyplot as plt
import matplotlib.patches as mpat... |
gVallverdu/Slater | cookbook_slater_rule.ipynb | gpl-2.0 | import slater
print(slater.__doc__)
"""
Explanation: Slater module about the slater's rule
Germain Salvato-Vallverdu germain.vallverdu@univ-pau.fr
Atomic orbitals
The Klechkowski ... |
bmeaut/python_nlp_2017_fall | course_material/06_Decorators_Packaging/06_Decorators_packaging.ipynb | mit | def greeter(func):
print("Hello")
func()
def say_something():
print("Let's learn some Python.")
greeter(say_something)
"""
Explanation: Introduction to Python and Natural Language Technologies
Lecture 5
Decorators and packaging
11 October 2017
Let's create a greeter function
takes another functi... |
georgetown-analytics/yelp-classification | machine_learning/rec_testing.ipynb | mit | import json
import pandas as pd
import re
import string
from scipy import sparse
import numpy as np
from pymongo import MongoClient
from nltk.corpus import stopwords
%matplotlib inline
import matplotlib.pyplot as plt
from sklearn import svm
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.base i... |
jrbourbeau/cr-composition | notebooks/effective-area.ipynb | mit | %load_ext watermark
%watermark -u -d -v -p numpy,matplotlib,scipy,pandas,sklearn,mlxtend
"""
Explanation: <a id='top'> </a>
Author: James Bourbeau
End of explanation
"""
%matplotlib inline
from __future__ import division, print_function
from collections import defaultdict
import os
import numpy as np
from scipy impo... |
tanmay987/deepLearning | 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 scri... |
eds-uga/cbio4835-sp17 | lectures/Lecture7.ipynb | mit | a = [1, 2, 3, 4, 5]
for element in a:
print(element)
"""
Explanation: Lecture 7: Sequence Alignment
CBIO (CSCI) 4835/6835: Introduction to Computational Biology
Overview and Objectives
In our last lecture, we covered the basics of molecular biology and the role of sequence analysis. In this lecture, we'll dive dee... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_mne_dspm_source_localization.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.minimum_norm import (make_inverse_operator, apply_inverse,
write_inverse_operator)
"""
Explanation: Source localization with MNE/dSPM/sLORETA
The aim of this tutorials is to teach you h... |
DJCordhose/ai | notebooks/workshops/d2d/cnn-augmentation.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import matplotlib.pylab as plt
import numpy as np
from distutils.version import StrictVersion
import sklearn
print(sklearn.__version__)
assert StrictVersion(sklearn.__version__ ) >= StrictVersion('0.18.1')
import tensorflow as tf
t... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/recommendation_systems/labs/multitask.ipynb | apache-2.0 | # Installing the necessary libraries.
!pip install -q tensorflow-recommenders
!pip install -q --upgrade tensorflow-datasets
"""
Explanation: Multi-task recommenders
Learning Objectives
1. Training a model which focuses on ratings.
2. Training a model which focuses on retrieval.
3. Training a joint model that ass... |
nvergos/DAT-ATX-1_Project | Notebooks/2a. Supervised Learning - Regression Analysis.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
"""
Explanation: DAT-ATX-1 Capstone Project
Nikolaos Vergos, February 2016
nvergos@gmail.... |
martinjrobins/hobo | examples/stats/custom-model.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# Define the right-hand side of a system of ODEs
def r(y, t, p):
k1 = p[0] # Forward reaction rate
k2 = p[1] # Backward reaction rate
dydt = k1 * (1 - y) - k2 * y
return dydt
# Run an example simulation
p = [5, 3] ... |
hanezu/cs231n-assignment | assignment1/knn.ipynb | mit | import sys
print(sys.version)
# 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.rc... |
joshnsolomon/phys202-2015-work | assignments/assignment05/InteractEx03.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 3
Imports
End of explanation
"""
def soliton(x, t, c, a):
"""Return phi(x, t) for a soliton wave with co... |
anhaidgroup/py_entitymatching | notebooks/guides/.ipynb_checkpoints/Reading the CSV Files from Disk-checkpoint.ipynb | bsd-3-clause | import py_entitymatching as em
import pandas as pd
import os, sys
"""
Explanation: This IPython notebook illustrates how to read the CSV files from disk as tables and set their metadata.
First, we need to import py_entitymatching package and other libraries as follows:
End of explanation
"""
# Get the datasets direc... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/pandas/03.02-Data-Indexing-and-Selection.ipynb | mit | import pandas as pd
data = pd.Series([0.25, 0.5, 0.75, 1.0],
index=['a', 'b', 'c', 'd'])
data
data['b']
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png">
This notebook contains an excerpt from the Python Data Science Handbook by... |
pylablanche/MillionSong | MillionSong_Dataset_Exploration.ipynb | mit | import numpy as np
from scipy.stats import kurtosis, skew
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import cm
import seaborn as sb
import sqlite3
%matplotlib inline
plt.rcParams['figure.figsize'] = (8,6)
plt.rc('axes', titlesize=18)
plt.rc('axes', labelsize=15)
sb.set_palette('Dark2')
sb.set_... |
mjabri/holoviews | doc/Tutorials/Exporting.ipynb | bsd-3-clause | import numpy as np
import holoviews as hv
from holoviews.operation import contours
%reload_ext holoviews.ipython
"""
Explanation: Most of the other tutorials show you how to use HoloViews for interactive exploratory visualization of your data. When used with IPython Notebook, HoloViews also helps you establish a full... |
mathemage/h2o-3 | h2o-py/demos/LeNET.ipynb | apache-2.0 | def lenet(num_classes):
import mxnet as mx
data = mx.symbol.Variable('data')
# first conv
conv1 = mx.symbol.Convolution(data=data, kernel=(5,5), num_filter=20)
tanh1 = mx.symbol.Activation(data=conv1, act_type="tanh")
pool1 = mx.symbol.Pooling(data=tanh1, pool_type="max", kernel=(2,2), stride=(2... |
DataPilot/notebook-miner | summary_of_work/24. Similarity between corpuses.ipynb | apache-2.0 | # Necessary imports
import os
import time
from nbminer.notebook_miner import NotebookMiner
from nbminer.cells.cells import Cell
from nbminer.features.features import Features
from nbminer.stats.summary import Summary
from nbminer.stats.multiple_summary import MultipleSummary
from nbminer.encoders.ast_graph.ast_graph i... |
jalabort/templatetracker | notebooks/scrap/Kernelized Correlation Filters.ipynb | bsd-3-clause | images = []
for i in mio.import_images('../../data/face_images/*', verbose=True,
max_images=5):
i.crop_to_landmarks_proportion_inplace(0.5)
i = i.rescale_landmarks_to_diagonal_range(100)
images.append(i)
visualize_images(images)
"""
Explanation: Kernelized Correlation Filters
L... |
Unidata/unidata-python-workshop | notebooks/Jupyter_Notebooks/Jupyter Notebooks Introduction.ipynb | mit | temperature = 25
print(temperature)
"""
Explanation: <div style="width:1000 px">
<div style="float:right; width:98 px; height:98px;">
<img src="https://raw.githubusercontent.com/Unidata/MetPy/master/metpy/plots/_static/unidata_150x150.png" alt="Unidata Logo" style="height: 98px;">
</div>
<h1>Jupyter Notebooks Intro... |
LimeeZ/phys292-2015-work | assignments/phys202-project/project/NeuralNetworks.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
from IPython.html.widgets import interact
from sklearn.datasets import load_digits
digits = load_digits()
print(digits.data.shape)
def show_digit(i):
plt.matshow(digits.images[i]);
interact(show_digit, i=(0,100));
"""
Explanation: Neural Networks
This project w... |
GoogleCloudPlatform/practical-ml-vision-book | 11_adv_problems/11a_counting.ipynb | apache-2.0 | import tensorflow as tf
print(tf.version.VERSION)
device_name = tf.test.gpu_device_name()
if device_name != '/device:GPU:0':
raise SystemError('GPU device not found')
print('Found GPU at: {}'.format(device_name))
"""
Explanation: Enable GPU
This notebook and pretty much every other notebook in this repository will r... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/supplemental/labs/autoencoder.ipynb | apache-2.0 | from __future__ import absolute_import, division, print_function
import glob
import imageio
import os
import PIL
import time
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras import layers
from IPython import display
"""
Explanation: Convolutional Autoencoder on MNIST ... |
joe-antognini/kozai | docs/tutorial.ipynb | bsd-2-clause | from kozai.delaunay import TripleDelaunay
"""
Explanation: A stroll through the kozai python package
Installation
The kozai package is available on PyPI and can be installed with pip like so:
pip install kozai
If you don't have the right permissions, try installing it like this:
pip install --user kozai
If you run int... |
pbutenee/ml-tutorial | source/1/notebook_intro.ipynb | mit | print('Hello world!')
print(list(range(5)))
"""
Explanation: Jupyter Notebook and NumPy introduction
Jupyter notebook is often used by data scientists who work in Python. It is loosely based on Mathematica and combines code, text and visual output in one page.
Basic Jupyter Notebook commands
Some relevant short cuts:
... |
blua/deep-learning | language-translation/dlnd_language_translation_23.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)
"""
Explanation: Language Translation
In this project, you’re going... |
tensorflow/docs-l10n | site/en-snapshot/tutorials/estimator/linear.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... |
EricChiquitoG/Simulacion2017 | Modulo1/Clase4_OsciladorArmonico.ipynb | mit | from IPython.display import YouTubeVideo
YouTubeVideo('k5yTVHr6V14')
"""
Explanation: ¿Cómo se mueve un péndulo?
Se dice que un sistema cualquiera, mecánico, eléctrico, neumático, etc., es un oscilador armónico si, cuando se deja en libertad fuera de su posición de equilibrio, vuelve hacia ella describiendo oscilacio... |
rescu/brainstorm | root_finding.ipynb | mit | x=np.linspace(-15,5,1000)
x_zeros=[-1,-9]
fig = plt.figure(figsize=(10,10))
ax = fig.gca()
ax.plot(x,0*x,'--k',linewidth=2.0)
ax.plot(x,x**2+10*x+9,linewidth=2.0)
ax.plot(x_zeros,[0,0],'ro',markersize=10)
ax.set_xlabel(r'$x$',fontsize=22)
ax.set_ylabel(r'$f(x)$',fontsize=22)
ax.set_title(r'$f(x)=x^2+10x+9$',fontsize=22... |
flo-compbio/goparser | docs/source/notebooks/Demo.ipynb | gpl-3.0 | # get package versions
from pkg_resources import require
print 'Package versions'
print '----------------'
print require('genometools')[0]
print require('goparser')[0]
gene_annotation_file = 'Homo_sapiens.GRCh38.82.gtf.gz'
protein_coding_gene_file = 'protein_coding_genes_human.tsv'
go_annotation_file = 'gene_associat... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/ml_ops/stage2/get_started_with_tabnet.ipynb | apache-2.0 | import os
# The Vertex AI Workbench Notebook product has specific requirements
IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME")
IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists(
"/opt/deeplearning/metadata/env_version"
)
# Vertex AI Notebook requires dependencies to be installed with '--user'
USER_FLAG = ... |
NEONScience/NEON-Data-Skills | tutorials-in-development/CyverseNEON/aop_data_download/Download_NEON_AOP_Data_Python_API.ipynb | agpl-3.0 | from neon_download_functions import *
"""
Explanation: Download NEON AOP Lidar and Hyperspectral Data using the API
This tutorial runs through downloading NEON AOP data using the API. We will not go into all the details of the API here, but for more information, please refer to the additional resources at the bottom o... |
TESScience/FPE_Test_Procedures | Evaluating Parameter Interdependence.ipynb | mit | from tessfpe.dhu.fpe import FPE
from tessfpe.dhu.unit_tests import check_house_keeping_voltages
import time
fpe1 = FPE(1, debug=False, preload=False, FPE_Wrapper_version='6.1.2')
print fpe1.version
time.sleep(.01)
if check_house_keeping_voltages(fpe1):
print "Wrapper load complete. Interface voltages OK."
"""
Expl... |
harmsm/pythonic-science | chapters/06_image-analysis/01_counting-colonies.ipynb | unlicense | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.color import rgb2gray
"""
Explanation: Counting Colonies with scikit-image
End of explanation
"""
image = np.array(Image.open("img/colonies.jpg"))
plt.ims... |
LSSTC-DSFP/LSSTC-DSFP-Sessions | Sessions/Session11/Day3/GalaxyPhotometryAndShapesSolutions.ipynb | mit | # Load the packages we will use
import numpy as np
import astropy.io.fits as pf
import astropy.coordinates as co
from matplotlib import pyplot as pl
import scipy.fft as fft
%matplotlib inline
"""
Explanation: Practice with galaxy photometry and shape measurement
To accompany galaxy-measurement lecture from the LSSTC D... |
khrapovs/metrix | notebooks/mle_uniform.ipynb | mit | import numpy as np
import matplotlib.pylab as plt
import seaborn as sns
np.set_printoptions(precision=4, suppress=True)
sns.set_context('notebook')
%matplotlib inline
"""
Explanation: MLE with exponential distribution
End of explanation
"""
theta = [[1., 2], [.5, 2.5], [.25, 2.75]]
def f(x, a, b):
if x < a or... |
ChadFulton/statsmodels | examples/notebooks/exponential_smoothing.ipynb | bsd-3-clause | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
data = [446.6565, 454.4733, 455.663 , 423.6322, 456.2713, 440.5881, 425.3325, 485.1494, 506.0482, 526.792 , 514.2689, 494.211 ]
index= pd.DatetimeInd... |
tensorflow/recommenders-addons | docs/tutorials/embedding_variable_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... |
travc/paper-Predicted-MF-Quarantine-Length-Data-and-Code | code/Temperature datasets summary.ipynb | mit | # boilerplate includes
import sys
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.basemap import Basemap
import matplotlib.patheffects as path_effects
import pandas as pd
import seaborn as sns
import datetime
# import sc... |
pkreissl/espresso | doc/tutorials/error_analysis/error_analysis_part2.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
import sys
import logging
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
np.random.seed(43)
def ar_1_process(n_samples, c, phi, eps):
'''
Generate a correlated random sequence with the AR(1) process.
Par... |
chrisfilo/fmri-analysis-vm | analysis/machinelearning/Classification.ipynb | mit | # adapted from http://scikit-learn.org/stable/auto_examples/neighbors/plot_classification.html#example-neighbors-plot-classification-py
n_neighbors = 30
# step size in the mesh
# Create color maps
cmap_light = ListedColormap(['#FFAAAA', '#AAFFAA'])
cmap_bold = ListedColormap(['#FF0000', '#00FF00'])
clf = sklearn.ne... |
AlienVault-Labs/OTX-Python-SDK | howto_use_python_otx_api.ipynb | apache-2.0 | from OTXv2 import OTXv2, IndicatorTypes
from pandas.io.json import json_normalize
from datetime import datetime, timedelta
otx = OTXv2("")
"""
Explanation: Using the OTX-Python-SDK
API Key Configuration
End of explanation
"""
pulses = otx.getall()
len(pulses)
"""
Explanation: Replace YOUR_KEY with your OTX API ... |
jerjorg/BZI | notebooks/Grid Quality.ipynb | gpl-3.0 | import numpy as np
from BZI.symmetry import make_ptvecs, make_rptvecs
from BZI.sampling import sphere_pts
# These lattice constants were calculated in Mathematica and
# are such that the volumes are the same.
a_fcc = 1.
a_bcc = 0.793701
a_sc = 0.629961
fcc_consts = [a_fcc]*3
bcc_consts = [a_bcc]*3
sc_consts = [a_sc]... |
cbare/Etudes | notebooks/linear_model.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sklearn as sk
from sklearn.linear_model import LinearRegression
from string import ascii_lowercase as letters
"""
Explanation: Linear models
End of explanation
"""
n = 1000
p = 10
X = np.random.standard_normal((n,p))
X.shape
A = np.ran... |
KshitijT/fundamentals_of_interferometry | 6_Deconvolution/6_5_source_finding.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
import matplotlib
from scipy import optimize
import astropy.io.fits
matplotlib.rcParams.update({'font.size': 18})
matplotlib.rcParams.update({'figure.figsize': [12,8]}... |
idc9/law-net | vertex_metrics_experiment/data_pipeline_federal.ipynb | mit | setup_data_dir(data_dir)
make_subnetwork_directory(data_dir, network_name)
"""
Explanation: set up the data directory
End of explanation
"""
download_op_and_cl_files(data_dir, network_name)
"""
Explanation: data download
get opinion and cluster files from CourtListener
opinions/cluster files are saved in data_dir/... |
karlstroetmann/Formal-Languages | Python/Shift-Reduce-Parser-Pure.ipynb | gpl-2.0 | import re
"""
Explanation: A Shift-Reduce Parser for Arithmetic Expressions
In this notebook we implement a generic shift reduce parser. The parse table that we use
implements the following grammar for arithmetic expressions:
$$
\begin{eqnarray}
\mathrm{expr} & \rightarrow & \mathrm{expr}\;\;\texttt{'+'}\... |
karlstroetmann/Artificial-Intelligence | Python/Python-Tutorial.ipynb | gpl-2.0 | def quicksort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) // 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quicksort(left) + middle + quicksort(right)
quicksort([3,6,8,10,1,2,1])
"""
Explan... |
shenlanxueyuan/pythoncourse | Lesson10.ipynb | mit | df = pd.read_csv('breast-cancer-wisconsin.data', names=[
'Sample code number',
'Clump Thickness',
'Uniformity of Cell Size',
'Uniformity of Cell Shape',
'Marginal Adhesion',
'Single Epithelial Cell Size'
'Bare Nuclei',
'Bland Chromatin',
'Normal Nucleoli',
'Mitoses',
'Class'
... |
joashxu/JakartaOSMData | summary.ipynb | mit | from osm_dataauditor import OSMDataAuditor
osm_data = OSMDataAuditor('jakarta_indonesia.osm')
# Basic element check
osm_data.count_element()
"""
Explanation: Wrangling OpenStreetMap Data
Map area: Jakarta, Indonesia
Data source: https://s3.amazonaws.com/metro-extracts.mapzen.com/jakarta_indonesia.osm.bz2
Overview
... |
ES-DOC/esdoc-jupyterhub | notebooks/hammoz-consortium/cmip6/models/sandbox-1/atmos.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'hammoz-consortium', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: HAMMOZ-CONSORTIUM
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamic... |
ilyasku/jpkfile | examples/read_data_from_jpk_archive.ipynb | mit | import jpkfile
"""
Explanation: Load the module
If you added the folder in which jpkfile.py is to you site-packages, you should be able to import the module.
End of explanation
"""
jpk = jpkfile.JPKFile("../examples/force-save-2016.06.15-13.17.08.jpk-force")
"""
Explanation: Create a JPKFile object
End of explanati... |
pysal/spaghetti | notebooks/pointpattern-attributes.ipynb | bsd-3-clause | %config InlineBackend.figure_format = "retina"
%load_ext watermark
%watermark
import geopandas
import libpysal
import matplotlib
import matplotlib_scalebar
from matplotlib_scalebar.scalebar import ScaleBar
import numpy
import pandas
import shapely
from shapely.geometry import Point
import spaghetti
%matplotlib inlin... |
elenduuche/deep-learning | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
class DLProgress(tqdm):
last_block = 0
def hoo... |
QuantStack/quantstack-talks | 2019-12-11-erdc-xtensor/src/xtensor - xmesh extension module.ipynb | bsd-3-clause | import numpy as np
import pymesh
import bqplot.pyplot as plt
"""
Explanation: xmesh: A 1k lines N-D Delaunay triangulation
xmesh-python: A 20 lines xtensor-numpy bindings for xmesh
End of explanation
"""
points = np.random.randn(100, 2)
mesh = pymesh.Mesh(points)
lines = np.stack(simplex.lines() for simplex in mesh... |
anthonyng2/FX-Trading-with-Python-and-Oanda | Oanda v20 REST-oandapyV20/MKT + SL + PS.ipynb | mit | import pandas as pd
import oandapyV20
import oandapyV20.endpoints.orders as orders
accountID = ''
access_token = ''
client = oandapyV20.API(access_token=access_token)
r = orders.OrderList(accountID)
client.request(r)
store = []
# Check for current open orders
for oo in r.response['orders']:
store.append(oo)
pd.Da... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_linear_model_patterns.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.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... |
pyro-ppl/numpyro | notebooks/source/logistic_regression.ipynb | apache-2.0 | !pip install -q numpyro@git+https://github.com/pyro-ppl/numpyro
import time
import numpy as np
import jax.numpy as jnp
from jax import random
import numpyro
import numpyro.distributions as dist
from numpyro.examples.datasets import COVTYPE, load_dataset
from numpyro.infer import HMC, MCMC, NUTS
assert numpyro.__ve... |
scottprahl/miepython | docs/03a_normalization.ipynb | mit | #!pip install --user miepython
import numpy as np
import matplotlib.pyplot as plt
try:
import miepython
except ModuleNotFoundError:
print('miepython not installed. To install, uncomment and run the cell above.')
print('Once installation is successful, rerun this cell again.')
"""
Explanation: Scattering... |
srcole/qwm | yelp/Scrape - food by cities.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import json
import time
import os
from json.decoder import JSONDecodeError
import util
"""
Explanation: Experiments with Yelp API
Notes:
* Documentation: https://www.yelp.com/developers/documentation/v3
* Limit of 25,000 calls ... |
mmatera/qmnotebooks | Práctica 0 - Problema 6 - Inciso 2.ipynb | gpl-3.0 | %matplotlib inline
import matplotlib.pyplot as plt
import scipy.special as sf
import scipy.integrate
import warnings
warnings.filterwarnings('ignore')
import numpy as np
def coulomb(r,kr0,l):
res = scipy.integrate.quad(lambda u:
(1-u**2)**l * np.cos(.5*np.log((1+u)/(1-u))/kr0 +u... |
Mahdisadjadi/phoenixcrime | analysis.ipynb | mit | import numpy as np
import pandas as pd
try:
# module exists
import seaborn as sns
seaborn_exists = True
except ImportError:
# module doesn't exist
seaborn_exists = True
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
%matplotlib inline
# custom features of plots
plt.rcPa... |
Hugovdberg/timml | notebooks/timml_notebook2_sol.ipynb | mit | %matplotlib inline
from timml import *
from pylab import *
figsize=(8, 8)
# Create basic model elements
ml = ModelMaq(kaq=[2, 6, 4],
z=[165, 140, 120, 80, 60, 0],
c=[2000, 20000],
npor=0.3)
rf = Constant(ml, xr=20000, yr=20000, hr=175, layer=0)
p = CircAreaSink(ml, xc=10000, yc=10000, ... |
elsuizo/Control_de_robots_py | tp1.ipynb | gpl-3.0 | from sympy import *
from IPython.core.display import Image
#Con esto las salidas van a ser en LaTeX
init_printing(use_latex=True)
Image(filename='Imagenes/dibujo_tp1_ej1.jpg')
"""
Explanation: Martín Noblía
Tp1
Control de Robots 2013
Licencia:
Ejercicio 1
Un vector $^{A}P$ es rotado alrededor de $Z_A$ un ángulo... |
thalesians/tsa | src/jupyter/python/utils.ipynb | apache-2.0 | for x in utils.xbatch(2, range(10)):
print(x)
for x in utils.xbatch(3, ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']):
print(x)
for x in utils.xbatch(3, ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'O... |
msanterre/deep_learning | batch-norm/Batch_Normalization_Exercises.ipynb | mit | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False)
"""
Explanation: Batch Normalization – Practice
Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con... |
rbberger/lammps | python/examples/pylammps/interface_usage_bonds.ipynb | gpl-2.0 | from lammps import IPyLammps
L = IPyLammps()
# 2d circle of particles inside a box with LJ walls
import math
b = 0
x = 50
y = 20
d = 20
# careful not to slam into wall too hard
v = 0.3
w = 0.08
L.units("lj")
L.dimension(2)
L.atom_style("bond")
L.boundary("f f p")
L.lattice("hex", 0.85)
L.region("... |
mne-tools/mne-tools.github.io | 0.20/_downloads/34fd5b71616977c61ebac55c010819c1/plot_beamformer_lcmv.ipynb | bsd-3-clause | # Author: Britta Westner <britta.wstnr@gmail.com>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample, fetch_fsaverage
from mne.beamformer import make_lcmv, apply_lcmv
"""
Explanation: Source reconstruction using an LCMV beamformer
This tutorial gives an overview of... |
maartenbreddels/vaex | docs/source/datasets.ipynb | mit | import vaex
import warnings; warnings.filterwarnings("ignore")
df = vaex.open('/data/yellow_taxi_2009_2015_f32.hdf5')
print(f'number of rows: {df.shape[0]:,}')
print(f'number of columns: {df.shape[1]}')
long_min = -74.05
long_max = -73.75
lat_min = 40.58
lat_max = 40.90
df.plot(df.pickup_longitude, df.pickup_latitu... |
ishanhanda/ImageClassificationStudy | PythonNotebooks/ROC_and_CI/Comp_Vision_Ishan_Handa_ROC_and_CI_Hedgehog.ipynb | apache-2.0 | import matplotlib.pyplot as plt
import numpy
import csv
# Change the path to csv file appropriately
hedgehog_positive_csv = '/Users/ishanhanda/Documents/NYU_Fall16/Comp_Vision/Project/ProjectWorkspace/DataSets/OUTPUTS/Hedgehog.csv'
hedgehog_negative_csv = '/Users/ishanhanda/Documents/NYU_Fall16/Comp_Vision/Project/Pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.