repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
Nachtfeuer/concept-py | notebooks/2d-math-primer.ipynb | mit | import math
len_vector = lambda vector: math.sqrt(vector[0]**2 + vector[1]**2)
vector = [3, 4]
print("vector is %s" % vector)
print("vector length is %g" % len_vector(vector))
"""
Explanation: Welcome to the 2d math primer
The underlying repository does use Python but this math can be definitely implemented with other... |
Benedicto/ML-Learning | Classifier_1_linear_regression.ipynb | gpl-3.0 | from __future__ import division
import graphlab
import math
import string
"""
Explanation: Predicting sentiment from product reviews
The goal of this first notebook is to explore logistic regression and feature engineering with existing GraphLab functions.
In this notebook you will use product review data from Amazon.... |
IBMDecisionOptimization/docplex-examples | examples/mp/jupyter/pasta_production.ipynb | apache-2.0 | import sys
try:
import docplex.mp
except:
raise Exception('Please install docplex. See https://pypi.org/project/docplex/')
"""
Explanation: The Pasta Production Problem
This tutorial includes everything you need to set up IBM Decision Optimization CPLEX Modeling for Python (DOcplex), build a Mathematical Progr... |
Cat-n-Dog/follow-m | Restaurant.ipynb | mit | train_df = pd.read_csv('train.csv', parse_dates=[1])
#print train_df.head(n=5)
train_df.City = train_df.City.astype('category')
train_df.Type = train_df.Type.astype('category')
train_df['City Group'] = train_df['City Group'].astype('category')
#train_df.dtypes
#d = train_df['Open Date']
#d.map( lambda x : x.year )
t... |
mohanprasath/Course-Work | coursera/data_science_methodology/DS0103EN-2-2-1-From-Requirements-to-Collection-v1.0.ipynb | gpl-3.0 | # check Python version
!python -V
"""
Explanation: <a href="https://cognitiveclass.ai"><img src = "https://ibm.box.com/shared/static/9gegpsmnsoo25ikkbl4qzlvlyjbgxs5x.png" width = 400> </a>
<h1 align=center><font size = 5>From Requirements to Collection</font></h1>
Introduction
In this lab, we will continue learning a... |
LivingProgram/kaggle-sea-lion-data | Correct Coordinates & Sea Lion Counts.ipynb | cc0-1.0 | # imports
import numpy as np
import pandas as pd
import os
import cv2
import matplotlib.pyplot as plt
import skimage.feature
from tqdm import tqdm # nice progress bars
%matplotlib inline
# constants
TRAIN_PATH = '../data/Train/'
DOTTED_PATH = '../data/TrainDotted/'
OUT_PATH = '../output/'
ALL_FILE_NAMES = os.listdir(... |
planetlabs/notebooks | jupyter-notebooks/analytics/user-guide/01_getting_started_with_the_planet_analytics_api.ipynb | apache-2.0 | # Here, we've already stored our Planet API key as an environment variable on our system
# We use the `os` package to read it into the notebook.
import os
API_KEY = os.environ['PL_API_KEY']
# Alternatively, you can just set your API key directly as a string variable:
# API_KEY = "YOUR_PLANET_API_KEY_HERE"
# Use our ... |
usantamaria/iwi131 | ipynb/18-Actividad-ListasYTuplas/Actividad3ListasYTuplas.ipynb | cc0-1.0 | olim2015 = [('Aleman', 'ajedrez', 8, 224),
('Pasteur', 'pinpon', 12, 38),
('Wilquimvoe', 'ajedrez', 5, 134),
('Mariano', 'natacion', 5, 500),
('LuisCampino', 'ajedrez', 10, 45),
('Wilquimvoe', 'pinpon',7, 434),
# ...
]
olim2014 = ... |
google/qkeras | notebook/QRNNTutorial.ipynb | apache-2.0 | units = 64
embedding_dim = 64
loss = 'binary_crossentropy'
def create_model(batch_size=None):
x = x_in = Input(shape=(maxlen,), batch_size=batch_size, dtype=tf.int32)
x = Embedding(input_dim=max_features, output_dim=embedding_dim)(x)
x = Activation('linear', name='embedding_act')(x)
x = Bidirectional(LSTM(unit... |
napjon/ds-nd | p0-intro/Data_Analyst_ND_Project0.ipynb | mit | import pandas as pd
# pandas is a software library for data manipulation and analysis
# We commonly use shorter nicknames for certain packages. Pandas is often abbreviated to pd.
# hit shift + enter to run this cell or block of code
path = r'chopstick-effectiveness.csv'
# Change the path to the location where the cho... |
robertoalotufo/ia898 | master/FerramentasdeEdicaoHTML.ipynb | mit | # Ajuste de largura do notebook no display
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>"))
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#Jupyter-Notebook:-Ferramentas-de-edição-multimídia" data-toc-modified-id="Jupyter-Not... |
tensorflow/tfx | docs/tutorials/data_validation/tfdv_basic.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... |
Tsiems/machine-learning-projects | In_Class/ICA1_MachineLearning_PartA.ipynb | mit | from sklearn.datasets import load_diabetes
import numpy as np
from __future__ import print_function
ds = load_diabetes()
# this holds the continuous feature data
# because ds.data is a matrix, there are some special properties we can access (like 'shape')
print('features shape:', ds.data.shape, 'format is:', ('rows'... |
mtetkosk/European_Soccer_Prediction | notebooks/20170122_Data_Exploration.ipynb | mit | import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Data Exploration
This notebook will perform exploratory analysis on the european soccer dataset before new feature creation.
Additional exploration of new features is located within the feature creation note... |
mne-tools/mne-tools.github.io | 0.23/_downloads/1a105d401683707ed0696f30397d6253/40_artifact_correction_ica.ipynb | bsd-3-clause | import os
import mne
from mne.preprocessing import (ICA, create_eog_epochs, create_ecg_epochs,
corrmap)
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif... |
chemiskyy/simmit | Examples/Continuum_Mechanics/contimech.ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from simmit import smartplus as sim
import os
"""
Explanation: contimech : tools and functions useful in Continuum Mechanics
End of explanation
"""
v = np.random.rand(6)
trace = sim.tr(v)
print v
print trace
"""
Explanation: tr(vec)
Provides the... |
ZhiangChen/deep_learning | thesis/Data Preprocess.ipynb | mit | from six.moves import cPickle as pickle
import matplotlib.pyplot as plt
import os
from random import sample, shuffle
import numpy as np
"""
Explanation: Data Preprocess
Zhiang Chen, March 2017
This notebook is to get training dataset, validation dataset and test dataset. First, it reads the 24 pickle files. These 24 p... |
CentroGeo/Analisis-Espacial | taller_regionalizacion/Regionalización (segunda parte).ipynb | gpl-2.0 | gdf = GeoDataFrame.from_file('datos/desaparecidos_estatal.shp')
"""
Explanation: Los desaparecidos en México
Para el taller vamos a trabajar con los datos de desaparecidos del Secretariado Ejecutivo del Sistema Nacional de Seguridad Pública (SESNSP), estos datos fueron procesados originalmente por el grupo de Data4mx.... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/custom/showcase_hyperparmeter_tuning_tabular_regression.ipynb | apache-2.0 | import os
import sys
# Google Cloud Notebook
if os.path.exists("/opt/deeplearning/metadata/env_version"):
USER_FLAG = "--user"
else:
USER_FLAG = ""
! pip3 install -U google-cloud-aiplatform $USER_FLAG
"""
Explanation: Vertex client library: Hyperparameter tuning tabular regression model
<table align="left">
... |
desihub/desimodel | doc/nb/ELG_SNR.ipynb | bsd-3-clause | %pylab inline
import astropy.table
import astropy.cosmology
import astropy.io.fits as fits
import astropy.units as u
"""
Explanation: ELG Signal-to-Noise Calculations
This notebook provides a standardized calculation of the DESI emission-line galaxy (ELG) signal-to-noise (SNR) figure of merit, for tracking changes to... |
khyatiparekh/data-512-a1 | hcds-a1-data-curation.ipynb | mit | import requests
import json
import csv
import numpy as np
import pandas as pd
endpoint = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/aggregate/{project}/{access}/{agent}/{granularity}/{start}/{end}'
headers={'User-Agent' : 'https://github.com/your_github_username', 'From' : 'your_uw_email@uw.edu'}
params = {... |
mwegrzyn/mindReading2017 | content/_002_blindTraining.ipynb | gpl-3.0 | # module um dateien zu lesen
import os
import fnmatch
# liste mit allen hirnbildern die im Ordner blindTraining liegen
imgList = ['../blindTraining/%s'%x for x in os.listdir('../blindTraining/') if fnmatch.fnmatch(x,'*.nii.gz')]
imgList.sort()
imgList
"""
Explanation: Bevor wir die Daten auswerten, wollen wir uns zu... |
hightower8083/chimera | doc/space-charge-demo(vs_ocelot).ipynb | gpl-3.0 | %matplotlib inline
import numpy as np
from scipy.constants import e
import matplotlib.pyplot as plt
import sys
import ocelot as oclt
from chimera.moduls.species import Specie
from chimera.moduls.solvers import Solver
from chimera.moduls.chimera_main import ChimeraRun
from chimera.moduls.diagnostics import Diagnostics... |
jegibbs/phys202-2015-work | assignments/assignment08/InterpolationEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.interpolate import interp1d
"""
Explanation: Interpolation Exercise 1
End of explanation
"""
trajectory = np.load('trajectory.npz')
x = trajectory['x']
y = trajectory['y']
t = trajectory['t']
assert isinstance(x,... |
afronski/playground-notes | introduction-to-big-data-with-apache-spark/solutions/lab2_apache_log_student.ipynb | mit | import re
import datetime
from pyspark.sql import Row
month_map = {'Jan': 1, 'Feb': 2, 'Mar':3, 'Apr':4, 'May':5, 'Jun':6, 'Jul':7,
'Aug':8, 'Sep': 9, 'Oct':10, 'Nov': 11, 'Dec': 12}
def parse_apache_time(s):
""" Convert Apache time format into a Python datetime object
Args:
s (str): date and ti... |
geoneill12/phys202-2015-work | assignments/assignment03/NumpyEx01.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
"""
Explanation: Numpy Exercise 1
Imports
End of explanation
"""
def checkerboard(size):
a = np.zeros((size,size), dtype = np.float)
b = 2
if size % ... |
mne-tools/mne-tools.github.io | 0.12/_downloads/plot_artifacts_correction_filtering.ipynb | bsd-3-clause | import numpy as np
import mne
from mne.datasets import sample
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
proj_fname = data_path + '/MEG/sample/sample_audvis_eog_proj.fif'
tmin, tmax = 0, 20 # use the first 20s of data
# Setup for reading the raw data (save memory by c... |
yvesdubief/UVM-ME249-CFD | ME249-RANS-help.ipynb | gpl-2.0 | import matplotlib.pyplot as plt
import numpy as np
r = np.linspace(0.,5.,1000)
r0 = 0.8
r1 = 1.0
u = 0.5*(np.power(np.abs(1-r/r0),1./7.))*0.5*((r0-r)+np.abs(r0-r))/(np.abs(r0-r)+1e-6) \
+0.01*0.5*((r-r1)+np.abs(r-r1))/(np.abs(r-r1)+1e-6)
plt.plot(r,u,lw = 2)
#plt.legend(loc=3, bbox_to_anchor=[0, 1],
# nc... |
Bihaqo/tf_einsum_opt | example.ipynb | mit | def func(a, b, c):
res = tf.einsum('ijk,ja,kb->iab', a, b, c) + 1
res = tf.einsum('iab,kb->iak', res, c)
return res
a = tf.random_normal((10, 11, 12))
b = tf.random_normal((11, 13))
c = tf.random_normal((12, 14))
# res = func(a, b, c)
orders, optimized_func = tf_einsum_opt.optimizer(func, sess, a, b, c)
re... |
robertoalotufo/ia898 | src/isccsym.ipynb | mit | import numpy as np
def isccsym2(F):
if len(F.shape) == 1: F = F[np.newaxis,np.newaxis,:]
if len(F.shape) == 2: F = F[np.newaxis,:,:]
n,m,p = F.shape
x,y,z = np.indices((n,m,p))
Xnovo = np.mod(-1*x,n)
Ynovo = np.mod(-1*y,m)
Znovo = np.mod(-1*z,p)
aux = np.conjugate(F[Xnovo,Ynovo... |
cesarcontre/Simulacion2017 | Modulo2/Clase14_ManejoDatosPandas.ipynb | mit | # Importamos pandas
import pandas as pd
"""
Explanation: Aplicando Python para análisis de precios: manejando, organizando y bajando datos con pandas
<img style="float: left; margin: 0px 0px 15px 15px;" src="https://upload.wikimedia.org/wikipedia/commons/8/86/Microsoft_Excel_2013_logo.svg" width="400px" height="125px"... |
google-aai/sc17 | cats/step_8_to_9.ipynb | apache-2.0 | # Enter your username:
YOUR_GMAIL_ACCOUNT = '******' # Whatever is before @gmail.com in your email address
# Libraries for this section:
import os
import datetime
import numpy as np
import pandas as pd
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import tensorflow as tf
from tensorflow.c... |
sns-chops/multiphonon | examples/getdos2-V_Ei120meV-noUI.ipynb | mit | import os, numpy as np
import histogram.hdf as hh, histogram as H
from matplotlib import pyplot as plt
%matplotlib notebook
# %matplotlib inline
import mantid
from multiphonon import getdos
from multiphonon.sqe import plot as plot_sqe
"""
Explanation: Density of States Analysis Example
This example demonatrates a rout... |
tritemio/multispot_paper | out_notebooks/usALEX-5samples-PR-leakage-dir-ex-all-ph-out-27d.ipynb | mit | ph_sel_name = "None"
data_id = "27d"
# data_id = "7d"
"""
Explanation: Executed: Mon Mar 27 11:39:07 2017
Duration: 7 seconds.
usALEX-5samples - Template
This notebook is executed through 8-spots paper analysis.
For a direct execution, uncomment the cell below.
End of explanation
"""
from fretbursts import *
ini... |
isaacmg/fb_scraper | data/Examining data using Spark.ipynb | apache-2.0 | # Do an initial test of Spark to make sure it works.
import findspark
findspark.init()
import pyspark
sc = pyspark.SparkContext('local[*]')
# do something to prove it works
rdd = sc.parallelize(range(1000))
rdd.takeSample(False, 5)
sc.stop()
"""
Explanation: Simple data analysis with Apache Spark
In this example we ar... |
CDNoyes/EDL-Py | Ipopt.ipynb | gpl-3.0 | import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-whitegrid')
from Utils import ipopt
from EntryGuidance import Mesh
import EntryGuidance.Convex_PS as Convex
# reload(Convex)
OCP = Convex.OCP
solver = ipopt.Solver()
mesh = Mesh.Mesh(t0=0, tf=10, orders=[4]*10)
N = len(mesh.times)
x0 ... |
lionfish0/Classification_talk | ipython/Classification.ipynb | mit | from matplotlib import pyplot as plt #plotting library (lets us draw graphs)
%matplotlib inline
from sklearn import datasets #the datasets from sklearn
digits = datasets.load_digits() #load the digits into the variable 'digits'
"""
Explanation: Classification
The Digit Dataset
For these classification examples we w... |
gabicfa/RedesSociais | encontro02/5-kruskal.ipynb | gpl-3.0 | import sys
sys.path.append('..')
import socnet as sn
"""
Explanation: Encontro 02, Parte 5: Algoritmo de Kruskal
Este guia foi escrito para ajudar você a atingir os seguintes objetivos:
implementar o algoritmo de Kruskal;
praticar o uso da biblioteca da disciplina.
Primeiramente, vamos importar a biblioteca:
End of... |
gth158a/learning | Keras - Multi-input and multi-output models.ipynb | apache-2.0 | from keras.layers import Input, Embedding, LSTM, Dense, concatenate
from keras.models import Model
# Headline input: meant to receive sequences of 100 integers, between 1 and 10000.
# Note that we can name any layer by passing it a "name" argument.
main_input = Input(shape=(100,), dtype='int32', name='main_input')
# ... |
maxlit/powerindex | README.ipynb | mit | %matplotlib inline
import powerindex as px
game=px.Game(quota=51,weights=[51,49])
"""
Explanation: powerindex
A python library to compute power indices
Installation: pip install powerindex
What is all about
The aim of the package is to compute different power indices of the so-called weighted voting systems (games). T... |
mbatchkarov/ExpLosion | notebooks/reduced_coverage_experiments.ipynb | bsd-3-clause | %cd ~/NetBeansProjects/ExpLosion/
from copy import deepcopy
from notebooks.common_imports import *
from gui.output_utils import *
from gui.user_code import pretty_names
from pprint import pprint
sns.timeseries.algo.bootstrap = my_bootstrap
sns.categorical.bootstrap = my_bootstrap
def plot_matching(exp_with_constraint... |
dsacademybr/PythonFundamentos | Cap03/Notebooks/DSA-Python-Cap03-03-While.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 3</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Usand... |
Merinorus/adaisawesome | Homework/01 - Pandas and Data Wrangling/Data Wrangling with Pandas.ipynb | gpl-3.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('notebook')
"""
Explanation: Table of Contents
<p><div class="lev1"><a href="#Data-Wrangling-with-Pandas"><span class="toc-item-num">1 </span>Data Wrangling with Pandas</a></div><d... |
soloman817/udacity-ml | misc/keyboard-shortcuts.ipynb | mit | # mode practice
"""
Explanation: Keyboard shortcuts
In this notebook, you'll get some practice using keyboard shortcuts. These are key to becoming proficient at using notebooks and will greatly increase your work speed.
First up, switching between edit mode and command mode. Edit mode allows you to type into cells whi... |
aboSamoor/polyglot | notebooks/Transliteration.ipynb | gpl-3.0 | from polyglot.transliteration import Transliterator
"""
Explanation: Transliteration
Transliteration is the conversion of a text from one script to another.
For instance, a Latin transliteration of the Greek phrase "Ελληνική Δημοκρατία", usually translated as 'Hellenic Republic', is "Ellēnikḗ Dēmokratía".
End of expla... |
acehanks/projects | Data analysis/Ign_dataset_Analysis.ipynb | mit | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... |
is-cs/druljs | DD_Net_demo_jhmdb_split2.ipynb | mit | import numpy as np
import math
import random
import pandas as pd
import os
import matplotlib.pyplot as plt
import cv2
import glob
from tqdm import tqdm
import pickle
import scipy.ndimage.interpolation as inter
from scipy.signal import medfilt
from scipy.spatial.distance import cdist
from keras.optimizers import *
fro... |
ClaudiaEsp/inet | Analysis/Sigmoids function to model connection probabilities.ipynb | gpl-2.0 | %pylab inline
from scipy.optimize import curve_fit
import pickle
# objective function
def sigmoid(x, A, C, r):
"""
solves for the following 1igmoid function:
f(x; A, C, r )=( A / ( 1 + np.exp((x-C)/r)))
where x is the independent variable
A is the maximal amplitude of the curve
C is the h... |
survey-methods/samplics | docs/source/tutorial/ttest.ipynb | mit | import numpy as np
import pandas as pd
from pprint import pprint
from samplics.datasets import Auto
from samplics.categorical.comparison import Ttest
"""
Explanation: T-test
The t-test module allows comparing means of continuous variables of interest to known means or across two groups. There are four main types of ... |
SunnyMarkLiu/Kaggle-House-Prices | XGBoost_and_Parameter_Tuning.ipynb | mit | # The error metric: RMSE on the log of the sale prices.
from sklearn.metrics import mean_squared_error
def rmse(y_true, y_pred):
return np.sqrt(mean_squared_error(y_true, y_pred))
def model_cross_validate(xgb_regressor, cv_paramters, dtrain, cv_folds = 5,
early_stopping_rounds = 50, perform_progress... |
mannyfin/IRAS | Type C calibrations/TypeC calcs.ipynb | bsd-3-clause | # import a few packages
%matplotlib notebook
from thermocouples_reference import thermocouples
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sympy as sp
from scipy import optimize, interpolate, signal
typeC=thermocouples['C']
# make sure you are in the same dir as the file
# read in t... |
IanHawke/ET-NumericalMethods-2016 | notebooks/02-horizon-finding.ipynb | mit | import numpy
from matplotlib import pyplot
%matplotlib notebook
def horizon_RHS(H, theta, z_singularities):
"""
The RHS function for the apparent horizon problem.
Parameters
----------
H : array
vector [h, dh/dtheta]
theta : double
angle
z_singularities : array
... |
danman10000/ics355_demos | ICS355_DES_Demo.ipynb | gpl-3.0 | key_size_in_bits=112
"{:,}".format(2**key_size_in_bits)
"""
Explanation: DES Crypt Demo
Required
pip install pycrypto
pip install crcmod
Example 1: Key Combinations
This example shows the number of key combinations based on the number of bits in a readable formation
End of explanation
"""
from Crypto.Cipher import... |
maestrotf/pymepps | examples/example_plot_thredds.ipynb | gpl-3.0 | import numpy as np
import matplotlib.pyplot as plt
import pymepps
"""
Explanation: Load a thredds dataset
In the following example we will load a thredds dataset from the norwegian met.no thredds server.
End of explanation
"""
metno_path = 'http://thredds.met.no/thredds/dodsC/meps25files/' \
'meps_det_pp_2_5km_... |
mjbommar/cscs-530-w2016 | notebooks/basic-random/001-basic_distributions.ipynb | bsd-2-clause | # Imports
import numpy
import scipy.stats
import matplotlib.pyplot as plt
# Setup seaborn for plotting
import seaborn; seaborn.set()
# Import widget methods
from IPython.html.widgets import *
"""
Explanation: CSCS530 Winter 2015
Complex Systems 530 - Computer Modeling of Complex Systems (Winter 2015)
Course ID: CMP... |
h-mayorquin/camp_india_2016 | tutorials/Spatial Coding/Phase Precession in Place Cells.ipynb | mit | #########################################
### Implementing model from Geisler et al 2010
### Place cell maps: Rate based.
#########################################
from numpy import *
from scipy import *
from pylab import *
import matplotlib.cm as cmx
import matplotlib.colors as colors
from scipy import signal as sg... |
tensorflow/hub | examples/colab/tf2_image_retraining.ipynb | apache-2.0 | # Copyright 2021 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
tensorflow/graphics | tensorflow_graphics/notebooks/matting.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... |
hildensia/bayesian_changepoint_detection | Multivariate_Example.ipynb | mit | from __future__ import division
import matplotlib.pyplot as plt
import bayesian_changepoint_detection.generate_data as gd
import seaborn
%matplotlib inline
%load_ext autoreload
%autoreload 2
partition, data = gd.generate_xuan_motivating_example(200,500)
"""
Explanation: Bayesian Changepoint Detection with multivaria... |
awhite40/pymks | notebooks/checker_board.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Checkerboard Microstructure
Introduction - What are 2-Point Spatial Correlations (also called 2-Point Statistics)?
The purpose of this example is to introduce 2-point spatial correlations and how... |
manahl/PyBloqs | docs/source/examples.ipynb | lgpl-2.1 | %%capture
import numpy as np
import pandas as pd
import pandas.util.testing as pt
from datetime import datetime
import pybloqs as p
df = pd.DataFrame((np.random.rand(200, 4)-0.5)/10,
columns=list("ABCD"),
index=pd.date_range(datetime(2000,1,1), periods=200))
df_cr = (df + 1).cumpr... |
seg/2016-ml-contest | SHandPR/FaciesTrial.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from pandas import set_option
set_option("display.max_rows", 10)
pd.options.mode.chained_assignment = None
filen... |
Danghor/Formal-Languages | Python/DFA-2-RegExp.ipynb | gpl-2.0 | def arb(S):
for x in S:
return x
"""
Explanation: Converting a Deterministic <span style="font-variant:small-caps;">Fsm</span> into a Regular Expression
Given a set S, the function arb(S) returns an arbitrary member from S.
End of explanation
"""
def regexp_sum(S):
n = len(S)
if n == 0:
r... |
ES-DOC/esdoc-jupyterhub | notebooks/ncar/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', 'ncar', 'sandbox-1', 'atmos')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmos
MIP Era: CMIP6
Institute: NCAR
Source ID: SANDBOX-1
Topic: Atmos
Sub-Topics: Dynamical Core, Radiation, Turbul... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/05_review/labs/3_tensorflow_wide_deep.ipynb | apache-2.0 | PROJECT = "cloud-training-demos" # Replace with your PROJECT
BUCKET = "cloud-training-bucket" # Replace with your BUCKET
REGION = "us-central1" # Choose an available region for Cloud MLE
TFVERSION = "1.14" # TF version for CMLE to use
import os
os.environ["BUCKET"] = BUCKET
os.environ["PROJ... |
ziky5/F4500_Python_pro_fyziky | lekce_04/Kapr_v_medu.ipynb | mit | import pandas as pd
data = pd.read_csv('data.csv')
data
"""
Explanation: Kapr v medu
moto:
Spadne kapr do medu a říká:
"Hustý, to je hustý..."
Z.Janák, písemka z TM
Osnova
Úvod
Alias vs hodnota
String
Mutanti a nemutanti
Práce se souborem
Elegance pythonu
Závěrečné cvičení
Úvod
V této lekci se ponoříme (zabředneme... |
aneeshsathe/DataAndImageAnalysisForBiologists | Notebooks/2-Playing with Images.ipynb | mit | import os
import glob
root_root = '/home/aneesh/Images/Source/'
dir_of_root = os.listdir(root_root)
file_paths = [glob.glob(os.path.join(root_root,dor, '*.tif')) for dor in dir_of_root]
print(file_paths[0][0])
"""
Explanation: Make me an Image Analyst already!
In the last lesson you learnt the basics of Python. You l... |
michalkurka/h2o-3 | h2o-py/demos/H2O_tutorial_medium_NOPASS.ipynb | apache-2.0 | import pandas as pd
import numpy
from numpy.random import choice
from sklearn.datasets import load_boston
from h2o.estimators.random_forest import H2ORandomForestEstimator
import h2o
h2o.init()
# transfer the boston data from pandas to H2O
boston_data = load_boston()
X = pd.DataFrame(data=boston_data.data, columns=b... |
tensorflow/docs-l10n | site/ko/tutorials/load_data/images.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... |
probml/pyprobml | notebooks/book2/25/IPM_divergences.ipynb | mit | import jax
import random
import numpy as np
import jax.numpy as jnp
import seaborn as sns
import matplotlib.pyplot as plt
import scipy
!pip install -qq dm-haiku
!pip install -qq optax
try:
import haiku as hk
except ModuleNotFoundError:
%pip install -qq haiku
import haiku as hk
try:
import optax
exce... |
tensorflow/docs | site/en/guide/migrate/mirrored_strategy.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... |
btq/statlearning-notebooks | src/chapter5.ipynb | mit | from __future__ import division
import pandas as pd
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.cross_validation import LeaveOneOut
from sklearn.cross_validation import KFold
from sklearn.cross_validation import Bootstrap
from skle... |
Diyago/Machine-Learning-scripts | DEEP LEARNING/NLP/LSTM RNN/Sentiment pytorch/Sentiment_classif.ipynb | apache-2.0 | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
amueller/advanced_training | 04.1 Pipelines.ipynb | bsd-2-clause | from sklearn.svm import SVC
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
# load and split the data
cancer = load_breast_cancer()
X_train, X_test, y_train, y_test = train_test_split(
cancer.data, cancer.target, ra... |
liam2/larray | doc/source/tutorial/getting_started.ipynb | gpl-3.0 | %xmode Minimal
from larray import *
"""
Explanation: Getting Started
The purpose of the present Getting Started section is to give a quick overview
of the main objects and features of the LArray library.
To get a more detailed presentation of all capabilities of LArray, read the next sections of the tutorial.
The API... |
jdsanch1/SimRC | 02. Parte 2/15. Clase 15/.ipynb_checkpoints/03Class NB-checkpoint.ipynb | mit | #importar los paquetes que se van a usar
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import datetime
from datetime import datetime
import scipy.stats as stats
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
#algunas opciones para Python
pd.set_option('display.not... |
ManuSetty/wishbone | notebooks/Wishbone_for_mass_cytometry.ipynb | gpl-2.0 | import wishbone
# Plotting and miscellaneous imports
import os
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import random
%matplotlib inline
"""
Explanation: <h3>Wishbone for mass cytometry</h3>
<h4>Table of contents</h4>
<br/>
<a href='#intro'>Intro... |
phoebe-project/phoebe2-docs | 2.2/tutorials/general_concepts.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.2,<2.3"
"""
Explanation: General Concepts
HOW TO RUN THIS FILE: if you're running this in a Jupyter notebook or Google Colab session, you can click on a cell and then shift+Enter to run the cell and automatically select the next cell. Alt+Enter will run a cell and create a new cell below it... |
hadim/public_notebooks | Theory/Microfluidic_Flow_Rate/notebook.ipynb | mit | %matplotlib qt
import numpy as np
import matplotlib.pyplot as plt
def calculcate_section_circle(diameter):
return np.pi * ((diameter / 2) ** 2)
def calculcate_section_rectangle(height, width):
return height * width
def calculate_characteristic_length_circle(diameter):
return diameter
def calculate_char... |
ES-DOC/esdoc-jupyterhub | notebooks/mpi-m/cmip6/models/mpi-esm-1-2-lr/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mpi-m', 'mpi-esm-1-2-lr', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MPI-M
Source ID: MPI-ESM-1-2-LR
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, ... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/04_features/a_features.ipynb | apache-2.0 | import math
import shutil
import numpy as np
import pandas as pd
import tensorflow as tf
print(tf.__version__)
tf.logging.set_verbosity(tf.logging.INFO)
pd.options.display.max_rows = 10
pd.options.display.float_format = '{:.1f}'.format
"""
Explanation: Trying out features
Learning Objectives:
* Improve the accuracy... |
gon1213/SDC | traffic_sign/tensorflow/CarND-LeNet-Lab/LeNet-Lab.ipynb | gpl-3.0 | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", reshape=False)
X_train, y_train = mnist.train.images, mnist.train.labels
X_validation, y_validation = mnist.validation.images, mnist.validation.labels
X_test, y_test = mnist.test.images, mn... |
antoniomezzacapo/qiskit-tutorial | qiskit/basics/the_ibmq_provider.ipynb | apache-2.0 | from qiskit import IBMQ
IBMQ.backends()
"""
Explanation: <img src="../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left">
The IBM Q provider
In Qiskit we have an interface for backends and jobs that... |
tokuda109/tensorflow-docker-skeleton | notebooks/playground_ja/tensorflow/00_tensorflow_activation_functions.ipynb | mit | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
sess = tf.Session()
"""
Explanation: TensorFlow の活性化関数
活性化関数(伝達関数)は、入力信号の総和を出力信号に変換する関数のことです。
パーセプトロンの時代ではステップ関数が用いられ、バックプロパゲーションの時代ではシグモイド関数が用いられましたが、最近ではReLU関数が多く用いられます。
ここでは、よく使われる活性化関数の概要を説明し、TensorFlowで使う場合のサンプルコードを紹介したいと思います。
事前準備
まずサンプル... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_stats_cluster_spatio_temporal_repeated_measures_anova.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Denis Engemannn <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
from numpy.random import randn
import matplotlib.pyplot as plt
import mne
f... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/building_production_ml_systems/solutions/2_hyperparameter_tuning.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
PROJECT = "<YOUR PROJECT>"
BUCKET = "<YOUR BUCKET>"
REGION = "<YOUR REGION>"
TFVERSION = "2.3.0" # TF version for AI Platform to use
import os
os.environ["PROJECT"] = PROJECT
os.environ["BUCKET"] = BUCKET
os.environ["REGION"] = REGION
... |
tensorflow/docs-l10n | site/ko/tutorials/images/classification.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... |
sonium0/pymatgen | examples/Plotting and Analyzing a Phase Diagram using the Materials API.ipynb | mit | #This initializes the REST adaptor. You may need to put your own API key in as an arg.
a = MPRester()
#Entries are the basic unit for thermodynamic and other analyses in pymatgen.
#This gets all entries belonging to the Ca-C-O system.
entries = a.get_entries_in_chemsys(['Ca', 'C', 'O'])
#With entries, you can do many... |
banyh/ShareIPythonNotebook | NLP_With_Python/Ch5.ipynb | gpl-3.0 | import nltk
text = nltk.word_tokenize("And now for something completely different")
nltk.pos_tag(text)
"""
Explanation: Ch5 Categorizing and Tagging Words
本章的目標是回答這些問題:
什麼是lexical categories? 它們如何應用在NLP中?
要儲存單字和分類的資料結構是什麼?
如何自動為每個單字分類?
本章會提到一些基本的NLP方法,例如sequence labeling、n-gram models、backoff、evaluation。
辨識單字的part-o... |
astrograzl/SymPyTut | notebooks/Fundamentals-of-mathematics.ipynb | bsd-3-clause | 3 # an int
3.0 # a float
"""
Explanation: Fundamentals of mathematics
Let's begin by learning about the basic SymPy objects and the
operations we can carry out on them. We'll learn the SymPy equivalents
of many math verbs like “to solve” (an equation), “to expand” (an
expression)... |
alexlib/openpiv-python | openpiv/docs/src/windef.ipynb | gpl-3.0 | # import packages
from openpiv import windef # <---- see windef.py for details
from openpiv import tools, scaling, validation, filters, preprocess
import openpiv.pyprocess as process
from openpiv import pyprocess
import numpy as np
import os
from time import time
import warnings
import matplotlib.pyplot as plt
%mat... |
tnzmnjm/Seaborn-visualisation | CO2 Emission.ipynb | agpl-3.0 | # Importing Iran`s dataset
IRAN_SOURCE_FILE = 'iran_emission_dataset.csv'
iran_csv = pd.read_csv(IRAN_SOURCE_FILE)
iran_csv.head(5)
# Importing Turkey`s dataset
TURKEY_SOURCE_FILE = 'turkey_emission_dataset.csv'
turkey_csv = pd.read_csv(TURKEY_SOURCE_FILE)
turkey_csv.head(5)
"""
Explanation: Importing the CSV files... |
SHDShim/pytheos | examples/6_p_scale_test_Yokoo_Au.ipynb | apache-2.0 | %config InlineBackend.figure_format = 'retina'
"""
Explanation: For high dpi displays.
End of explanation
"""
import matplotlib.pyplot as plt
import numpy as np
from uncertainties import unumpy as unp
import pytheos as eos
"""
Explanation: 0. General note
This example compares pressure calculated from pytheos and o... |
cliburn/sta-663-2017 | exams/Midterm Exams.ipynb | mit | heart = sm.datasets.heart.load_pandas().data
heart.head(n=6)
"""
Explanation: Q1 (10 points)
The heart dataframe contains the survival time after receiving a heart transplant, the age of the patient and whether or not the survival time was censored
Number of Observations - 69
Number of Variables - 3
Variable name de... |
paulcon/active_subspaces | tutorials/test_functions/otl_circuit/otlcircuit_example.ipynb | mit | import active_subspaces as ac
import numpy as np
%matplotlib inline
# The otlcircuit_functions.py file contains two functions: the circuit function (circuit(xx))
# and its gradient (circuit_grad(xx)). Each takes an Mx6 matrix (M is the number of data
# points) with rows being normalized inputs; circuit returns a colum... |
maxis42/ML-DA-Coursera-Yandex-MIPT | 2 Supervised learning/Lectures notebooks/12 bonus video/imdb.ipynb | mit | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Рецензии на imdb
End of explanation
"""
imdb = pd.read_csv('labeledTrainData.tsv', delimiter='\t')
imdb.shape
imdb.head()
"""
Explanation: Имеются 25000 рецензий пользователей imdb с бинарными метками, посчит... |
GoogleCloudPlatform/bigquery-oreilly-book | 09_bqml/image_embeddings.ipynb | apache-2.0 | BUCKET='ai-analytics-solutions-kfpdemo' # CHANGE to a bucket you own
"""
Explanation: Image embeddings in BigQuery for image similarity and clustering tasks
This notebook shows how to do use a pre-trained embedding as a vector representation of an image in Google Cloud Storage.
Given this embedding, we can load it as... |
tclaudioe/Scientific-Computing | SC2/U1_EigenWorld.ipynb | bsd-3-clause | import numpy as np
from scipy import linalg
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: <center>
<h1> ILI286 - Computación Científica II </h1>
<h2> Valores y Vectores Propios </h2>
<h2> <a href="#acknowledgements"> [S]cientific [C]omputing [T]eam </a> </h2>
<h2> Version: 1... |
liyangbit/liyangbit.github.io | ipynb/zhilian.ipynb | mit | import pymongo
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
% matplotlib inline
plt.style.use('ggplot')
# 解决matplotlib显示中文问题
plt.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体
plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题
"""
Explanation: Table of Contents
<p><div cl... |
mne-tools/mne-tools.github.io | 0.18/_downloads/11f39f61bd7f4cfd5791b0d10da462f2/plot_eeg_erp.ipynb | bsd-3-clause | import mne
from mne.datasets import sample
"""
Explanation: EEG processing and Event Related Potentials (ERPs)
For a generic introduction to the computation of ERP and ERF
see tut_epoching_and_averaging.
:depth: 1
End of explanation
"""
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_au... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.