repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
julienchastang/unidata-python-workshop
notebooks/Time_Series/Basic Time Series Plotting.ipynb
mit
from siphon.simplewebservice.ndbc import NDBC data_types = NDBC.buoy_data_types('46042') print(data_types) """ Explanation: <a name="top"></a> <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_...
datactive/bigbang
examples/organizations/Using Domain Entropy to Identify Organizations.ipynb
mit
arx = Archive("httpbisa",mbox=True) """ Explanation: Preparing the data Open a mailing list archive. End of explanation """ email_regex = r'[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+' domain_regex = r'[@]([a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)$' email = re.search(email_regex, "Gerald Oskoboiny <gerald@w3.org>")[0] re.s...
boompieman/iim_project
Poem_Segmentation_Demo_Python/khan_segmentation.ipynb
gpl-3.0
# Import required libraries import os import csv import segeval as se import numpy as np import matplotlib.pyplot as plt import itertools as it from collections import defaultdict from decimal import Decimal from hcluster import linkage, dendrogram, fcluster """ Explanation: An initial study of topical poetry segmenta...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/machine_learning_in_the_enterprise/solutions/sdk_custom_xgboost.ipynb
apache-2.0
# import necessary libraries import os # Google Cloud Notebook if os.path.exists("/opt/deeplearning/metadata/env_version"): USER_FLAG = "--user" else: USER_FLAG = "" ! pip3 install --upgrade google-cloud-aiplatform $USER_FLAG """ Explanation: Migrating Custom XGBoost Model with Pre-built Training Container L...
Arn-O/kadenze-deep-creative-apps
session-0/session-0.ipynb
apache-2.0
4*2 """ Explanation: Session 0: Preliminaries with Python/Notebook <p class="lead"> Parag K. Mital<br /> <a href="https://www.kadenze.com/courses/creative-applications-of-deep-learning-with-tensorflow/info">Creative Applications of Deep Learning w/ Tensorflow</a><br /> <a href="https://www.kadenze.com/partners/kadenze...
csaladenes/csaladenes.github.io
present/mcc2/PythonDataScienceHandbook/05.08-Random-Forests.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import seaborn as sns; sns.set() """ 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 Jake VanderPlas; t...
gabicfa/RedesSociais
encontro02/.ipynb_checkpoints/1-introducao-checkpoint.ipynb
gpl-3.0
import sys sys.path.append('..') import socnet as sn """ Explanation: Encontro 02, Parte 1: Revisão de Grafos Este guia foi escrito para ajudar você a atingir os seguintes objetivos: formalizar conceitos básicos de teoria dos grafos; usar funcionalidades básicas da biblioteca da disciplina. Grafos não-dirigidos Um ...
kit-cel/wt
sigNT/tutorial/taxi_problem.ipynb
gpl-2.0
# importing import numpy as np import matplotlib.pyplot as plt import matplotlib # showing figures inline %matplotlib inline # plotting options font = {'size' : 30} plt.rc('font', **font) plt.rc('text', usetex=True) matplotlib.rc('figure', figsize=(30, 15) ) """ Explanation: Content and Objective Show result ...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/introduction_to_tensorflow/labs/imbalanced_data.ipynb
apache-2.0
# Import necessary libraries. import tensorflow as tf from tensorflow import keras import os import tempfile import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import sklearn from sklearn.metrics import confusion_matrix from sklearn.model_selection i...
Kaggle/learntools
notebooks/pandas/raw/tut_4.ipynb
apache-2.0
#$HIDE_INPUT$ import pandas as pd reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0) pd.set_option('max_rows', 5) reviews.price.dtype """ Explanation: Introduction In this tutorial, you'll learn how to investigate data types within a DataFrame or Series. You'll also learn how to fin...
pagutierrez/tutorial-sklearn
notebooks-spanish/12-caso_estudio_deteccion_spam_SMS.ipynb
cc0-1.0
import os with open(os.path.join("datasets", "smsspam", "SMSSpamCollection")) as f: lines = [line.strip().split("\t") for line in f.readlines()] text = [x[1] for x in lines] y = [int(x[0] == "spam") for x in lines] text[:10] y[:10] print('Número de mensajes de ham/spam:', np.bincount(y)) type(text) type(y) ...
ntoll/poem-o-matic
poem-o-matic.ipynb
mit
from os import listdir from os.path import isfile, join mypath = 'sources' filenames = [join(mypath, f) for f in listdir(mypath) if isfile(join(mypath, f))] print(filenames) """ Explanation: Poem-O-Matic This is a description, in both code and prose, of how to generate original poetry on demand using a computer and ...
TomAugspurger/engarde
examples/Basics.ipynb
mit
# This will take a few minutes r = requests.get("http://www.transtats.bts.gov/Download/On_Time_On_Time_Performance_2015_1.zip", stream=True) with open("otp-1.zip", "wb") as f: for chunk in r.iter_content(chunk_size=1024): f.write(chunk) f.flush() r.close() z = zipfile.ZipFile("otp...
Stargator/gregreda-jekylified
content/notebooks/cohort-analysis.ipynb
mit
df['OrderPeriod'] = df.OrderDate.apply(lambda x: x.strftime('%Y-%m')) df.head() """ Explanation: 1. Create a period column based on the OrderDate Since we're doing monthly cohorts, we'll be looking at the total monthly behavior of our users. Therefore, we don't want granular OrderDate data (right now). End of explanat...
guruucsd/EigenfaceDemo
python/Neural Network Tricks.ipynb
mit
%pycat neural_network.py from sklearn.decomposition import PCA from sklearn.cross_validation import train_test_split, ShuffleSplit from sklearn.preprocessing import OneHotEncoder from neural_network import NeuralNetwork # The classifier network class ClassifierNetwork(NeuralNetwork): """Neural network with class...
taylorwood/Kaggle.HomeDepot
ProjectSearchRelevance.Python/Home Depot Product Search Relevance Features.ipynb
mit
import graphlab as gl """ Explanation: Home Depot Product Search Relevance The challenge is to predict a relevance score for the provided combinations of search terms and products. To create the ground truth labels, Home Depot has crowdsourced the search/product pairs to multiple human raters. LabGraph Create This not...
karlstroetmann/Artificial-Intelligence
Python/Set.ipynb
gpl-2.0
class Set: def __init__(self): self.mKey = None self.mLeft = None self.mRight = None self.mHeight = 0 """ Explanation: Sets implemented as AVL Trees This notebook implements <em style="color:blue;">sets</em> as <a href="https://en.wikipedia.org/wiki/AVL_tree">AVL trees</a>. T...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/08_lateral_movement/WIN-200902020333.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Remote WMI ActiveScriptEventConsumers Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2020/09/02 | | modification date | 2020/09/20 | | playbook rel...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_sensor_connectivity.ipynb
bsd-3-clause
# Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD (3-clause) import numpy as np from scipy import linalg import mne from mne import io from mne.connectivity import spectral_connectivity from mne.datasets import sample print(__doc__) """ Explanation: Compute all-to-all connectivity in sensor spa...
SamLau95/nbinteract
docs/notebooks/examples/examples_probability_distribution_plots.ipynb
bsd-3-clause
# Although this function doesn't appear necessary, the scipy stats functions # don't explicitly require n and p as args which causes issues with interaction def binom_pmf(xs, n, p): return stats.binom.pmf(xs, n, p) options = { 'xlabel': 'X', 'ylabel': 'probability', 'ylim': (0, 1), } nbinteract.bar(np...
coryandrewtaylor/conll10
CoNLL10 output with SpaCy.ipynb
gpl-3.0
import spacy """ Explanation: Dependency parsing with spaCy This script takes Unicode plain text and outputs its dependencies in CoNLL10 format. It was originally written to prepare input files for named/non-named entity extraction with xrenner. For installation instructions for spaCy, see https://spacy.io/docs#gettin...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/statespace_varmax.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt dta = sm.datasets.webuse('lutkepohl2', 'https://www.stata-press.com/data/r12/') dta.index = dta.qtr dta.index.freq = dta.index.inferred_freq endog = dta.loc['1960-04-01':'1978-10-01', ['dln_inv', 'dl...
google/applied-machine-learning-intensive
content/03_regression/04_polynomial_regression/colab.ipynb
apache-2.0
# 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 the L...
IIPBC/Material
Notebooks/Python BootCamp 2017 - A example of a notebook.ipynb
mit
import numpy x = numpy.arange(0, 100, 0.1) y = numpy.cos(x) """ Explanation: Sample Notebook This Jupyter Notebook is intended to be an example with some references. Jupyter uses Markdown Syntax and accept LaTeX and HTML codes. With this, one can easily write bold or italic words. One can also type some code inline or...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_ssp_projs_sensitivity_map.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt from mne import read_forward_solution, read_proj, sensitivity_map from mne.datasets import sample print(__doc__) data_path = sample.data_path() subjects_dir = data_path + '/subjects' f...
turi-code/tutorials
webinars/product-reviews/text_demo.ipynb
apache-2.0
import graphlab as gl from graphlab.toolkits.text_analytics import trim_rare_words, split_by_sentence, extract_part_of_speech, stopwords, PartOfSpeech def nlp_pipeline(reviews, title, aspects): print(title) print('1. Get reviews for this product') reviews = reviews.filter_by(title, 'name') prin...
cgpotts/cs224u
rel_ext_01_task.ipynb
apache-2.0
__author__ = "Bill MacCartney and Christopher Potts" __version__ = "CS224u, Stanford, Spring 2022" """ Explanation: Relation extraction using distant supervision: task definition End of explanation """ import random import os from collections import Counter, defaultdict import rel_ext import utils # Set all the ran...
beangoben/quantum_solar
Dia1/3_Graficame_Espectro_Solar.ipynb
mit
import numpy as np # modulo de computo numerico import matplotlib.pyplot as plt # modulo de graficas import pandas as pd # modulo de datos import seaborn as sns # esta linea hace que las graficas salgan en el notebook %matplotlib inline """ Explanation: Intro a Matplotlib Matplotlib = Libreria para graficas cosas mate...
tensorflow/docs-l10n
site/en-snapshot/guide/estimator.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...
tensorflow/docs-l10n
site/en-snapshot/guide/keras/writing_a_training_loop_from_scratch.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...
gertingold/lit2015
pugmuc2015.ipynb
mit
for n in range(3): print("The IPython notebook is great.") """ Explanation: Working with the IPython notebook Gert-Ludwig Ingold <div style="margin-top:10ex;font-size:smaller">source: `git clone https://github.com/gertingold/lit2015`</div> <div style="font-size:smaller">static view: http://nbviewer.ipython.org/g...
BBN-Q/Auspex
doc/examples/Example-Filter-Pipeline.ipynb
apache-2.0
from QGL import * cl = ChannelLibrary(":memory:") # Create five qubits and supporting hardware for i in range(5): q1 = cl.new_qubit(f"q{i}") cl.new_APS2(f"BBNAPS2-{2*i+1}", address=f"192.168.5.{101+2*i}") cl.new_APS2(f"BBNAPS2-{2*i+2}", address=f"192.168.5.{102+2*i}") cl.new_X6(f"X6_{i}", address=0) ...
jnarhan/Breast_Cancer
src/img_processing/RemoveArtifacts.ipynb
mit
__version__ = '0.1.0' __status__ = 'Development' __date__ = '2017-March-21' __author__ = 'Jay Narhan' import os import cv2 import copy import numpy as np from matplotlib import pyplot as plt %matplotlib inline from IPython.display import clear_output import time """ Explanation: <h1>Removing Artifacts ...
psas/composite-propellant-tank
Analysis/Calculations/.ipynb_checkpoints/Shrink Fit and Liner as Gasket Analysis-checkpoint.ipynb
gpl-3.0
# Import packages here: import math as m import numpy as np from IPython.display import Image import matplotlib.pyplot as plt # Properties of Materials (engineeringtoolbox.com, Cengel, Tian, DuPont, http://www.dtic.mil/dtic/tr/fulltext/u2/438718.pdf) # Coefficient of Thermal Expansion alphaAluminum = 0.0000131 # in...
sdpython/ensae_teaching_cs
_doc/notebooks/td1a_home/2020_carte.ipynb
mit
from jyquickhelper import add_notebook_menu add_notebook_menu() %matplotlib inline """ Explanation: Tech - carte Faire une carte, c'est toujours compliqué. C'est simple jusqu'à ce qu'on s'aperçoive qu'on doit récupérer la description des zones administratives d'un pays, fournies parfois dans des coordonnées autres qu...
eecs445-f16/umich-eecs445-f16
handsOn_lecture12_bagging-boosting/handsOn12.ipynb
mit
import pandas as pd df = pd.read_csv('forest-cover-type.csv') df.head() """ Explanation: Recall: Boosting AdaBoost Algorithm An iterative algorithm for "ensembling" base learners Input: ${(\mathbf{x}i, y_i)}{i = 1}^n, T, \mathscr{F}$, base learner Initialize: $\mathbf{w}^{1} = (\frac{1}{n}, ..., \frac{1}{n})$ For $t...
dsacademybr/PythonFundamentos
Cap07/DesafioDSA/Missao3/missao3.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 7</font> Download: http://github.com/dsacademybr End of explanation """ class G...
c22n/ion-channel-ABC
docs/examples/human-atrial/nygren_isus_original.ipynb
gpl-3.0
import os, tempfile import logging import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import numpy as np from ionchannelABC import theoretical_population_size from ionchannelABC import IonChannelDistance, EfficientMultivariateNormalTransition, IonChannelAcceptor from ionchannelABC.experimen...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/feature_engineering/labs/sdk-feature-store.ipynb
apache-2.0
import os # The Google Cloud Notebook product has specific requirements IS_GOOGLE_CLOUD_NOTEBOOK = os.path.exists("/opt/deeplearning/metadata/env_version") # Google Cloud Notebook requires dependencies to be installed with '--user' USER_FLAG = "" if IS_GOOGLE_CLOUD_NOTEBOOK: USER_FLAG = "--user" # Install necess...
csc-training/python-introduction
notebooks/examples/2 - Control Structures.ipynb
mit
value = 4 value = value + 1 if value < 5: print("value is less than 5") elif value > 5: print("value is more than 5") else: print("value is precisely 5") # go ahead and experiment by changing the value """ Explanation: Conditional statements The most common conditional statement in Python is the if-elif-e...
dietmarw/EK5312_ElectricalMachines
Chapman/Ch4-Problem_4-13.ipynb
unlicense
%pylab notebook %precision 1 """ Explanation: Excercises Electric Machinery Fundamentals Chapter 4 Problem 4-13 End of explanation """ Sbase = 25e6 # [VA] Vbase = 12.2e3 # [V] PF = 0.9 Ra = 0.6 # [Ohm] """ Explanation: Description A 25-MVA, 12.2-kV, 0.9-PF-lagging, three-phase, two-pole, Y-connected, 60-Hz ...
nathawkins/PHY451_FS_2017
Diode Laser Spectroscopy/20171003_morning/Interference with SAS no Dopple/.ipynb_checkpoints/Interferometer with SAS No Doppler Analysis-checkpoint.ipynb
gpl-3.0
get_peak_data(ch2, [0.025, 0.030]); get_peak_data(ch2, [0.030, 0.035]); get_peak_data(ch2, [0.0350,0.045]); get_peak_data(ch2, [0.049, 0.0517]); maximum_time_positions = [0.028124, 0.03266, 0.042744, 0.05052] maximum_voltage_positions = [0.738, 0.53, 0.716, 0.48] # Two subplots, unpack the axes array immediately f...
scikit-optimize/scikit-optimize.github.io
dev/notebooks/auto_examples/optimizer-with-different-base-estimator.ipynb
bsd-3-clause
print(__doc__) import numpy as np np.random.seed(1234) import matplotlib.pyplot as plt from skopt.plots import plot_gaussian_process from skopt import Optimizer """ Explanation: Use different base estimators for optimization Sigurd Carlen, September 2019. Reformatted by Holger Nahrstaedt 2020 .. currentmodule:: skopt...
tpin3694/tpin3694.github.io
python/pandas_make_new_columns_using_functions.ipynb
mit
# Import modules import pandas as pd # Example dataframe raw_data = {'regiment': ['Nighthawks', 'Nighthawks', 'Nighthawks', 'Nighthawks', 'Dragoons', 'Dragoons', 'Dragoons', 'Dragoons', 'Scouts', 'Scouts', 'Scouts', 'Scouts'], 'company': ['1st', '1st', '2nd', '2nd', '1st', '1st', '2nd', '2nd','1st', '1st', '2...
TheKingInYellow/PySeidon
PySeidon_tuto_4.ipynb
agpl-3.0
%pylab inline """ Explanation: PySeison - Tutorial 4: TideGauge class End of explanation """ from pyseidon import * """ Explanation: 1. PySeidon - TideGauge object initialisation Similarly to the "ADCP class" and the "Drifter class", the "TideGauge class" is a measurement-based object. 1.1. Package importation As a...
awsteiner/o2sclpy
doc/static/examples/buchdahl.ipynb
gpl-3.0
import o2sclpy import matplotlib.pyplot as plot import ctypes import numpy import sys plots=True if 'pytest' in sys.modules: plots=False """ Explanation: Buchdahl equation of state example for O$_2$sclpy See the O$_2$sclpy documentation at https://neutronstars.utk.edu/code/o2sclpy for more information. End of exp...
atulsingh0/MachineLearning
BMLSwPython/01_GettingStarted_withPython.ipynb
gpl-3.0
start = timeit.timeit() X = range(1000) pySum = sum([n*n for n in X]) end = timeit.timeit() print("Total time taken: ", end-start) """ Explanation: Comparing the time End of explanation """ # reading the web data data = sp.genfromtxt("data/web_traffic.tsv", delimiter="\t") print(data[:3]) print(len(data)) """...
freedomofpress/fingerprint-securedrop
notebooks/data_crawling_status.ipynb
agpl-3.0
import os import pandas as pd import sqlalchemy import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') with open(os.environ["PGPASS"], "rb") as f: content = f.readline().decode("utf-8").replace("\n", "").split(":") engine = sqlalchemy.create_engine("postgresql://{user}:{...
mdeff/ntds_2017
projects/reports/movie_success/YouTube_analytics.ipynb
mit
%matplotlib inline import configparser import os import requests from tqdm import tqdm import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import sparse, stats, spatial import scipy.sparse.linalg from sklearn import preprocessing, decomposition import librosa import IPython.display as ip...
gcrahay/otx_misp
src/otx_misp/otx/howto_use_python_otx_api.ipynb
apache-2.0
pulses = otx.getall() len(pulses) """ Explanation: Replace YOUR_KEY with your OTX API key. You can find it in your settings page https://otx.alienvault.com/settings The getall() method downloads all the OTX pulses and their assocciated indicators of compromise (IOCs) from your account. This includes all of the follow...
noppanit/social-network-analysis
Centralities.ipynb
mit
%matplotlib inline import networkx as nx import matplotlib.pyplot as plt import operator import timeit g_fb = nx.read_edgelist('facebook_combined.txt', create_using = nx.Graph(), nodetype = int) print nx.info(g_fb) print nx.is_directed(g_fb) """ Explanation: Centralities In this section, I'm going to learn how Cent...
kraemerd17/kraemerd17.github.io
courses/python/material/ipynbs/Time Series.ipynb
mit
from __future__ import division from pandas import Series, DataFrame import pandas as pd from numpy.random import randn import numpy as np pd.options.display.max_rows = 12 np.set_printoptions(precision=4, suppress=True) import matplotlib.pyplot as plt plt.rc('figure', figsize=(12, 4)) %matplotlib inline """ Explanati...
eds-uga/csci1360-fa16
assignments/A2/A2_Q2.ipynb
mit
def return_ordinals(numbers): out_list = [] ### BEGIN SOLUTION ### END SOLUTION return out_list inlist = [5, 6, 1, 9, 5, 5, 3, 3, 9, 4] outlist = ["5th", "6th", "1st", "9th", "5th", "5th", "3rd", "3rd", "9th", "4th"] for y_true, y_pred in zip(outlist, return_ordinals(inlist)): assert...
bradleypallen/fb15k-akbc
FB15K-237 Evaluation.ipynb
mit
import pandas as pd import numpy as np from operator import itemgetter from CFModel import CFModel """ Explanation: Import packages End of explanation """ TEST_CSV_FILE = 'fb15k_test.csv' CVSC_ENTITIES_CSV_FILE = 'fb15k_cvsc_entities.csv' CVSC_PAIRS_CSV_FILE = 'fb15k_cvsc_pairs.csv' MODEL_WEIGHTS_FILE = 'test_weight...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_xdawn_denoising.ipynb
bsd-3-clause
# Authors: Alexandre Barachant <alexandre.barachant@gmail.com> # # License: BSD (3-clause) from mne import (io, compute_raw_covariance, read_events, pick_types, Epochs) from mne.datasets import sample from mne.preprocessing import Xdawn from mne.viz import plot_epochs_image print(__doc__) data_path = sample.data_pa...
mjasher/gac
original_libraries/flopy-master/examples/Notebooks/lake_example.ipynb
gpl-2.0
%matplotlib inline import os import numpy as np import matplotlib.pyplot as plt import flopy.modflow as mf import flopy.utils as fu workspace = os.path.join('data') #make sure workspace directory exists if not os.path.exists(workspace): os.makedirs(workspace) """ Explanation: Lake Example First set the path and i...
NEONScience/NEON-Data-Skills
tutorials-in-development/Python/neon_api/neon_api_06_stacking_py.ipynb
agpl-3.0
import requests import json import pandas as pd SERVER = 'http://data.neonscience.org/api/v0/' SITECODE = 'TEAK' PRODUCTCODE = 'DP1.10003.001' """ Explanation: syncID: title: "Stacking and Joining NEON Data with Python" description: "" dateCreated: 2020-05-07 authors: Maxwell J. Burner contributors: Donal O'Leary es...
thushear/MLInAction
kaggle/titanic_sklearn.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline data_train = pd.read_csv('./input/titanic/train.csv') data_test = pd.read_csv('./input/titanic/test.csv') data_train.sample(20) """ Explanation: 熟悉Pandas Sklearn CSV to DataFrame End of explanation """ s...
ddtm/dl-course
Seminar4/bonus/Bonus-advanced-cnn.ipynb
mit
import numpy as np from cifar import load_cifar10 X_train,y_train,X_val,y_val,X_test,y_test = load_cifar10("cifar_data") class_names = np.array(['airplane','automobile ','bird ','cat ','deer ','dog ','frog ','horse ','ship ','truck']) print X_train.shape,y_train.shape import matplotlib.pyplot as plt %matplotlib inl...
neurodata/ndmg
tutorials/Qa_skullstrip.ipynb
apache-2.0
#import packages import warnings warnings.simplefilter("ignore") import sys import nibabel as nib import numpy as np import os from PIL import Image, ImageDraw,ImageFont import matplotlib.pyplot as plt from m2g.stats.qa_skullstrip import gen_overlay_pngs """ Explanation: Tutorial for QA of Skull Strip This tutorial i...
synthicity/activitysim
activitysim/examples/example_estimation/notebooks/09_school_tour_scheduling.ipynb
agpl-3.0
import os import larch # !conda install larch -c conda-forge # for estimation import pandas as pd """ Explanation: Estimating School Tour Scheduling This notebook illustrates how to re-estimate the mandatory tour scheduling component for ActivitySim. This process includes running ActivitySim in estimation mode to r...
grcanosa/code-playground
scrum/pandasCSV/csvRedminePandas1.ipynb
mit
from IPython.display import HTML from IPython.display import display HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> <form action="javascript:code_togg...
DaveBackus/Data_Bootcamp
Code/IPython/bootcamp_indicators.ipynb
mit
# import packages import pandas as pd # data management import matplotlib.pyplot as plt # graphics import numpy as np # numerical calculations # IPython command, puts plots in notebook %matplotlib inline # check Python version import datetime as dt import sys print('To...
cshankm/rebound
ipython_examples/ParticleIDsAndRemoval.ipynb
gpl-3.0
import rebound import numpy as np def setupSimulation(Nplanets): sim = rebound.Simulation() sim.integrator = "ias15" # IAS15 is the default integrator, so we don't need this line sim.add(m=1.,id=0) for i in range(1,Nbodies): sim.add(m=1e-5,x=i,vy=i**(-0.5),id=i) sim.move_to_com() return...
bjackman/lisa
ipynb/releases/ReleaseNotes_v17.03.ipynb
apache-2.0
from test import LisaTest print LisaTest.__doc__ """ Explanation: Documentation Documentation of many LISA modules has got a big improvement with the usage of Sphinx and the refresh of docstrings for many existing methods. You can access documentation either interactively in Notebooks, using the standard TAB completi...
akloster/amplicon_classification
notebooks/amplicon_classification.ipynb
isc
%load_ext autoreload %autoreload 2 import numpy as np import pandas as pd import matplotlib.pyplot as plt import re import pysam import random import feather import h5py %matplotlib inline training_data = feather.read_dataframe("amplicon_training_metadata.feather") test_data = feather.read_dataframe("amplicon_test_met...
OpenBookProjects/ipynb
XKCD-style/XKCD_plots_zh_cn-by-ZQ.ipynb
mit
from IPython.display import Image Image('http://jakevdp.github.com/figures/xkcd_version.png') """ Explanation: Matplotlib 实现 XKCD 样图表 This notebook originally appeared as a blog post at Pythonic Perambulations by Jake Vanderplas. <!-- PELICAN_BEGIN_SUMMARY --> Update: the matplotlib pull request has been merged! See ...
zambzamb/zpic
python/Morse and Nielsen 1971.ipynb
agpl-3.0
import em1ds as zpic import numpy as np import matplotlib.pyplot as plt # Thermal velocity uth = [0.05,0.25,0.0] electrons = zpic.Species( "electrons", -1.0, 200, uth = uth ) sim = zpic.Simulation( 150, box = 15.0, dt = 0.08, species = electrons ) """ Explanation: Numerical Simulation of the Weibel Instability in ...
GoogleCloudPlatform/asl-ml-immersion
notebooks/kubeflow_pipelines/pipelines/labs/kfp_pipeline_vertex_automl_online_predictions.ipynb
apache-2.0
from google.cloud import aiplatform REGION = "us-central1" PROJECT = !(gcloud config get-value project) PROJECT = PROJECT[0] # Set `PATH` to include the directory containing KFP CLI PATH = %env PATH %env PATH=/home/jupyter/.local/bin:{PATH} """ Explanation: Continuous Training with AutoML Vertex Pipelines Learning O...
aitatanit/metatlas
4notebooks/ISTD Assessment.ipynb
bsd-3-clause
import sys sys.path.insert(0,'/project/projectdirs/metatlas/projects/ms_monitor_tools' ) import warnings warnings.filterwarnings('ignore') import ms_monitor_util as mtools %matplotlib notebook """ Explanation: Assess and Monitor QCs, Internal Standards, and Common Metabolites This notebook will guide people to Ident...
IanHawke/Southampton-PV-NumericalMethods-2016
solutions/01-Integration.ipynb
mit
from __future__ import division import numpy data_southampton_2005 = numpy.loadtxt('../data/irradiance/southampton_2005.txt') """ Explanation: Integration How much solar power was available to be collected in Southampton in 2005? To answer this, we need to integrate the solar irradiance data, to get the insolation, \b...
vadim-ivlev/STUDY
handson-data-science-python/DataScience-Python3/ConditionalProbabilityExercise.ipynb
mit
from numpy import random random.seed(0) totals = {20:0, 30:0, 40:0, 50:0, 60:0, 70:0} purchases = {20:0, 30:0, 40:0, 50:0, 60:0, 70:0} totalPurchases = 0 for _ in range(100000): ageDecade = random.choice([20, 30, 40, 50, 60, 70]) purchaseProbability = float(ageDecade) / 100.0 totals[ageDecade] += 1 if ...
AntonelliLab/seqcap_processor
docs/notebook/subdocs/align_contigs.ipynb
mit
%%bash source activate secapr_env secapr align_sequences -h """ Explanation: Align contigs We can use SECAPR to produce Multiple Sequence Alignments (MSAs) from the contig data. The alignment function align_sequences looks as follows: End of explanation """ from IPython.display import Image, display img1 = Image(".....
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/sandbox-2/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'sandbox-2', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: NCC Source ID: SANDBOX-2 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balance...
google/physics-math-tutorials
colabs/Multivariate Calculus for ML, 1 of 2.ipynb
apache-2.0
#@title Python imports import collections import datetime from functools import partial import math import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker from scipy import stats import seaborn as sns from sklearn.datasets import make_regression from sklearn.model_se...
mwickert/SP-Comm-Tutorial-using-scikit-dsp-comm
hardware_configure/Pyaudio_Test.ipynb
bsd-2-clause
Audio('c_major.wav') """ Explanation: Playback Using the Notebook Audio Widget This interface is used often when developing algorithms that involve processing signal samples that result in audible sounds. You will see this in the tutorial. Processing is done before hand as an analysis task, then the samples are writte...
davebshow/DH3501
graph_dbs.ipynb
mit
%matplotlib inline %load_ext gremlin import asyncio import aiogremlin import networkx as nx """ Explanation: Graph Databases and the Humanities End of explanation """ g = nx.scale_free_graph(10) nx.draw_networkx(g) """ Explanation: What's a graph? A binary mathematical structure consisting of nodes and edges: $g = ...
vanheck/blog-notes
QuantTrading/creating_trading_strategy_02-backtest.ipynb
mit
NB_VERSION = 1,0 import sys import datetime import numpy as np import pandas as pd print('Verze notebooku:', '.'.join(map(str, NB_VERSION))) print('Verze pythonu:', '.'.join(map(str, sys.version_info[0:3]))) print('---') import pandas_datareader as pdr import pandas_datareader.data as pdr_web from matplotlib import _...
pagutierrez/tutorial-sklearn
notebooks-spanish/18-arboles_y_bosques.ipynb
cc0-1.0
%matplotlib widget import numpy as np import matplotlib.pyplot as plt """ Explanation: Árboles de decisión y bosques End of explanation """ from figures import make_dataset x, y = make_dataset() X = x.reshape(-1, 1) plt.figure() plt.xlabel('Característica X') plt.ylabel('Objetivo y') plt.scatter(X, y); from sklear...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160502월_1일차_분석 환경, 소개/13.pandas 패키지의 소개.ipynb
mit
s = pd.Series([4, 7, -5, 3]) s s.values type(s.values) s.index type(s.index) """ Explanation: pandas 패키지의 소개 pandas 패키지 Index를 가진 자료형인 R의 data.frame 자료형을 Python에서 구현 참고 자료 http://pandas.pydata.org/ http://pandas.pydata.org/pandas-docs/stable/10min.html http://pandas.pydata.org/pandas-docs/stable/tutorials.htm...
mne-tools/mne-tools.github.io
stable/_downloads/d12911920e4d160c9fd8c97cffdda6b7/time_frequency_erds.ipynb
bsd-3-clause
# Authors: Clemens Brunner <clemens.brunner@gmail.com> # Felix Klotzsche <klotzsche@cbs.mpg.de> # # License: BSD-3-Clause """ Explanation: Compute and visualize ERDS maps This example calculates and displays ERDS maps of event-related EEG data. ERDS (sometimes also written as ERD/ERS) is short for event-relat...
danijel3/ASRDemos
notebooks/MLP_TIMIT_ctx10.ipynb
apache-2.0
import os os.environ['CUDA_VISIBLE_DEVICES']='1' import numpy as np from keras.models import Sequential from keras.layers.core import Dense, Activation, Reshape from keras.optimizers import Adam, SGD from IPython.display import clear_output from tqdm import * """ Explanation: Using the frame context in the TIMIT MLP...
obust/Pandas-Tutorial
Case Study - MovieLens.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt pd.set_option('max_columns', 50) # pass in column names for each CSV u_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code'] users = pd.read_csv('data/ml-100k/u.user', sep='|', names=u_cols) r_cols = ['user_id', 'movie_id', 'rating', 'unix_ti...
dtamayo/reboundx
ipython_examples/ModifyMass.ipynb
gpl-3.0
import rebound import reboundx import numpy as np M0 = 1. # initial mass of star def makesim(): sim = rebound.Simulation() sim.G = 4*np.pi**2 # use units of AU, yrs and solar masses sim.add(m=M0) sim.add(a=1.) sim.add(a=2.) sim.add(a=3.) sim.move_to_com() return sim %matplotlib inlin...
mne-tools/mne-tools.github.io
0.24/_downloads/b99fcf919e5d2f612fcfee22adcfc330/40_autogenerate_metadata.ipynb
bsd-3-clause
from pathlib import Path import matplotlib.pyplot as plt import mne data_dir = Path(mne.datasets.erp_core.data_path()) infile = data_dir / 'ERP-CORE_Subject-001_Task-Flankers_eeg.fif' raw = mne.io.read_raw(infile, preload=True) raw.filter(l_freq=0.1, h_freq=40) raw.plot(start=60) # extract events all_events, all_ev...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/launching_into_ml/labs/first_model.ipynb
apache-2.0
!pip install --user google-cloud-bigquery==1.25.0 """ Explanation: First BigQuery ML models for Taxifare Prediction In this notebook, we will use BigQuery ML to build our first models for taxifare prediction. BigQuery ML provides a fast way to build ML models on large structured and semi-structured datasets. Learning ...
yl565/statsmodels
examples/notebooks/markov_autoregression.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt import requests from io import BytesIO # NBER recessions from pandas_datareader.data import DataReader from datetime import datetime usrec = DataReader('USREC', 'fred', start=datetime(1947, 1, 1), en...
RaspberryJamBe/ipython-notebooks
notebooks/nl-be/Communicatie - Cloud bericht 2 - Bericht ontvangen + LED knipperen.ipynb
cc0-1.0
APPKEY = "******" """ Explanation: APPKEY is de Application Key voor een (gratis) http://www.realtime.co/ "Realtime Messaging Free" subscription. Zie "104 - Remote deurbel - Een cloud API gebruiken om berichten te sturen" voor meer gedetailleerde info. End of explanation """ import time import RPi.GPIO as GPIO GPIO....
Kaggle/learntools
notebooks/ml_intermediate/raw/ex4.ipynb
apache-2.0
# Set up code checking import os if not os.path.exists("../input/train.csv"): os.symlink("../input/home-data-for-ml-course/train.csv", "../input/train.csv") os.symlink("../input/home-data-for-ml-course/test.csv", "../input/test.csv") from learntools.core import binder binder.bind(globals()) from learntools.m...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-3/aerosol.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-3', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-3 Topic: Aerosol Sub-Topics: Transport, Emissions, Conce...
dipanjanS/text-analytics-with-python
New-Second-Edition/Ch08 - Semantic Analysis/Ch08b - Named Entity Recognition.ipynb
apache-2.0
text = """Three more countries have joined an “international grand committee” of parliaments, adding to calls for Facebook’s boss, Mark Zuckerberg, to give evidence on misinformation to the coalition. Brazil, Latvia and Singapore bring the total to eight different parliaments across the world, with plans to send repr...
4dsolutions/Python5
SUBPLOTS_PYT_DS_SAISOFT.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt plt.style.use('seaborn-white') import numpy as np """ Explanation: PYT-DS: Subplots in Matplotlib The VanderPlas Syllabus is one of the more useful and core to this course in many ways. Jake VanderPlas has been a key player in helping to promote open source. He's a...
google/data-pills
pills/GA/[DATA_PILL]_[GA360]_Conversion_Blockers.ipynb
apache-2.0
# Import all necessary libs from google.colab import auth import pandas as pd import numpy as np from matplotlib import pyplot as plt from IPython.display import display, HTML # Authenticate the user to query datasets in Google BigQuery auth.authenticate_user() %matplotlib inline """ Explanation: Copyright 2021 Goo...
linamnt/studyGroup
lessons/python/intro/intro_data_analysis_AE.ipynb
apache-2.0
4 + 4 4**2 # 4 to the power of 2 3*5; # semi-colon suppresses output """ Explanation: Data analysis in Python Contributors: This notebook combines two notebooks (with minor modifications by Amanda Easson) from previous UofT Coders sessions: Intro Python (authors: Madeleine Bonsma-Fisher, heavily borrowing from Lina...
melissawm/oceanobiopython
exemplos/exemplo_6/.ipynb_checkpoints/Diagrama TS-checkpoint.ipynb
gpl-3.0
import gsw """ Explanation: Diagrama TS Vamos elaborar um diagrama TS com o auxílio do pacote gsw [https://pypi.python.org/pypi/gsw/3.0.3], que é uma alternativa em python para a toolbox gsw do MATLAB: End of explanation """ import numpy as np import matplotlib.pyplot as plt sal = np.linspace(0, 42, 100) temp = np....
hainm/dask
notebooks/parallelize_image_filtering_workload.ipynb
bsd-3-clause
%pylab inline from scipy.ndimage import uniform_filter import dask.array as da def mean(img): "ndimage.uniform_filter with `size=51`" return uniform_filter(img, size=51) """ Explanation: Parallelize image filters with dask This notebook will show how to parallize CPU-intensive workload using dask array. A sim...
GoogleCloudPlatform/training-data-analyst
blogs/bqml/online_prediction.ipynb
apache-2.0
!pip install google-cloud # Reset Session after installing PROJECT = 'cloud-training-demos' # change as needed """ Explanation: Online prediction with BigQuery ML ML.Predict in BigQuery ML is primarily meant for batch predictions. What if you want to build a web application to provide online predictions? Here, I s...
quantopian/research_public
notebooks/lectures/Plotting_Data/notebook.ipynb
apache-2.0
# Import our libraries # This is for numerical processing import numpy as np # This is the library most commonly used for plotting in Python. # Notice how we import it 'as' plt, this enables us to type plt # rather than the full string every time. import matplotlib.pyplot as plt """ Explanation: Graphical Representat...
NEAT-project/neat
policy/neat_policy_example.ipynb
bsd-3-clause
property1 = NEATProperty(('low_latency', True), precedence=NEATProperty.IMMUTABLE) property2 = NEATProperty(('remote_ip', '10.1.23.45'), precedence=NEATProperty.IMMUTABLE) property3 = NEATProperty(('MTU', {"start":1500, "end":9000}), precedence=NEATProperty.OPTIONAL) property4 = NEATProperty(('TCP', True)) # OPTIONAL...
luofan18/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' # Use Floyd's cifar-10 dataset if present floyd_cifar10...