repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
mne-tools/mne-tools.github.io
0.18/_downloads/4eb6243ca7f447169baac6cdad977ee8/plot_stats_spatio_temporal_cluster_sensors.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from mne.viz import plot_topomap import mne from mne.stats import spatio_...
dato-code/tutorials
notebooks/introduction_to_sframes.ipynb
apache-2.0
import graphlab as gl """ Explanation: Introduction to SFrames What is an SFrame? Note: This notebook uses GraphLab Create 1.7. An SFrame is a tabular data structure. If you are familiar with R or the pandas python package, SFrames behave similarly to the dataframes available in those frameworks. SFrames act like a ...
wdbm/Psychedelic_Machine_Learning_in_the_Cenozoic_Era
TensorFlow_introduction.ipynb
gpl-3.0
import tensorflow as tf print('TensorFlow version:', tf.__version__) """ Explanation: TensorFlow introduction: the art of the sesh This introduction seeks to broach a few basic topics in TensorFlow: what it is, how operations and data are defined for its computational graphs and how its operations are visualized. In...
QFinancier/blog
give_me_data_or_death/give_me_good_data_or_give_me_death.ipynb
mit
import pandas as pd import numpy as np #create sizeable dataset n_obs = 1000000 idx = pd.date_range('2015-01-01', periods=n_obs, freq='L') df = pd.DataFrame(np.random.randn(n_obs,4), index=idx, columns=["Open", "High", "Low", "Close"]) df.head() """ Explanation: Give me good data, or give me death ...
eds-uga/csci1360-fa16
assignments/A1/A1_Q5.ipynb
mit
import numpy as np def magic(): return np.random.randint(0, 10) def how_many_loops(stop_val): loops = 0 ### BEGIN SOLUTION ### END SOLUTION return loops np.random.seed(3849) s1 = 5 l1 = 6 assert l1 == how_many_loops(s1) np.random.seed(895768) s2 = 3 l2 = 20 assert l2 == how_many_l...
rgarcia-herrera/sistemas-dinamicos
human_immune.ipynb
gpl-3.0
# Para hacer experimentos numéricos importamos numpy import numpy as np # y biblioteca para plotear import matplotlib import matplotlib.pyplot as plt %matplotlib inline # cómputo simbólico con sympy from sympy import * # init_printing(use_latex='matplotlib') # en emacs init_printing() """ Explanation: Human immune ...
arviz-devs/arviz
doc/source/user_guide/numpyro_refitting_xr_lik.ipynb
apache-2.0
import arviz as az import numpyro import numpyro.distributions as dist import jax.random as random from numpyro.infer import MCMC, NUTS import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats import xarray as xr numpyro.set_host_device_count(4) """ Explanation: Refitting NumPyro models with Arv...
wiheto/teneto
docs/tutorial/tctc.ipynb
gpl-3.0
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from teneto.communitydetection import tctc import pandas as pd data = np.array([[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 1, 2, 1], [0, 0, 0, 0, 1, 1, 1, 0, 2, 2, 2, 2, 1], [1, 0, 1, 1, 1, 1, 1, 1, 2, 2, 1, 0, 0], [-1, 0, 1, 1, 0, -1, 0, -1, 0, 2,...
pybel/pybel-notebooks
BEL to Natural Language.ipynb
apache-2.0
import sys import time import indra import indra.util.get_version import ndex2 import pybel from indra.assemblers.english_assembler import EnglishAssembler from indra.sources.bel.bel_api import process_pybel_graph from pybel.examples import sialic_acid_graph from pybel_tools.visualization import to_jupyter """ Expl...
tensorflow/tensorboard
tensorboard/plugins/mesh/Mesh_Plugin_Tensorboard.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...
johnpfay/environ859
07_DataWrangling/notebooks/00-Intro-to-NumPy.ipynb
gpl-3.0
#Create a list of heights and weights height = [1.73, 1.68, 1.17, 1.89, 1.79] weight = [65.4, 59.2, 63.6, 88.4, 68.7] print height print weight """ Explanation: Intro to NumPy This notebook demonstrates the limitations of Python's built-in data types in executing some scientific analyses. Source: https://campus.dataca...
Housebeer/Natural-Gas-Model
.ipynb_checkpoints/Matching Market-checkpoint.ipynb
mit
import random as rnd class Supplier(): def __init__(self): self.wta = [] # the supplier has n quantities that they can sell # they may be willing to sell this quantity anywhere from a lower price of l # to a higher price of u def set_quantity(self,n,l,u): for i in range(n): ...
darothen/py-mie
tutorials/Tutorial.ipynb
mit
import mie import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mtick import seaborn as sns rc = { "figure.figsize": (12,6), "xtick.major.size": 12.0, "xtick.minor.size": 8.0, "ytick.major.size": 12.0, "ytick.minor.size": 8.0, "axes.linewidth": 1.75, "xtick.color"...
liganega/Gongsu-DataSci
notebooks/GongSu17-Pandas-tutorial-03.ipynb
gpl-3.0
import pandas as pd import matplotlib.pyplot as plt import numpy.random as np # 쥬피터 노트북에서 그래프를 직접 나타내기 위해 사용하는 코드 # 파이썬 전문 에디터에서는 사용하지 않음 %matplotlib inline """ Explanation: pandas 3 자료 안내: pandas 라이브러리 튜토리얼에 있는 Lessons for new pandas users의 03-Lesson 내용을 담고 있다. 익명함수(lambda 함수), GroupBy, apply, transform에 대한 설명...
christophebertrand/ada-epfl
HW01-Intro_to_Pandas/Intro to Pandas.ipynb
mit
import pandas as pd import numpy as np pd.options.mode.chained_assignment = None # default='warn' """ Explanation: Table of Contents <p><div class="lev1"><a href="#Introduction-to-Pandas"><span class="toc-item-num">1&nbsp;&nbsp;</span>Introduction to Pandas</a></div><div class="lev2"><a href="#Pandas-Data-Structures"...
jamesfolberth/NGC_STEM_camp_AWS
notebooks/data8_notebooks/lab10/lab10.ipynb
bsd-3-clause
# Run this cell to set up the notebook, but please don't change it. # These lines import the Numpy and Datascience modules. import numpy as np from datascience import * # These lines do some fancy plotting magic. import matplotlib %matplotlib inline import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') imp...
allandieguez/teaching
Matplotlib e Seaborn/Modulo 2 - Scatter Plot + Text.ipynb
gpl-3.0
import numpy as np import os import pandas as pd """ habilitando plots no notebook """ %matplotlib inline """ plot libs """ import matplotlib.pyplot as plt import seaborn as sns """ Configurando o Matplotlib para o modo manual """ plt.interactive(False) """ Explanation: Módulo 2: Scatter Plot + Text Tutorial Impor...
shead-custom-design/pipecat
docs/gps-receivers.ipynb
gpl-3.0
# nbconvert: hide from __future__ import absolute_import, division, print_function import sys sys.path.append("../features/steps") import test socket = test.mock_module("socket") path = "../data/gps" client = "172.10.0.20" socket.socket().recvfrom.side_effect = test.recvfrom_file(path=path, client=client, stop=6) ...
vinitsamel/udacitydeeplearning
first-neural-network/Your_first_neural_network.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
mne-tools/mne-tools.github.io
0.24/_downloads/81e58e463fcd949fd4ab7ab7ab8ef317/left_cerebellum_volume_source.ipynb
bsd-3-clause
# Author: Alan Leggitt <alan.leggitt@ucsf.edu> # # License: BSD-3-Clause import os.path as op import mne from mne import setup_source_space, setup_volume_source_space from mne.datasets import sample print(__doc__) data_path = sample.data_path() subjects_dir = op.join(data_path, 'subjects') subject = 'sample' aseg_f...
mne-tools/mne-tools.github.io
0.19/_downloads/e5c0288e15772e4fb31189b766e9d7be/plot_metadata_epochs.ipynb
bsd-3-clause
# Authors: Chris Holdgraf <choldgraf@gmail.com> # Jona Sassenhagen <jona.sassenhagen@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import mne import numpy as np import matplotlib.pyplot as plt # Load the data from the internet path = mne.datasets.kiloword.data_path() ...
yingchi/fastai-notes
deeplearning1/rnn/rnn-modu.ipynb
apache-2.0
from theano.sandbox import cuda cuda.use('gpu1') %matplotlib inline import utils; from utils import * from keras.layers import TimeDistributed, Activation from keras.callbacks import ModelCheckpoint from numpy.random import choice """ Explanation: Auto Generate Text for <<默读>> End of explanation """ path = 'text/mo...
tpin3694/tpin3694.github.io
python/pandas_select_rows_when_column_has_certain_values.ipynb
mit
# Import modules import pandas as pd # Set ipython's max row display pd.set_option('display.max_row', 1000) # Set iPython's max column width to 50 pd.set_option('display.max_columns', 50) """ Explanation: Title: Select Rows When Columns Contain Certain Values Slug: pandas_select_rows_when_column_has_certain_values S...
InsightLab/data-science-cookbook
2019/12-spark/12-spark-intro/Actions.ipynb
mit
data = sc.parallelize(range(1, 11)) def summation(a, b): return a + b def max(a, b): return a if a > b else b # reduce to find the sum print (data.reduce(summation)) # reduce to find the max print (data.reduce(max)) """ Explanation: reduce(func) Agrega os elementos do RDD usando uma função func (que leva dois argume...
keras-team/autokeras
docs/ipynb/load.ipynb
apache-2.0
dataset_url = "https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz" # noqa: E501 local_file_path = tf.keras.utils.get_file( origin=dataset_url, fname="image_data", extract=True ) # The file is extracted in the same directory as the downloaded file. local_dir_path = os.path.dirna...
hetaodie/hetaodie.github.io
assets/media/uda-ml/supervisedlearning/jc/为慈善机构寻找捐助者/charity_finish/charity/titanic_survival_exploration/titanic_survival_exploration.ipynb
mit
# 检查你的Python版本 from sys import version_info if version_info.major != 2 and version_info.minor != 7: raise Exception('请使用Python 2.7来完成此项目') import numpy as np import pandas as pd # 数据可视化代码 from titanic_visualizations import survival_stats from IPython.display import display %matplotlib inline # 加载数据集 in_file = 't...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session13/Day2/02-Fast-GPs.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' from matplotlib import rcParams rcParams["figure.dpi"] = 100 rcParams["figure.figsize"] = 12, 4 """ Explanation: Fast GP implementations End of explanation """ import numpy as np np.random.seed(0) t = np.linspace(0, 10, 10000) y = np.random.randn(1...
yevheniyc/Python
1m_ML_Security/notebooks/day_1/Worksheet 1 - Working with One Dimensional Data.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: Worksheet 1: Working with One Dimensional Data This worksheet covers concepts covered in the first half of Module 1 - Exploratory Data Analysis in One Dimension. There are many ways to accomplish the tasks that you are presented w...
jsignell/MpalaTower
inspection/.ipynb_checkpoints/inspect_raw_netcdf-checkpoint.ipynb
mit
usr = 'Julia' FILEDIR = 'C:/Users/%s/Dropbox (PE)/KenyaLab/Data/Tower/TowerData/'%usr NETCDFLOC = FILEDIR + 'raw_netcdf_output/' DATALOC = 'F:/towerdata/' """ Explanation: Inspect Raw Netcdf Playing around with efficient ways to merge and view netcdf data from the tower. This ipython notebook depends on the python sc...
muatik/dm
SVM-comparision.ipynb
mit
from sklearn import svm, linear_model, neighbors, ensemble from sklearn import cross_validation, grid_search from sklearn import datasets import numpy as npes import pandas as pd import numpy as np import seaborn as sns from matplotlib import pylab as plt import time from IPython.display import YouTubeVideo %matplotlib...
WNoxchi/Kaukasos
FADL1/lesson3-rossman-Copy1-old.ipynb
mit
%matplotlib inline %reload_ext autoreload %autoreload 2 from fastai.structured import * from fastai.column_data import * np.set_printoptions(threshold=50, edgeitems=20) PATH='data/rossmann/' """ Explanation: Structured and time series data This notebook contains an implementation of the third place result in the Ros...
yhilpisch/dx
07_dx_portfolio_risk.ipynb
agpl-3.0
import dx import datetime as dt import time import numpy as np """ Explanation: <img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="45%" align="right" border="4"> Derivatives Portfolio Risk Statistics From a risk management perspective it is important to know how sensitive derivatives portfolios...
liquidSVM/liquidSVM
bindings/python/demo.ipynb
agpl-3.0
from liquidSVM import * """ Explanation: liquidSVM for Python We give a demonstration of the capabilities of liquidSVM from a Python viewpoint. More information can be found in the help (e.g. ?mcSVM). Disclaimer: liquidSVM and the Python-bindings are in general quite stable and well tested by several people. However,...
srnas/barnaba
examples/example_03_annotate.ipynb
gpl-3.0
import barnaba as bb # annotate pdb = "../test/data/SARCIN.pdb" stackings, pairings, res = bb.annotate(pdb) # list base pairings print("BASE-PAIRS") for p in range(len(pairings[0][0])): res1 = res[pairings[0][0][p][0]] res2 = res[pairings[0][0][p][1]] interaction = pairings[0][1][p] print("%10s %10s ...
numenta/nupic.research
projects/archive/dynamic_sparse/notebooks/ExperimentAnalysis-TestRestoration.ipynb
agpl-3.0
%load_ext autoreload %autoreload 2 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands import * from nupic.research.frameworks.dynamic...
bureaucratic-labs/yargy
docs/index.ipynb
mit
from yargy import Parser, rule, and_ from yargy.predicates import gram, is_capitalized, dictionary GEO = rule( and_( gram('ADJF'), # так помечается прилагательное, остальные пометки описаны в # http://pymorphy2.readthedocs.io/en/latest/user/grammemes.html is_capitalized() ...
jdhp-docs/python-notebooks
photography_fr.ipynb
mit
%matplotlib inline import math import numpy as np import matplotlib.pyplot as plt import ipywidgets from ipywidgets import interact """ Explanation: Photographie TODO * ... End of explanation """ CAPTEUR_DICT = {"APS-C Canon (15x23 mm)": (14.9, 22.3), "Full frame (24x36 mm)": (24, 36)} """ Explanat...
gschivley/ERCOT_power
Group classification/Group classification.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os import sklearn as sk from cluster import Clusters import os filename = 'Cluster_Data_2.csv' path = '../Clean Data' fullpath = os.path.join(path, filename) cluster = Clusters(fullpath) cluster.mak...
leoferres/prograUDD
clases/09-Iteradores.ipynb
mit
for i in range(10): print(i, end=' ') """ Explanation: Iteradores Una de las cosas más maravillosas de las compus es que podemos repetir un mismo cálculo para muchos valores de forma automática. Ya hemos visto al menos un iterator (iterador), que no es una lista... es otro objeto. End of explanation """ for valu...
google-research/google-research
privacy_poison/svm_pois_mi.ipynb
apache-2.0
import sklearn import numpy as np from sklearn import svm from tensorflow.keras.datasets import fashion_mnist (trn_x, trn_y), (tst_x, tst_y) = fashion_mnist.load_data() twoclass_inds = np.where(trn_y<=1)[0] trn_x, trn_y = trn_x[twoclass_inds], trn_y[twoclass_inds] trn_x = trn_x.reshape((trn_x.shape[0], -1))/255.0 - .5...
snth/split-apply-combine
The Split-Apply-Combine Pattern in Data Science and Python.ipynb
mit
import os import gzip import ujson as json directory = 'data/github_archive' filename = '2015-01-29-16.json.gz' path = os.path.join(directory, filename) with gzip.open(path) as f: events = [json.loads(line) for line in f] #print json.dumps(events[0], indent=4) """ Explanation: The Split-Apply-Combine Pattern...
trungdong/datasets-provanalytics-dmkd
Cross Validation Code.ipynb
mit
# The 'combined' list has all the 22 metrics feature_names_combined = ( 'entities', 'agents', 'activities', # PROV types (for nodes) 'nodes', 'edges', 'diameter', 'assortativity', # standard metrics 'acc', 'acc_e', 'acc_a', 'acc_ag', # average clustering coefficients 'mfd_e_e', 'mfd_e_a', 'mfd_e_ag',...
bspalding/research_public
lectures/linear_regression/Linear Regression.ipynb
apache-2.0
# Import libraries import numpy as np from statsmodels import regression import statsmodels.api as sm import matplotlib.pyplot as plt import math """ Explanation: Linear Regression By Evgenia "Jenny" Nitishinskaya and Delaney Granizo-Mackenzie with example algorithms by David Edwards Part of the Quantopian Lecture Ser...
GoogleCloudPlatform/ai-platform-samples
notebooks/samples/pytorch/text_classification/text_classification_using_pytorch_and_ai_platform.ipynb
apache-2.0
import sys # If you are running this notebook in Colab, run this cell and follow the # instructions to authenticate your GCP account. This provides access to your # Cloud Storage bucket and lets you submit training jobs and prediction # requests. if 'google.colab' in sys.modules: from google.colab import auth as go...
gobabiertoAR/datasets-portal
estructura-organica-pen/Cleaner estructura organica.ipynb
mit
from __future__ import unicode_literals from __future__ import print_function from data_cleaner import DataCleaner import pandas as pd input_path = "estructura-organica-raw.csv" output_path = "estructura-organica-clean.csv" dc = DataCleaner(input_path) """ Explanation: Limpieza de Estructura Organica del PEN Se util...
swirlingsand/deep-learning-foundations
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
g-weatherill/catalogue_toolkit
notebooks/Homogenisation.ipynb
agpl-3.0
parser = ISFReader("inputs/isc_test_catalogue_isf.txt", selected_origin_agencies=["ISC", "GCMT", "HRVD", "NEIC", "EHB", "BJI"], selected_magnitude_agencies=["ISC", "GCMT", "HRVD", "NEIC", "BJI"]) catalogue = parser.read_file("ISC_DB1", "ISC Global M >= 5") print("Catalogue contains...
jeicher/cobrapy
documentation_builder/getting_started.ipynb
lgpl-2.1
from __future__ import print_function import cobra.test # "ecoli" and "salmonella" are also valid arguments model = cobra.test.create_test_model("textbook") """ Explanation: Getting Started To begin with, cobrapy comes with bundled models for Salmonella and E. coli, as well as a "textbook" model of E. coli core metab...
chapmanbe/utah_highschool_airquality
windrose/make_WindRose.ipynb
apache-2.0
%matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np from datetime import datetime import json from urllib.request import urlopen # Confirm that `pm25rose.py` is in your directory from pm25rose import WindroseAxes import mesowest """ Explanation: P...
AhmetHamzaEmra/Deep-Learning-Specialization-Coursera
Sequence Models/Emojify+-+v2.ipynb
mit
import numpy as np from emo_utils import * import emoji import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier. Have you ever wanted to make your text messages more expressive? You...
dennys-bd/Udacity-Deep-Learning
3 - Convolutional Neural Net/Scripts/Simple_Autoencoder.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) """ Explanation: A Simple Autoencoder We'll start off by building a simple autoencoder to compres...
probml/pyprobml
notebooks/misc/elegy_intro.ipynb
mit
%%capture !pip install git+https://github.com/deepmind/dm-haiku #!pip install -q clu ml-collections git+https://github.com/google/flax %%capture ! pip install --upgrade pip ! pip install elegy datasets matplotlib """ Explanation: <a href="https://colab.research.google.com/github/probml/probml-notebooks/blob/main/note...
M0nica/python-foundations-hw
08/08.ipynb
mit
# workon dataanalysis - my virtual environment import pandas as pd import matplotlib.pyplot as plt %matplotlib inline # df = pd.read_table('34933-0001-Data.tsv') odf = pd.read_csv('accreditation_2016_03.csv') odf.head() odf.columns odf['Campus_City'].value_counts().head(10) top_cities = odf['Campus_City'].value_co...
bbfamily/abu
abupy_lecture/23-美股UMP决策(ABU量化使用文档).ipynb
gpl-3.0
# 基础库导入 from __future__ import print_function from __future__ import division import warnings warnings.filterwarnings('ignore') warnings.simplefilter('ignore') import numpy as np import pandas as pd import matplotlib.pyplot as plt import ipywidgets %matplotlib inline import os import sys # 使用insert 0即只使用github,避免交叉...
scikit-optimize/scikit-optimize.github.io
0.8/notebooks/auto_examples/plots/partial-dependence-plot-with-categorical.ipynb
bsd-3-clause
print(__doc__) import sys from skopt.plots import plot_objective from skopt import forest_minimize import numpy as np np.random.seed(123) import matplotlib.pyplot as plt import numpy as np from sklearn.datasets import load_breast_cancer from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import...
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
doc/notebooks/automaton.eliminate_state.ipynb
gpl-3.0
import vcsn """ Explanation: automaton.eliminate_state(state = -1) In the Brzozowski-McCluskey procedure, remove one state. Preconditions: - The labelset is oneset (i.e., the automaton is spontaneous). - The weightset is expressionset (i.e., the weights are expressions). - The _state_ is indeed a state of the automato...
atcemgil/notes
HamiltonianDynamics.ipynb
mit
%matplotlib inline import scipy as sc import numpy as np import scipy.linalg as la import matplotlib.pyplot as plt A = np.mat('[0,1;-1,0]') dt = 0.05 T = 100 z = np.mat(np.zeros((2,T))) H = la.expm(dt*A) z[:,0] = np.mat('[2.4;0]') for i in range(1,T): z[:,i] = H*z[:,i-1] plt.plot(z[0,:], z[1,:],'.-r') ax...
tanmay987/deepLearning
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that takes in a sequence of letters, an...
nathawkins/PHY451_FS_2017
Diode Laser Spectroscopy/20171003_morning/Interference with SAS no Dopple/Interferometer with SAS No Doppler Analysis.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...
OSGeo-live/CesiumWidget
Examples/CesiumWidget Interact-Example.ipynb
apache-2.0
from CesiumWidget import CesiumWidget from IPython import display from czml_example import simple_czml, complex_czml """ Explanation: Cesium Widget Example This is an example notebook to sow how to bind the Cesiumjs with the IPython interactive widget system. End of explanation """ cesiumExample = CesiumWidget(width...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/homework_assignments/function_tutorial.ipynb
agpl-3.0
def print_hello(): print("hello!") # call the function and store its output. You don't really have to have the output= part if you don't want to. output=print_hello() print("output of print_hello() is:", output) """ Explanation: Python functions - some examples This notebook demonstrates how to work with python...
trungdong/datasets-provanalytics-dmkd
Extra 2.1 - Unbalanced Data - Application 1.ipynb
mit
import pandas as pd df = pd.read_csv("provstore/data.csv") df.head() df.describe() # The number of each label in the dataset df.label.value_counts() """ Explanation: Extra 2.1 - Unbalanced Data - Application 1: ProvStore Documents Identifying owners of provenance documents from their provenance network metrics. In ...
tpin3694/tpin3694.github.io
neural-networks/mnist_nn.ipynb
mit
%matplotlib inline from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense from keras.utils import to_categorical import numpy as np import matplotlib.pyplot as plt # Load data (X_train, y_train), (X_test, y_test) = mnist.load_data() print(X_train.shape) print(y_train.shape)...
msampathkumar/datadriven_pumpit
pumpit/save/BenchMarkSeed_0.8118.ipynb
apache-2.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set(color_codes=True) np.random.seed(69572) %matplotlib inline %load_ext writeandexecute # plt.figure(figsize=(120,10)) small = (4,3) mid = (10, 8) large = (12, 8) """ Explanation: PUMP IT Using data from Taarifa and ...
jorisvandenbossche/DS-python-data-analysis
notebooks/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 (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#100;&#101;&#110;&#98;&#111;&#115;&...
char-lie/physical-informatics
Lab1/lab1.ipynb
mit
MU = 3.9 N = int(10E4) INITIAL = 0.5 MIN_SIZE = 2 MAX_SIZE = 26 BITS_RANGE = array(list(range(MIN_SIZE, MAX_SIZE + 1))) def generate(x, mu, n): current = x for _ in range(n): yield current current = mu * current * (1 - current) def bin_to_dec(sequence, bits): aligned_sequence = sequence.fl...
probml/pyprobml
notebooks/book2/17/gp_spectral_mixture.ipynb
mit
%%capture import jax import jax.numpy as jnp import numpy as np import matplotlib.pyplot as plt try: import tinygp except ModuleNotFoundError: %pip install -qq tinygp import tinygp try: import optax except ModuleNotFoundError: %pip install -qq optax import optax try: import probml_utils a...
Danghor/Algorithms
Python/Chapter-07/.ipynb_checkpoints/Heap-checkpoint.ipynb
gpl-2.0
class Heap: sNodeCount = 0 def __init__(self): Heap.sNodeCount += 1 self.mID = str(Heap.sNodeCount) def getID(self): return self.mID # used only by graphviz """ Explanation: Implementing Priority Queues as Heaps Ths notebook presents <em style="color:blue">heaps</em>....
deeplearningsp/5_meetup
src/perceptron.ipynb
mit
%matplotlib inline import numpy as np import pandas as pd import inspect import matplotlib.pyplot as plt from perceptron import Perceptron plt.style.use('ggplot') print inspect.getsource(Perceptron) inputs = np.array([0.2, 12.2,0.98]) pc = Perceptron(len(inputs), 0.5) """ Explanation: Modeling a Perceptron To show ...
atulsingh0/MachineLearning
python_DC/Learning_pandas_DataFrame_#2.ipynb
gpl-3.0
state = ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada'] year = [2000, 2001, 2002, 2001, 2002] pop = [1.5, 1.7, 3.6, 2.4, 2.9] print(type(state), type(year), type(pop)) # creating dataframe df = pd.DataFrame({'state':state, 'year':year, 'pop':pop}) print(df.info()) print(df) sdata = {'state':state, 'year':year, 'pop':p...
JAmarel/Phys202
Integration/IntegrationEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy import integrate """ Explanation: Integration Exercise 2 Imports End of explanation """ def integrand(x, a): return 1.0/(x**2 + a**2) def integral_approx(a): # Use the args keyword argument to feed extra a...
kowey/attelo
doc/tut_parser.ipynb
gpl-3.0
from __future__ import print_function from os import path as fp from attelo.io import (load_multipack) CORPUS_DIR = 'example-corpus' PREFIX = fp.join(CORPUS_DIR, 'tiny') # load the data into a multipack mpack = load_multipack(PREFIX + '.edus', PREFIX + '.pairings', PREFI...
muratcemkose/cy-rest-python
cytoscape-js/CytoscapeJs_and_igraph.ipynb
mit
from py2cytoscape.cytoscapejs import viewer as cyjs from py2cytoscape import util import json import igraph as ig """ Explanation: Network analysis and visualization with py2cytoscape and igraph What is Cytoscape? - An open source platform for graph analysis and visualization - Free! (for both academic and commercial...
dadavidson/Python_Lab
Complete-Python-Bootcamp/Print Formatting.ipynb
mit
print 'This is a string' """ Explanation: Print Formatting In this lecture we will briefly cover the various ways to format your print statements. As you code more and more, you will probably want to have print statements that can take in a variable into a printed string statement. The most basic example of a print st...
ES-DOC/esdoc-jupyterhub
notebooks/nerc/cmip6/models/ukesm1-0-mmh/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'nerc', 'ukesm1-0-mmh', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: NERC Source ID: UKESM1-0-MMH Topic: Ocnbgchem Sub-Topics: Tracers. Prope...
hetaodie/hetaodie.github.io
assets/media/uda-ml/deep/azjc/卷积神经网络的例子/dog/dog_app_zh.ipynb
mit
from sklearn.datasets import load_files from keras.utils import np_utils import numpy as np from glob import glob # define function to load train, test, and validation datasets def load_dataset(path): data = load_files(path) dog_files = np.array(data['filenames']) dog_targets = np_utils.to_categoric...
khalibartan/pgmpy
examples/Gaussian Bayesian Networks (GBNs).ipynb
mit
# from pgmpy.factors.continuous import LinearGaussianCPD import sys import numpy as np import pgmpy sys.path.insert(0, "../pgmpy/") from pgmpy.factors.continuous import LinearGaussianCPD mu = np.array([7, 13]) sigma = np.array([[4 , 3], [3 , 6]]) cpd = LinearGaussianCPD('Y', evidence_mean = mu, ...
mne-tools/mne-tools.github.io
0.20/_downloads/6684371ec2bc8e72513b3bdbec0d3a9f/plot_20_events_from_raw.ipynb
bsd-3-clause
import os import numpy as np import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file) raw.crop(tmax=60).load_data() """ Explanati...
jhconning/Dev-II
notebooks/lognormal.ipynb
bsd-3-clause
mystring = 'economics' """ Explanation: Equilibrium Size Distribution of Farms Like many of these notebooks this one was written quickly. Indeterminacy of size distribution with constant returns to scale technology In an earlier analysis we described the optimal consumption and production allocations of a farm househo...
vzg100/Post-Translational-Modification-Prediction
.ipynb_checkpoints/Phosphorylation Sequence Tests -MLP -dbptm+ELM-filterBenchmark-checkpoint.ipynb
mit
from pred import Predictor from pred import sequence_vector from pred import chemical_vector """ Explanation: Template for test End of explanation """ par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"] for i in par: print("y", i) y = Predictor() y.load_data(file="Data/Trainin...
GoogleCloudPlatform/gcp-getting-started-lab-jp
machine_learning/cloud_ai_platform/bigquery_ml.ipynb
apache-2.0
from google.colab import auth auth.authenticate_user() print('認証されました。') """ Explanation: <a href="https://colab.research.google.com/github/GoogleCloudPlatform/gcp-getting-started-lab-jp/blob/master/machine_learning/cloud_ai_platform/bigquery_ml.ipynb" target="_parent"><img src="https://colab.research.google.com/asset...
mne-tools/mne-tools.github.io
0.23/_downloads/e23ed246a9a354f899dfb3ce3b06e194/10_overview.ipynb
bsd-3-clause
import os import numpy as np import mne """ Explanation: Overview of MEG/EEG analysis with MNE-Python This tutorial covers the basic EEG/MEG pipeline for event-related analysis: loading data, epoching, averaging, plotting, and estimating cortical activity from sensor data. It introduces the core MNE-Python data struct...
aufziehvogel/kaggle
quora-question-pairs/notebooks/1.0-sk-initial-overview.ipynb
mit
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np %matplotlib inline df = pd.read_csv('../data/raw/train.csv') df.head() """ Explanation: Initial Overview First we want to have a look at the data. End of explanation """ questions = pd.concat([df['question1'], df['questio...
ioannispartalas/Kaggle
WhatsCooking/whats_cooking.ipynb
gpl-3.0
train = pd.read_json("train.json") matplotlib.style.use('ggplot') cuisine_group = train.groupby('cuisine') cuisine_group.size().sort_values(ascending=True).plot.barh() plt.show() """ Explanation: Let's do a quick inspection of the data by plotting the distribution of the different types of cuisines in the dataset. E...
mne-tools/mne-tools.github.io
dev/_downloads/51cca4c9f4bd40623cb6bfa890e2eb4b/20_erp_stats.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from scipy.stats import ttest_ind import mne from mne.channels import find_ch_adjacency, make_1020_channel_selections from mne.stats import spatio_temporal_cluster_test np.random.seed(0) # Load the data path = mne.datasets.kiloword.data_path() / 'kword_metadata-epo....
wrightaprilm/squamates
ExploratoryNotebooks/heatmap.ipynb
mit
import pandas as pd from pandas import * import matplotlib.pyplot as plt %matplotlib inline """ Explanation: This script generates a heatmap from data indicating the probability of oviparity as the root state of squamates as a function of model parameters. End of explanation """ data = pd.read_csv("../Data/Heatmap/...
jaimefrio/pydatabcn2017
taking_numpy_in_stride/Taking NumPy In Stride - Student Version.ipynb
unlicense
a = np.arange(3) type(a) """ Explanation: Array views and slicing A NumPy array is an object of numpy.ndarray type: End of explanation """ a = np.arange(3) a.base is None a[:].base is None """ Explanation: All ndarrays have a .base attribute. If this attribute is not None, then the array is a view of some other ob...
the-deep-learners/study-group
nn-from-scratch/MNIST-nn-SGD-flex_arch.ipynb
mit
# Import libraries import numpy as np import matplotlib.pyplot as plt import math from sklearn.metrics import accuracy_score import pickle import sys """ Explanation: A neural network from first principles The code below was adpated from the code supplied in Andrew Ng's Coursera course on machine learning. The origina...
ccasotto/rmtk
rmtk/vulnerability/mdof_to_sdof/first_mode/first_mode.ipynb
agpl-3.0
%matplotlib inline from rmtk.vulnerability.common import utils from rmtk.vulnerability.mdof_to_sdof.first_mode import first_mode pushover_file = "../../../../../rmtk_data/capacity_curves_Vb-dfloor.csv" idealised_type = 'quadrilinear'; # 'bilinear', 'quadrilinear' or 'none' capacity_curves = utils.read_capacity_curves...
william-gray/data-science-python
ML-regression/PredictingHousePrices.ipynb
mit
import os from urllib import urlretrieve import graphlab # Limit number of worker processes. This preserves system memory, which prevents hosted notebooks from crashing. graphlab.set_runtime_config('GRAPHLAB_DEFAULT_NUM_PYLAMBDA_WORKERS', 4) URL = 'https://d396qusza40orc.cloudfront.net/phoenixassets/home_data.csv' d...
ledeprogram/algorithms
class10/donow/radhikapc_DoNow_10.ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import dateutil.parser import pg8000 from pandas import DataFrame from sklearn.externals.six import StringIO import pydotplus from sklearn import tree from sklearn.cross_validation import train_test_split from sklearn import metri...
mrcinv/matpy
01a_enacbe.ipynb
gpl-2.0
import sympy as sym x = sym.symbols("x") # spremenljivka x je matematični simbol """ Explanation: << nazaj: Uvod Enačbe in neenačbe V tem delu si bomo ogledali različne pristope, kako se spopademo z enačbami. Spoznali bomo nekaj dodatnih knjižnic za python: SymPy, matplotlib in SciPy. Simbolično reševanje s SymPy Simb...
mayankjohri/LetsExplorePython
Section 1 - Core Python/Chapter 12 - Introspection/Chapter14_Introspection.ipynb
gpl-3.0
trospection or reflection is the ability of software to identify and report their own internal structures, such as types, variabl# Getting some information # about global objects in the program from types import ModuleType def info(n_obj): # Create a referênce to the object obj = globals()[n_obj] # Show...
postBG/DL_project
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
hktxt/MachineLearning
ML/Week 3 Assessment Orthogonal Projections.ipynb
gpl-3.0
# PACKAGE: DO NOT EDIT import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') import numpy as np from sklearn.datasets import fetch_olivetti_faces, fetch_lfw_people from ipywidgets import interact %matplotlib inline image_shape = (64, 64) # Load faces data dataset = fe...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/kernel_density.ipynb
bsd-3-clause
%matplotlib inline import numpy as np from scipy import stats import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.distributions.mixture_rvs import mixture_rvs """ Explanation: Kernel Density Estimation Kernel density estimation is the process of estimating an unknown probability density funct...
googledatalab/notebooks
tutorials/BigQuery/BigQuery Magic Commands and DML.ipynb
apache-2.0
%%bq query --name UniqueNames2013 WITH UniqueNames2013 AS (SELECT DISTINCT name FROM `bigquery-public-data.usa_names.usa_1910_2013` WHERE Year = 2013) SELECT * FROM UniqueNames2013 """ Explanation: BigQuery Magic Commands and DML The examples in this notebook introduce features of BigQuery Standard SQL and BigQuer...
pastas/pastas
examples/notebooks/09_calibration_options.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt import pastas as ps ps.show_versions() ps.set_log_level("ERROR") """ Explanation: Calibrating Pastas models R.A. Collenteur, University of Graz After a model is constructed, the model parameters can be estimated using the ml.solve method. It can (and will) happen th...
iutzeler/Introduction-to-Python-for-Data-Sciences
4-2_Supervised_Learning.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs %matplotlib inline # we create 40 separable points in R^2 around 2 centers (random_state=6 is a seed so that the set is separable) X, y = make_blobs(n_samples=40, n_features=2, centers=2 , random_state=6) print(X[:5,:],y[:5]) #...
GoogleCloudPlatform/asl-ml-immersion
notebooks/launching_into_ml/labs/3_repeatable_splitting.ipynb
apache-2.0
from google.cloud import bigquery """ Explanation: Repeatable splitting Learrning Objectives * explore the impact of different ways of creating train/valid/test splits Overview Repeatability is important in machine learning. If you do the same thing now and 5 minutes from now and get different answers, then it makes ...