repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
wanderer2/pymc3 | docs/source/notebooks/bayesian_neural_network_advi.ipynb | apache-2.0 | %matplotlib inline
import theano
theano.config.floatX = 'float64'
import pymc3 as pm
import theano.tensor as T
import sklearn
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('white')
from sklearn import datasets
from sklearn.preprocessing import scale
from sklearn.cross_validation... |
jhonatanoliveira/pgmpy | examples/Learning from data.ipynb | mit | # Generate data
import numpy as np
import pandas as pd
raw_data = np.array([0] * 30 + [1] * 70) # Representing heads by 0 and tails by 1
data = pd.DataFrame(raw_data, columns=['coin'])
print(data)
# Defining the Bayesian Model
from pgmpy.models import BayesianModel
from pgmpy.estimators import MaximumLikelihoodEstima... |
fortyninemaps/karta | doc/source/tutorial.ipynb | mit | from karta import Point, Line, Polygon, Multipoint, Multiline, Multipolygon
"""
Explanation: Karta tutorial
Introduction
Karta provides a set of tools for analysing geographical data. The organization of Karta is around a set of classes for representing vector and raster data. These classes contain built-in methods fo... |
SylvainCorlay/bqplot | examples/Interactions/Selectors.ipynb | apache-2.0 | import pandas as pd
import numpy as np
symbol = 'Security 1'
symbol2 = 'Security 2'
price_data = pd.DataFrame(np.cumsum(np.random.randn(150, 2).dot([[0.5, 0.4], [0.4, 1.0]]), axis=0) + 100,
columns=[symbol, symbol2],
index=pd.date_range(start='01-01-2007', periods=1... |
thalesians/tsa | src/jupyter/python/conditions.ipynb | apache-2.0 | import os, sys
sys.path.append(os.path.abspath('../../main/python'))
from thalesians.tsa.conditions import precondition, postcondition
"""
Explanation: Conditions
Introduction
Python lacks the power, flexibility — and also the quirks — of the C++ preprocessor. It does not support conditional compilation. W... |
CNS-OIST/STEPS_Example | other_tutorials/OCNC2017/OCNC2017 STEPS tutorial execises.ipynb | gpl-2.0 | # Import biochemical model module
import steps.model as smod
# Create model container
mdl = smod.Model()
# Create chemical species
A = smod.Spec('A', mdl)
B = smod.Spec('B', mdl)
C = smod.Spec('C', mdl)
# Create reaction set container
vsys = smod.Volsys('vsys', mdl)
# Create reaction
# A + B - > C with rate 200 /uM... |
damienstanton/nanodegree | CarND-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
#reading in an image
image = mpimg.imread('test_images/solidWhiteRight.jpg')
#printing out some stats and plotting
print('This image is:', type(image), 'with dimesions:', im... |
tpin3694/tpin3694.github.io | python/strings_to_datetime.ipynb | mit | from datetime import datetime
from dateutil.parser import parse
import pandas as pd
"""
Explanation: Title: Converting Strings To Datetime
Slug: strings_to_datetime
Summary: Converting Strings To Datetime
Date: 2016-05-01 12:00
Category: Python
Tags: Basics
Authors: Chris Albon
Import modules
End of explanation
"""
... |
fraserw/PyMOP | tutorial/trippytutorial.ipynb | gpl-2.0 | #%matplotlib inline
import numpy as num, astropy.io.fits as pyf,pylab as pyl
from trippy import psf, pill, psfStarChooser
from trippy import scamp,MCMCfit
import scipy as sci
from os import path
import os
from astropy.visualization import interval, ZScaleInterval
"""
Explanation: TRIPPy examples
Introduction: SExtract... |
liganega/Gongsu-DataSci | previous/y2017/GongSu08_Files_and_Lists.ipynb | gpl-3.0 | result_f = open("data/scores_list.txt") # 파일 열기
for line in result_f: # 각 줄 내용 출력하기
print(line)
result_f.close() # 파일 닫기
"""
Explanation: 텍스트 파일 불러오기와 리스트 활용
수정 사항
적절한 연습문제 추가 필요
처리해야 할 데이터 양이 많아지면 파일에 저장한 후에 필요한 경우 재활용해야 한다.
또한 개별 데이터를 따... |
hektor-monteiro/python-notebooks | aula-10_Eq_nao_lineares.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pyplot as plt
def f(x):
return 2-x-np.exp(-x)
x = np.linspace(-10, 10, 400)
y = f(x)
plt.figure()
plt.plot(x, y)
# melhorando a escala para visualizar as possíveis raízes
plt.figure()
plt.plot(x, y)
plt.hlines(0,x.min(),x.max(),colors='C1',linestyles='dashed')
plt.ylim(-5,5)... |
LeoArruda/Titanic | Titanic Predict.ipynb | apache-2.0 | import warnings
warnings.filterwarnings('ignore')
# SKLearn Model Algorithms
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression , Perceptron
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC, Linea... |
akhambhati/rs-NMF_CogControl | Analysis_Notebooks/e01-Measure_Dynamic_Functional_Networks.ipynb | gpl-3.0 | try:
%load_ext autoreload
%autoreload 2
%reset
except:
print 'NOT IPYTHON'
from __future__ import division
import os
import sys
import glob
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.stats as stats
import statsmodels.api as sm
import scipy.io as io
import h5py
import ma... |
ivazquez/clonal-heterogeneity | src/figure5.ipynb | mit | # Load external dependencies
from setup import *
# Load internal dependencies
import config,plot,utils
%load_ext autoreload
%autoreload 2
%matplotlib inline
"""
Explanation: Supplemental Information:
"Clonal heterogeneity influences the fate of new adaptive mutations"
Ignacio Vázquez-García, Francisco Salinas, Jing... |
davebshow/DH3501 | class19.ipynb | mit | %matplotlib inline
import networkx as nx
import matplotlib.pyplot as plt
g = nx.Graph([("A", "B")])
nx.draw_networkx(g)
"""
Explanation: <div align="left">
<h4><a href="index.ipynb">RETURN TO INDEX</a></h4>
</div>
<div align="center">
<h1><a href="index.ipynb">DH3501: Advanced Social Networks</a><br/><br/><em>Class 19... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/ukesm1-0-mmh/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'ukesm1-0-mmh', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: NERC
Source ID: UKESM1-0-MMH
Topic: Aerosol
Sub-Topics: Transport, Emissions,... |
ernestyalumni/MLgrabbag | LogReg-sklearn.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model, datasets
# import some data to play with
iris = datasets.load_iris()
X = iris.data[:, :2] # take the first two features. # EY : 20160503 type(X) is numpy.ndarray
Y = iris.target # EY : 20160503 type(Y) is numpy.ndarray
h = .02 # ste... |
ES-DOC/esdoc-jupyterhub | notebooks/csir-csiro/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', 'csir-csiro', 'sandbox-2', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: CSIR-CSIRO
Source ID: SANDBOX-2
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, ... |
donaghhorgan/COMP9033 | labs/08a - k nearest neighbours classification.ipynb | gpl-3.0 | import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics import classification_report
from sklearn.model_selection import GridSearchCV, StratifiedKFold, cross_val_predict
from sklearn.pipeline import make_pipeline
from sklearn.neighbors import KNeighborsClassifier
"""
Expla... |
juanshishido/tufte | tufte-in-python.ipynb | gpl-2.0 | %matplotlib inline
import string
import random
from collections import defaultdict
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import tufte
"""
Explanation: Tufte
A Jupyter notebook with examples of how to use tufte.
Introduction
Currently, there are four supporte... |
Brunel-Visualization/Brunel | python/src/examples/.ipynb_checkpoints/Whiskey-checkpoint.ipynb | apache-2.0 | import pandas as pd
from numpy import log, abs, sign, sqrt
import ibmcognitive
ibmcognitive.brunel.set_brunel_service_url("http://localhost:8080/BrunelServices")
data = pd.read_csv("data/whiskey.csv")
print('Data on whiskies:', ', '.join(data.columns))
"""
Explanation: Whiskey Data
This data set contains data on a ... |
GoogleCloudPlatform/practical-ml-vision-book | 04_detect_segment/04ab_retinanet_arthropods_train.ipynb | apache-2.0 | # Use your own GCS bucket here. GCS is required if training on TPU.
# On GPU, a local folder will work.
MODEL_ARTIFACT_BUCKET = 'gs://ml1-demo-martin/arthropod_jobs/'
MODEL_DIR = MODEL_ARTIFACT_BUCKET + str(int(time.time()))
# If you are running on Colaboratory, you must authenticate
# for Colab to have write access t... |
astyonax/IPyNotebooks | quakes.ipynb | gpl-2.0 | #xyz=records[['Latitude','Longitude','Magnitude','Depth/Km','deltaT']].values[1:].T
lxyz=xyz.T.copy()
lxyz=lxyz[:,2:]
lxyz/=lxyz.std(axis=0)
"Magnitude,Depth,deltaT"
print lxyz.shape
l,e,MD=pma.pma(lxyz)
X=pma.get_XY(lxyz,e)
sns.plt.plot(np.cumsum(l)/np.sum(l),'o-')
sns.plt.figure()
sns.plt.plot(e[:,:3])
sns.plt.leg... |
hanezu/cs231n-assignment | assignment2/BatchNormalization.ipynb | mit | # As usual, a bit of setup
import time
import numpy as np
import matplotlib.pyplot as plt
from cs231n.classifiers.fc_net import *
from cs231n.data_utils import get_CIFAR10_data
from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array
from cs231n.solver import Solver
%matplotlib inline
... |
NathanYee/ThinkBayes2 | code/chap05soln.ipynb | gpl-2.0 | from __future__ import print_function, division
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import numpy as np
from thinkbayes2 import Pmf, Cdf, Suite, Beta
import thinkplot
"""
Explanation: Think Bayes: Chapter 5
This notebook presents code and exercises from Think Bayes, second edition.
... |
zzsza/Datascience_School | 19. 문서 전처리/01. Python 문자열 인코딩.ipynb | mit | c = "a"
c
print(c)
x = "가"
x
print(x)
print(x.__repr__())
x = ["가"]
print(x)
x = "가"
len(x)
x = "ABC"
y = "가나다"
print(len(x), len(y))
print(x[0], x[1], x[2])
print(y[0], y[1], y[2])
print(y[0], y[1], y[2], y[3])
"""
Explanation: Python 문자열 인코딩
문자와 인코딩
문자의 구성
바이트 열 Byte Sequence: 컴퓨터에 저장되는 자료. 각 글자에 바이트 열을 지정
글... |
thinkingmachines/deeplearningworkshop | codelab_1_NN_Numpy.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Creating a 2 Layer Neural Network in 30 Lines of Python
Modified from an existing exercise. Credit for the original code to Stanford CS 231n
To demonstrate with code the math we went over earlier, we're going to generate some data that is not linearly... |
streety/biof509 | Wk04-Data-retrieval-and-preprocessing-Solutions.ipynb | mit | # required packages:
import numpy as np
import pandas as pd
import sklearn
import skimage
import sqlalchemy as sa
import urllib.request
import requests
import sys
import json
import pickle
import gzip
from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
!pip install pymysql
i... |
sz2472/foundations-homework | data and database/.ipynb_checkpoints/database class 8 June16-checkpoint.ipynb | mit | input_str = "Yes, my zip code is 12345. I heard that Gary's zip code is 23456. But 212 is not a zip code."
import re
zips= re.findall(r"\d{5}", input_str)
zips
from urllib.request import urlretrieve
urlretrieve("https://raw.githubusercontent.com/ledeprogram/courses/master/databases/data/enronsubjects.txt", "enronsubj... |
AllenDowney/ModSimPy | soln/chap01soln.ipynb | mit | try:
import pint
except ImportError:
!pip install pint
import pint
try:
from modsim import *
except ImportError:
!pip install modsimpy
from modsim import *
"""
Explanation: Modeling and Simulation in Python
Chapter 1
Copyright 2020 Allen Downey
License: Creative Commons Attribution 4.0 Interna... |
Mashimo/datascience | 03-NLP/introNLTK.ipynb | apache-2.0 | sampleText1 = "The Elephant's 4 legs: THE Pub! You can't believe it or can you, the believer?"
sampleText2 = "Pierre Vinken, 61 years old, will join the board as a nonexecutive director Nov. 29."
"""
Explanation: Introduction to NLTK
We have seen how to do some basic text processing in Python, now we introduce an open... |
nimagh/MachineLearning | GaussianProcesses/GRP.ipynb | gpl-2.0 | def get_kernel(X1,X2,sigmaf,l,sigman):
k = lambda x1,x2,sigmaf,l,sigman:(sigmaf**2)*np.exp(-(1/float(2*(l**2)))*np.dot((x1-x2),(x1-x2).T)) + (sigman**2);
K = np.zeros((X1.shape[0],X2.shape[0]))
for i in range(0,X1.shape[0]):
for j in range(0,X2.shape[0]):
if i==j:
K[i,j] ... |
google/eng-edu | ml/cc/exercises/numpy_ultraquick_tutorial.ipynb | apache-2.0 | import numpy as np
"""
Explanation: NumPy UltraQuick Tutorial
NumPy is a Python library for creating and manipulating vectors and matrices. This Colab is not an exhaustive tutorial on NumPy. Rather, this Colab teaches you just enough to use NumPy in the Colab exercises of Machine Learning Crash Course.
About Colabs... |
OpenChemistry/mongochemserver | girder/notebooks/notebooks/notebooks/ChemML.ipynb | bsd-3-clause | import openchemistry as oc
"""
Explanation: Open Chemistry JupyterLab ChemML calculations
End of explanation
"""
mol = oc.find_structure('InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H')
mol.structure.show()
"""
Explanation: Start by finding structures using online databases (or cached local results). This uses an InChI for a ... |
ES-DOC/esdoc-jupyterhub | notebooks/ec-earth-consortium/cmip6/models/sandbox-2/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ec-earth-consortium', 'sandbox-2', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: EC-EARTH-CONSORTIUM
Source ID: SANDBOX-2
Topic: Aerosol
Sub-Topic... |
poldrack/fmri-analysis-vm | analysis/orthogonalization/orthogonalization.ipynb | mit | %pylab inline
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(precision=2)
npts=100
X = np.random.multivariate_normal([0,0],[[1,0.5],[0.5,1]],npts)
X = X-np.mean(X,0)
params = [1,2]
y_noise = 0.2
Y = np.dot(X,params) + y_noise*np.random.randn(npts)
Y = Y-np.mean(Y) # remove mean so we can... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_dics.ipynb | bsd-3-clause | # Author: Marijn van Vliet <w.m.vanvliet@gmail.com>
#
# License: BSD (3-clause)
"""
Explanation: DICS for power mapping
In this tutorial, we're going to simulate two signals originating from two
locations on the cortex. These signals will be sine waves, so we'll be looking
at oscillatory activity (as opposed to evoked... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/feature_engineering/labs/4_keras_adv_feat_eng-lab.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
import datetime
import logging
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow import feature_column as fc
from tensorflow.keras import layers
from tensorflow.keras import models
# set TF error lo... |
solgaardlab/dphox | doc/source/01_fundamentals.ipynb | mit | import dphox as dp
import numpy as np
import holoviews as hv
hv.extension('bokeh')
"""
Explanation: Fundamentals: patterns and curves
A Pattern in dphox is analogous to shapely's MultiPolygon, and contains a set of polygons represented by a list of $2 \times N$ numpy arrays.
A Pattern can be treated pretty much like a... |
GoogleCloudPlatform/mlops-on-gcp | skew_detection/03_covertype_drift_detection_tfdv.ipynb | apache-2.0 | !pip install -U -q tensorflow
!pip install -U -q tensorflow_data_validation
!pip install -U -q pandas
# Automatically restart kernel after installs
import IPython
app = IPython.Application.instance()
app.kernel.do_shutdown(True)
"""
Explanation: Drift detection with TensorFlow Data Validation
This tutorial shows ho... |
clarka34/exploring-ship-logbooks | scripts/second_dataset.ipynb | mit | import exploringShipLogbooks
import zipfile
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
import os.path as op
import pandas as pd
import exploringShipLogbooks.wordcount as wc
from exploringShipLogbooks.basic_utils import clean_data
from exploringShipLogbooks.basic_utils import remov... |
tschijnmo/drudge | docs/examples/ccsd.ipynb | mit | from pyspark import SparkContext
ctx = SparkContext('local[*]', 'ccsd')
"""
Explanation: Automatic derivation of CCSD theory
This notebook serves as an example of interactive usage of drudge for complex symbolic manipulations in Jupyter notebooks. Here we can see how the classical CCSD theory can be derived automatic... |
mdpiper/topoflow-notebooks | Meteorology-P-TimeSeries.ipynb | mit | mps_to_mmph = 1000 * 3600
"""
Explanation: Precipitation in the Meteorology component
Goal: In this example, I give the Meteorology component a time series of precipitation values and check whether it produces output when the model state is updated.
Define a helpful constant:
End of explanation
"""
import numpy as n... |
NervanaSystems/coach | tutorials/1. Implementing an Algorithm.ipynb | apache-2.0 | import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import tensorflow as tf
from rl_coach.architectures.tensorflow_components.heads.head import Head
from rl_coach.architectures.head_parameters import HeadParameters
from rl_coach.base_p... |
nicoguaro/FEM_resources | elements/Lumped mass FEM.ipynb | mit | from sympy import *
init_session()
"""
Explanation: Mass matrix diagonalization (lumping)
End of explanation
"""
def mass_tet4():
"""Mass matrix for a 4 node tetrahedron"""
r, s, t = symbols("r s t")
N = Matrix([1 - r - s - t, r, s, t])
return (N * N.T).integrate((t, 0, 1 - r - s), (s, 0, 1 - r), (r,... |
pastas/pastas | examples/notebooks/03_diagnostic_checking.ipynb | mit | import numpy as np
import pandas as pd
import pastas as ps
from scipy import stats
import matplotlib.pyplot as plt
ps.set_log_level("ERROR")
ps.show_versions(numba=True)
"""
Explanation: Model Diagnostic Checking
R.A. Collenteur, University of Graz, July 2020.
This notebook provides an overview of the different metho... |
unnati-xyz/intro-python-data-science | kaggle/santander/notebook/kaggle-santander.ipynb | mit | import numpy as np
import pandas as pd
#Read train, test and sample submission datasets
train = pd.read_csv("../data/train.csv")
test = pd.read_csv("../data/test.csv")
samplesub = pd.read_csv("../data/sample_submission.csv")
"""
Explanation: Santandar Customer Satisfaction
Step 1: Frame
From frontline support teams ... |
dvkonst/ml_mipt | task_2/Decision_tree.ipynb | gpl-3.0 | X, y = boston_data.iloc[:, :-1], boston_data.iloc[:, -1]
train_len = int(0.75 * len(X))
X_train, X_test, y_train, y_test = X.iloc[:train_len], X.iloc[train_len:], y.iloc[:train_len], y.iloc[train_len:]
# print(list(map(lambda x: x.shape, (X_train, X_test, y_train, y_test))))
"""
Explanation: Разделим датасет на тренир... |
goodwordalchemy/thinkstats_notes_and_exercises | code/chap03_Pmfs_notes.ipynb | gpl-3.0 | import thinkstats2
pmf = thinkstats2.Pmf([1,2,2,3,5])
#getting pmf values
print pmf.Items()
print pmf.Values()
print pmf.Prob(2)
print pmf[2]
#modifying pmf values
pmf.Incr(2, 0.2)
print pmf.Prob(2)
pmf.Mult(2, 0.5)
print pmf.Prob(2)
#if you modify, probabilities may no longer add up to 1
#to check:
print pmf.Total... |
pxcandeias/py-notebooks | FRF_plots.ipynb | mit | from __future__ import division, print_function
import sys
import numpy as np
import scipy as sp
import matplotlib as mpl
print('System: {}'.format(sys.version))
print('numpy version: {}'.format(np.__version__))
print('scipy version: {}'.format(sp.__version__))
print('matplotlib version: {}'.format(mpl.__version__))
... |
google/trax | trax/models/research/examples/hourglass_enwik8.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 Lice... |
castelao/CoTeDe | docs/notebooks/Configuration.ipynb | bsd-3-clause | # A different version of CoTeDe might give slightly different outputs.
# Please let me know if you see something that I should update.
import cotede
print("CoTeDe version: {}".format(cotede.__version__))
"""
Explanation: QC Configuration
Objective:
Show different ways to configure a quality control (QC) procedure - e... |
rflamary/POT | notebooks/plot_barycenter_fgw.ipynb | mit | # Author: Titouan Vayer <titouan.vayer@irisa.fr>
#
# License: MIT License
#%% load libraries
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import math
from scipy.sparse.csgraph import shortest_path
import matplotlib.colors as mcol
from matplotlib import cm
from ot.gromov import fgw_barycente... |
wcchin/colouringmap | example/drawing points (part 1).ipynb | mit | import geopandas as gpd # read and manage attribute table data
import matplotlib.pyplot as plt # prepare the figure
import colouringmap.mapping_point as mpoint # for drawing points
import colouringmap.mapping_polygon as mpoly # for mapping background polygon
import colouringmap.markerset as ms # getting more marker ico... |
arnavd96/Cinemiezer | Api_Script.ipynb | mit | import requests, json
api_key = 'razswfzzubnqy49ry2km9ce9'
sample_request = 'http://data.tmsapi.com/v1.1/movies/showings?startDate=2016-08-13&zip=98056&radius=10&units=mi&api_key=razswfzzubnqy49ry2km9ce9'
#startDate = required (set to today's date), zip/radius can be set optionally based on the user (units is just fo... |
jerkos/cobrapy | documentation_builder/phenotype_phase_plane.ipynb | lgpl-2.1 | %matplotlib inline
from time import time
import cobra.test
from cobra.flux_analysis import calculate_phenotype_phase_plane
model = cobra.test.create_test_model("textbook")
"""
Explanation: Phenotype Phase Plane
Phenotype phase planes will show distinct phases of optimal growth with different use of two different su... |
eggie5/ipython-notebooks | iris/Iris.ipynb | mit | from sklearn.datasets import load_iris
iris = load_iris()
iris.feature_names
"""
Explanation: KNN Predictions on the Iris Dataset
This notebook is also hosted at:
http://www.eggie5.com/62-knn-predictions-on-the-iris-dataset
https://github.com/eggie5/ipython-notebooks/blob/master/iris/Iris.ipynb
These are my notes ... |
alexandrnikitin/algorithm-sandbox | courses/DAT256x/Module04/04-01-Data and Visualization.ipynb | mit | import statsmodels.api as sm
df = sm.datasets.get_rdataset('GaltonFamilies', package='HistData').data
df
"""
Explanation: Data and Data Visualization
Machine learning, and therefore a large part of AI, is based on statistical analysis of data. In this notebook, you'll examine some fundamental concepts related to data... |
climberwb/pycon-pandas-tutorial | Exercises-5.ipynb | mit | r_d = release_dates[(release_dates.title.str.contains("Christmas")) & (release_dates.country == "USA")]
r_d.date.dt.month.value_counts().sort_index().plot(kind="bar")
"""
Explanation: Make a bar plot of the months in which movies with "Christmas" in their title tend to be released in the USA.
End of explanation
"""
... |
rsignell-usgs/notebook | CSW/CSW_ServiceType_query.ipynb | mit | from owslib.csw import CatalogueServiceWeb
from owslib import fes
import numpy as np
endpoint = 'http://geoport.whoi.edu/csw'
#endpoint = 'http://catalog.data.gov/csw-all'
#endpoint = 'http://www.ngdc.noaa.gov/geoportal/csw'
#endpoint = 'http://www.nodc.noaa.gov/geoportal/csw'
csw = CatalogueServiceWeb(endpoint,timeou... |
isb-cgc/examples-Python | notebooks/Somatic Mutations.ipynb | apache-2.0 | import gcp.bigquery as bq
somatic_mutations_BQtable = bq.Table('isb-cgc:tcga_201607_beta.Somatic_Mutation_calls')
"""
Explanation: Somatic Mutations
The goal of this notebook is to introduce you to the Somatic Mutations BigQuery table.
This table is based on the open-access somatic mutation calls available in MAF file... |
craigrshenton/home | notebooks/notebook7.ipynb | mit | # code written in py_3.0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn as sns
"""
Explanation: Load data from http://media.wiley.com/product_ancillary/6X/11186614/DOWNLOAD/ch08.zip, SwordForecasting.xlsx
End of explanation
"""
# find path to ... |
ricklupton/sankeyview | docs/tutorials/colour-scales.ipynb | mit | import pandas as pd
import numpy as np
from floweaver import *
df1 = pd.read_csv('holiday_data.csv')
"""
Explanation: Colour-intensity scales
In this tutorial we will look at how to use colours in the Sankey diagram. We have already seen how to use a palette, but in this tutorial we will also create a Sankey where th... |
arnoldlu/lisa | ipynb/examples/android/workloads/Android_Gmaps.ipynb | apache-2.0 | from conf import LisaLogging
LisaLogging.setup()
%pylab inline
import json
import os
# Support to access the remote target
import devlib
from env import TestEnv
# Import support for Android devices
from android import Screen, Workload
# Support for trace events analysis
from trace import Trace
# Suport for FTrace... |
rahlk/learnPy | Lecture4-Main.ipynb | mit | def foo():
return 1
foo()
"""
Explanation: CSX91: Python Tutorial
1. Functions
Fucntions in Python are created using the keyword def
It can return values with return
Let's create a simple function:
End of explanation
"""
aString = 'Global var'
def foo():
a = 'Local var'
print locals()
foo()
print globa... |
gcgruen/homework | data-databases-homework/Homework_4_Gruen.ipynb | mit | numbers_str = '496,258,332,550,506,699,7,985,171,581,436,804,736,528,65,855,68,279,721,120'
"""
Explanation: Graded =11/11
Homework #4
These problem sets focus on list comprehensions, string operations and regular expressions.
Problem set #1: List slices and list comprehensions
Let's start with some data. The followin... |
ocefpaf/secoora | notebooks/timeSeries/sss/01-skill_score.ipynb | mit | import os
try:
import cPickle as pickle
except ImportError:
import pickle
run_name = '2014-07-07'
fname = os.path.join(run_name, 'config.pkl')
with open(fname, 'rb') as f:
config = pickle.load(f)
import numpy as np
from pandas import DataFrame, read_csv
from utilities import (load_secoora_ncs, to_html,
... |
GoogleCloudPlatform/ml-on-gcp | tutorials/sklearn/hpsearch/gke_bayes_search.ipynb | apache-2.0 | from sklearn.datasets import fetch_mldata
from sklearn.utils import shuffle
mnist = fetch_mldata('MNIST original', data_home='./mnist_data')
X, y = shuffle(mnist.data[:60000], mnist.target[:60000])
X_small = X[:100]
y_small = y[:100]
# Note: using only 10% of the training data
X_large = X[:6000]
y_large = y[:6000]
... |
ES-DOC/esdoc-jupyterhub | notebooks/cccma/cmip6/models/canesm5/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cccma', 'canesm5', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CCCMA
Source ID: CANESM5
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a/ml_crypted_data_correction.ipynb | mit | %matplotlib inline
from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.ml - Machine Learning et données cryptées - correction
Comment faire du machine learning avec des données cryptées ? Ce notebook propose d'en montrer un principe exposés CryptoNets: Applying Neural Networks to Encry... |
hadibakalim/deepLearning | 01.neural_network/03.multiple_linear_regression/multiple_linear_regression.ipynb | mit | from sklearn.linear_model import LinearRegression
# here we just downloaded the data from the library
from sklearn.datasets import load_boston
"""
Explanation: Multiple Linear Regression
We just saw how we can predict life expectancy using BMI. Here, BMI was the predictor, also known as an independent variable. A pred... |
ekaakurniawan/iPyMacLern | PGM-W1/Factor.ipynb | gpl-3.0 | # Display graph inline
%matplotlib inline
# Display graph in 'retina' format for Mac with retina display. Others, use PNG or SVG format.
%config InlineBackend.figure_format = 'retina'
#%config InlineBackend.figure_format = 'PNG'
#%config InlineBackend.figure_format = 'SVG'
"""
Explanation: Part of iPyMacLern project.... |
fastai/fastai | dev_nbs/course/lesson7-wgan.ipynb | apache-2.0 | path = untar_data(URLs.LSUN_BEDROOMS)
"""
Explanation: LSun bedroom data
For this lesson, we'll be using the bedrooms from the LSUN dataset. The full dataset is a bit too large so we'll use a sample from kaggle.
End of explanation
"""
dblock = DataBlock(blocks = (TransformBlock, ImageBlock),
get_x... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/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', 'cnrm-cerfacs', 'sandbox-2', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-2
Topic: Seaice
Sub-Topics: Dynamics, Ther... |
pbcquoc/pbcquoc.github.io | images/vinid.ipynb | mit | !pip install hyperas
# Basic compuational libaries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import seaborn as sns
%matplotlib inline
np.random.seed(2)
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
impor... |
FeitengLab/EmotionMap | 2StockEmotion/3. 主成份分析(PCA)(曼哈顿).ipynb | mit | import numpy as np
from sklearn.decomposition import PCA
import pandas as pd
df = pd.read_csv('Manhattan.txt', sep='\s+')
df.drop('id', axis=1, inplace=True)
df.tail()
"""
Explanation: Here I will using scikit-learn to perform PCA in Jupyter Notebook.
First, I need some example to get familiar with this
Get our data a... |
tensorflow/docs-l10n | site/en-snapshot/guide/distributed_training.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... |
FordyceLab/AcqPack | notebooks/Experiment_Arjun20170606.ipynb | mit | import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
from config import utils as ut
%matplotlib inline
"""
Explanation: SETUP
End of explanation
"""
# config directory must have "__init__.py" file
# from the 'config' directory, import the following classes:
from config import ... |
physion/ovation-python | examples/qc-activity-example.ipynb | gpl-3.0 | import urllib
import ovation.lab.workflows as workflows
import ovation.session as session
"""
Explanation: Quality Check API Example
End of explanation
"""
s = session.connect(input('Email: '), api='https://lab-services.ovation.io')
"""
Explanation: Create a session. Note the api endpoint, lab-services.ovation.io f... |
sf-wind/caffe2 | caffe2/python/tutorials/Getting_Caffe1_Models_for_Translation.ipynb | apache-2.0 | import os
print("Required modules imported.")
"""
Explanation: Getting Caffe1 Models and Datasets
This tutorial will help you acquire a variety of models and datasets and put them into places that the other tutorials will expect. We will primarily utilize Caffe's pre-trained models and the scripts that come in that re... |
jorgemauricio/INIFAP_Course | ejercicios/Pandas/1_Series.ipynb | mit | # librerias
import numpy as np
import pandas as pd
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Series
El primer tipo de dato que vamos a aprender en pandas es Series
Una series es muy similar a un arreglo de Numpy, la diferencia es que una serie tiene etiquetas en... |
kkai/perception-aware | 3.analysis/explore.ipynb | mit | %pylab inline
windows = [625, 480, 621, 633]
mac = [647, 503, 559, 586]
"""
Explanation: Exploration Example
Let's start with importing some plotting functions (don't care about the warning ... we should use something else, but this is just easier, for the time being).
End of explanation
"""
figure()
plot(windows)
... |
jorisvandenbossche/DS-python-data-analysis | _solved/pandas_08_reshaping_data.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: <p><font size="6"><b>07 - Pandas: Tidy data and reshaping</b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbos&... |
tpin3694/tpin3694.github.io | python/pandas_string_munging.ipynb | mit | import pandas as pd
import numpy as np
import re as re
"""
Explanation: Title: String Munging In Dataframe
Slug: pandas_string_munging
Summary: String Munging In Dataframe
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
import modules
End of explanation
"""
raw_data = {'first_name... |
blua/deep-learning | language-translation/dlnd_language_translation_0420.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... |
mne-tools/mne-tools.github.io | 0.13/_downloads/plot_stats_cluster_methods.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
import numpy as np
from scipy import stats
from functools import partial
import matplotlib.pyplot as plt
# this changes hidden MPL vars:
from mpl_toolkits.mplot3d import Axes3D # noqa
from mne.stats import (spatio_temporal_cluster_1samp_test,... |
Heroes-Academy/OOP_Spring_2016 | notebooks/giordani/Python_3_OOP_Part_5__Metaclasses.ipynb | mit | a = 5
print(type(a))
print(a.__class__)
print(a.__class__.__bases__)
print(object.__bases__)
"""
Explanation: The Type Brothers
The first step into the most intimate secrets of Python objects comes from two components we already met in the first post: class and object. These two things are the very fundamental elem... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/solutions/fraud_detection_with_tensorflow_bigquery.ipynb | apache-2.0 | import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.layers as layers
from tensorflow_io.bigquery import BigQueryClient
import functools
"""
Explanation: Building a Fraud Detection model on Vertex AI with TensorFlow Enterprise and BigQuery
Learning objectives
Analyze the data in BigQuery... |
oditorium/blog | iPython/DateTime-Basics.ipynb | agpl-3.0 | from datetime import datetime as dt
import time as tm
import pytz as tz
import calendar as cal
"""
Explanation: Datetime - Basics
Time conversions are generally a pain, especially when daylight savings time is involved. Here a number of libraries and tools to deal with this in Python. Firstly, there are three librarie... |
simulkade/peteng | python/.ipynb_checkpoints/two_phase_1D_fipy_seq-checkpoint.ipynb | mit | from fipy import Grid2D, CellVariable, FaceVariable
import numpy as np
def upwindValues(mesh, field, velocity):
"""Calculate the upwind face values for a field variable
Note that the mesh.faceNormals point from `id1` to `id2` so if velocity is in the same
direction as the `faceNormal`s then we take the v... |
quantopian/research_public | notebooks/lectures/Hypothesis_Testing/questions/notebook.ipynb | apache-2.0 | # Useful Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import t
import scipy.stats
"""
Explanation: Exercises: Hypothesis Testing
By Christopher van Hoecke and Maxwell Margenot
Lecture Link
https://www.quantopian.com/lectures/hypothesis-testing
IMPORTANT NOTE:
This l... |
adamwang0705/cross_media_affect_analysis | develop/20171019-daheng-build_shed_words_freq_dicts.ipynb | mit | """
Initialization
"""
'''
Standard modules
'''
import os
import pickle
import csv
import time
from pprint import pprint
'''
Analysis modules
'''
import pandas as pd
'''
Custom modules
'''
import config
import utilities
'''
Misc
'''
nb_name = '20171019-daheng-build_shed_words_freq_dicts'
"""
Explanation: Build se... |
pagutierrez/tutorial-sklearn | notebooks-spanish/02-herramientas_cientificas_python.ipynb | cc0-1.0 | import numpy as np
# Semilla de números aleatorios (para reproducibilidad)
rnd = np.random.RandomState(seed=123)
# Generar una matriz aleatoria
X = rnd.uniform(low=0.0, high=1.0, size=(3, 5)) # dimensiones 3x5
print(X)
"""
Explanation: Jupyter Notebooks (libros de notas o cuadernos Jupyter)
Puedes ejecutar un Cel... |
jobovy/misc-notebooks | inference/ABC-examples.ipynb | bsd-3-clause | data= ['H','H']
outcomes= ['T','H']
def coin_ABC():
while True:
h= numpy.random.uniform()
flips= numpy.random.binomial(1,h,size=2)
if outcomes[flips[0]] == data[0] \
and outcomes[flips[1]] == data[1]:
yield h
hsamples= []
start= time.time()
for h in coin_ABC():
... |
borja876/Thinkful-DataScience-Borja | Describe+the+effects+of+age+on+hearing.ipynb | mit | import math
#odds of hearing problems in a 95 year old woman
a = -1+ 0.02*95 + 1*0
c = math.exp( a )
d = math.exp( a )/(1+ c)
print('Probability of having hearing problems over not having them:', c)
print('HashearingProblem:', d)
"""
Explanation: Write out a description of the effects that age and gender have on the ... |
mjones01/NEON-Data-Skills | code/Python/remote-sensing/hyperspectral-data/Plot_Spectral_Signature_Tiles_py.ipynb | agpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import warnings
warnings.filterwarnings('ignore') #don't display warnings
"""
Explanation: syncID: c91d556c8fad4570a33a1aaa550a561d
title: "Plot a Spectral Signature in Python - Tiled Data"
description: "Learn how to extract and plot a spectral pro... |
Eomys/MoSQITo | tutorials/tuto_sharpness_din.ipynb | apache-2.0 | # Add MOSQITO to the Python path
import sys
sys.path.append('..')
# To get inline plots (specific to Jupyter notebook)
%matplotlib notebook
# Import numpy
import numpy as np
# Import plot function
import matplotlib.pyplot as plt
# Import mosqito functions
from mosqito.utils import load
# Import spectrum computation t... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_read_evoked.ipynb | bsd-3-clause | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from mne import read_evokeds
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
# Reading
condition = 'Left Auditory'
evoked = read_e... |
uber-common/deck.gl | bindings/pydeck/examples/06 - Conway's Game of Life.ipynb | mit | import random
def new_board(x, y, num_live_cells=2, num_dead_cells=3):
"""Initializes a board for Conway's Game of Life"""
board = []
for i in range(0, y):
# Defaults to a 3:2 dead cell:live cell ratio
board.append([random.choice([0] * num_dead_cells + [1] * num_live_cells) for _ in range(0... |
DJCordhose/ai | notebooks/es/import.ipynb | mit | mkdir data
cd data
# http://stat-computing.org/dataexpo/2009/the-data.html
# !curl -O http://stat-computing.org/dataexpo/2009/2000.csv.bz2
# !curl -O http://stat-computing.org/dataexpo/2009/2001.csv.bz2
# !curl -O http://stat-computing.org/dataexpo/2009/2002.csv.bz2
# !ls -lh
# !bzip2 -d 2000.csv.bz2
# !bzip2 -d 2001... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.