repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
mne-tools/mne-tools.github.io
0.14/_downloads/plot_stockwell.ipynb
bsd-3-clause
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne from mne import io from mne.time_frequency import tfr_stockwell from mne.datasets import somato print(__doc__) """ Explanation: Time frequency with St...
dalonlobo/GL-Mini-Projects
TweetAnalysis/Final/Q4/Dalon_4_RTD_MiniPro_Tweepy_Q4_3.ipynb
mit
import logging # python logging module # basic format for logging logFormat = "%(asctime)s - [%(levelname)s] (%(funcName)s:%(lineno)d) %(message)s" # logs will be stored in tweepy.log logging.basicConfig(filename='tweepyloc.log', level=logging.INFO, format=logFormat, datefmt="%Y-%m-%d %H:%M:%S") ...
mathinmse/mathinmse.github.io
Lecture-18-Implicit-Finite-Difference.ipynb
mit
import sympy as sp sp.init_session(quiet=True) var('U_LHS U_RHS') """ Explanation: Lecture 18: Numerical Solutions to the Diffusion Equation (Implicit Methods) Sections Introduction Learning Goals On Your Own In Class Revisiting the Discrete Version of Fick's Law A Linear System for Diffusion An Implicit Numerical So...
khalido/algorithims
quicksort.ipynb
gpl-3.0
import random import numpy as np random_data = [random.randint(0,100) for i in range(10)] random_data[:10] def quicksort(data): if len(data) < 2: return data else: pivot = data[0] less = [i for i in data[1:] if i <= pivot] more = [i for i in data[1:] if i > pivot] ret...
ceos-seo/data_cube_notebooks
notebooks/landslides/Landslide_Identification_SLIP.ipynb
apache-2.0
import sys import os sys.path.append(os.environ.get('NOTEBOOK_ROOT')) import numpy as np import xarray as xr import pandas as pd import matplotlib.pyplot as plt from utils.data_cube_utilities.dc_display_map import display_map from utils.data_cube_utilities.clean_mask import landsat_clean_mask_full # landsat_qa_cl...
ContinualAI/avalanche
notebooks/from-zero-to-hero-tutorial/05_evaluation.ipynb
mit
!pip install avalanche-lib==0.2.0 """ Explanation: description: Automatic Evaluation with Pre-implemented Metrics Evaluation Welcome to the "Evaluation" tutorial of the "From Zero to Hero" series. In this part we will present the functionalities offered by the evaluation module. End of explanation """ import torch f...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/.ipynb_checkpoints/n10_dyna_q_with_predictor_full_training-checkpoint.ipynb
mit
# Basic imports import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt import scipy.optimize as spo import sys from time import time from sklearn.metrics import r2_score, median_absolute_error from multiprocessing import Pool import pickle %matplotlib inline %pylab inli...
nick-youngblut/SIPSim
ipynb/bac_genome/fullCyc/trimDataset/dataset_info.ipynb
mit
%load_ext rpy2.ipython %%R workDir = '/home/nick/notebook/SIPSim/dev/fullCyc/' physeqDir = '/home/nick/notebook/SIPSim/dev/fullCyc_trim/' physeqBulkCore = 'bulk-core_trm' physeqSIP = 'SIP-core_unk_trm' ampFragFile = '/home/nick/notebook/SIPSim/dev/bac_genome1147/validation/ampFrags_kde.pkl' """ Explanation: General...
amlanlimaye/yelp-dataset-challenge
notebooks/reports/3.1-technical-report.ipynb
mit
### Link to requirements.txt on github """ Explanation: Discovering Abstract Topics in Yelp Reviews - Technical Report 1. Background Yelp is an American multinational corporation headquartered in San Francisco, California. It develops, hosts and markets Yelp.com and the Yelp mobile app, which publish crowd-sourced rev...
rnoxy/cifar10-cnn
Classification_using_CNN_codes.ipynb
mit
!ls features/ """ Explanation: CIFAR10 classification using CNN codes Here we are going to build linear models to classify CNN codes of CIFAR10 images. We assume that we already have all the codes extracted by the scripts in the following notebooks: - Feature_extraction_using_keras.ipynb - Feature_extraction_using_Inc...
LorenzoBi/courses
TSAADS/tutorial 2/TSA2_LORENZO_BIASI__JULIUS_VERNIE.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import scipy.io as sio from sklearn import datasets, linear_model %matplotlib inline def set_data(p, x): temp = x.flatten() n = len(temp[p:]) x_T = temp[p:].reshape((n, 1)) X_p = np.ones((n, p + 1)) for i in range(1, p + 1): X_p[:, i] = tem...
Raag079/self-driving-car
Term01-Computer-Vision-and-Deep-Learning/P2-Traffic-Sign-Classifier/Traffic_Sign_Classifier.ipynb
mit
# Load pickled data import pickle # TODO: Fill this in based on where you saved the training and testing data training_file = 'train.p' testing_file = 'test.p' with open(training_file, mode='rb') as f: train = pickle.load(f) with open(testing_file, mode='rb') as f: test = pickle.load(f) X_train, y_train ...
walkon302/CDIPS_Recommender
notebooks/Exploring_Data.ipynb
apache-2.0
import sys import os sys.path.append(os.getcwd()+'/../') # other import numpy as np import glob import pandas as pd import ntpath #keras from keras.preprocessing import image # plotting import seaborn as sns sns.set_style('white') import matplotlib.pyplot as plt %matplotlib inline # debuggin from IPython.core.debu...
bhargavvader/pycobra
docs/notebooks/visualise.ipynb
mit
%matplotlib inline import numpy as np from pycobra.cobra import Cobra from pycobra.ewa import Ewa from pycobra.visualisation import Visualisation from pycobra.diagnostics import Diagnostics # setting up our random data-set rng = np.random.RandomState(42) # D1 = train machines; D2 = create COBRA; D3 = calibrate epsilo...
cavestruz/MLPipeline
notebooks/anomaly_detection/sample_anomaly_detection_stueber.ipynb
mit
import numpy as np import matplotlib.pyplot as plt from sklearn import svm %matplotlib inline """ Explanation: Let us first explore an example that falls under novelty detection. Here, we train a model on data with some distribution and no outliers. The test data, has some "novel" subset of data that does not follow...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/ml_ops/stage4/get_started_with_model_evaluation.ipynb
apache-2.0
import os # The Vertex AI Workbench Notebook product has specific requirements IS_WORKBENCH_NOTEBOOK = os.getenv("DL_ANACONDA_HOME") IS_USER_MANAGED_WORKBENCH_NOTEBOOK = os.path.exists( "/opt/deeplearning/metadata/env_version" ) # Vertex AI Notebook requires dependencies to be installed with '--user' USER_FLAG = ...
mjbrodzik/ipython_notebooks
modice/sii_monthly_for_modice.ipynb
apache-2.0
monthly.shape monthly = monthly[monthly['hemisphere'] == 'N'] monthly.shape monthly.loc[:,'date'] = pd.to_datetime(monthly['month']) # Set the month column to the DataFrame index monthly.set_index('date', inplace=True, verify_integrity=True, drop=True) monthly = monthly[monthly.index > '1998-12-31'] monthly.colum...
xoolive/scientificpython
labs/02_making_maps.ipynb
mit
shapefile_path = "./data/CNTR_2014_03M_SH/Data/CNTR_RG_03M_2014.shp" """ Explanation: Cartes du monde, cartes de France Planisphères et projections L'objectif de cette séance est de se familiariser avec un format courant de description de contours, le format shapefile, et avec différentes projections couramment utilis...
yugangzhang/CHX_Pipelines
2019_1/Template/XPCS_Single_2019_V2.ipynb
bsd-3-clause
from pyCHX.chx_packages import * %matplotlib notebook plt.rcParams.update({'figure.max_open_warning': 0}) plt.rcParams.update({ 'image.origin': 'lower' }) plt.rcParams.update({ 'image.interpolation': 'none' }) import pickle as cpk from pyCHX.chx_xpcs_xsvs_jupyter_V1 import * import itertools #from pyCHX.XPCS_SAXS i...
JohannesEH/time-series-analysis
Fremont Bridge Analysis.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt; from jubiiworkflow.data import get_data import pandas as pd import numpy as np from sklearn.decomposition import PCA from sklearn.mixture import GaussianMixture plt.style.use('seaborn'); """ Explanation: Analysis of Seattle Fremont Bridge Bike Traffic End of expla...
ozorich/phys202-2015-work
assignments/assignment05/InteractEx03.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 3 Imports End of explanation """ def soliton(x, t, c, a): """Return phi(x, t) for a soliton wave with co...
materialsvirtuallab/matgenb
notebooks/2017-03-02-Getting data from Materials Project.ipynb
bsd-3-clause
from pymatgen.ext.matproj import MPRester from pymatgen.core import Composition import re import pprint # Make sure that you have the Materials API key. Put the key in the call to # MPRester if needed, e.g, MPRester("MY_API_KEY") mpr = MPRester() """ Explanation: Introduction This notebook demonstrates how you can ob...
besser82/shogun
doc/ipython-notebooks/ica/bss_image.ipynb
bsd-3-clause
# change to the shogun-data directory import os import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') os.chdir(os.path.join(SHOGUN_DATA_DIR, 'ica')) from PIL import Image import numpy as np # Load Images as grayscale images and convert to numpy arrays s1 = np.asarray(Image.open("lena.jpg").convert('...
amitkaps/machine-learning
time_series/4-Explore.ipynb
mit
# Import the library we need, which is Pandas import pandas as pd """ Explanation: 4. Explore the Data "I don't know, what I don't know" We want to first visually explore the data to see if we can confirm some of our initial hypotheses as well as make new hypothesis about the problem we are trying to solve. For this...
Caranarq/01_Dmine
Datasets/SEPOMEX/SEPOMEX.ipynb
gpl-3.0
# Librerias utilizadas import pandas as pd import sys import os import csv import urllib # Descarga de archivos a carpeta local fuente = r'https://github.com/redrbrt/sepomex-zip-codes/raw/master/sepomex_abril-2016.csv' destino = r'D:\PCCS\00_RawData\01_CSV\SEPOMEX\sepomex_abril-2016.csv' urllib.request.urlretrieve(fue...
SunPower/pvfactors
docs/tutorials/Create_discretized_pvarray.ipynb
bsd-3-clause
# Import external libraries import matplotlib.pyplot as plt # Settings %matplotlib inline """ Explanation: Discretize PV row sides and indexing In this section, we will learn how to: create a PV array with discretized PV row sides understand the indices of the timeseries surfaces of a PV array plot a PV array with i...
AMICI-developer/AMICI
documentation/GettingStarted.ipynb
bsd-2-clause
import amici sbml_importer = amici.SbmlImporter('model_steadystate_scaled.xml') """ Explanation: Getting Started in AMICI This notebook is a brief tutorial for new users that explains the first steps necessary for model simulation in AMICI, including pointers to documentation and more advanced notebooks. Model Compila...
bambinos/bambi
docs/notebooks/alternative_links_binary.ipynb
mit
import arviz as az import bambi as bmb import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.special import expit as invlogit from scipy.stats import norm az.style.use("arviz-darkgrid") np.random.seed(1234) """ Explanation: Regression for Binary responses: Alternative link functions In th...
tolaoniyangi/dmc
notebooks/week-4/02-tensorflow ANN for classification.ipynb
apache-2.0
%matplotlib inline import math import random import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from sklearn.datasets import load_boston '''Since this is a classification problem, we will need to represent our targets as one-hot encoding vectors (see previous lab). To do this we will use sciki...
beralt85/current_cumulants
example.ipynb
mit
# inline plotting/interaction %pylab inline # replace the line above with the line below for command line scripts: # from pylab import * from sympy import * # symbolic python init_printing() # pretty printing import numpy as np # numeric python import time # timing, for performance monitoring # activate latex text ...
jsgreenwell/teaching-python
tutorial_files/presentations/list_comp_example.ipynb
mit
class vector_math: ''' This is the base class for vector math - which allows for initialization with two vectors. ''' def __init__(self, vectors = [[1,2,2],[3,4,3]]): self.vect1 = vectors[0] self.vect2 = vectors[1] def set_vects(self, vectors): self.vect1 = vect...
moonbury/pythonanywhere
RegressionAnalysisWithPython/Chap_6 - Achieving Generalization.ipynb
gpl-3.0
import pandas as pd from sklearn.datasets import load_boston boston = load_boston() dataset = pd.DataFrame(boston.data, columns=boston.feature_names) dataset['target'] = boston.target observations = len(dataset) variables = dataset.columns[:-1] X = dataset.ix[:,:-1] y = dataset['target'].values from sklearn.cross_val...
ferasz/LCCM
Example/LCCM code example.ipynb
bsd-3-clause
import lccm import numpy as np import pandas as pd import pylogit import warnings from collections import OrderedDict """ Explanation: LCCM Code Walk-through Example The following notebook demonstrates how this latent class choice model code works. We will be using an example dataset (Qualtrics data long format.csv) t...
garibaldu/multicauseRBM
Max/RBM-ORBM-Single-Models.ipynb
mit
from scipy.special import expit from rbmpy.rbm import RBM from rbmpy.sampler import VanillaSampler, PartitionedSampler, ApproximatedSampler, LayerWiseApproxSampler,ApproximatedMulDimSampler, ContinuousSampler from rbmpy.trainer import VanillaTrainier from rbmpy.performance import Result import numpy as np import rbmpy....
mne-tools/mne-tools.github.io
stable/_downloads/e41b6a898e7a75f8a9f1a6c00ca73857/20_visualize_epochs.ipynb
bsd-3-clause
import os 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, verbose=False).crop(tmax=120) """ Explanation: Visualizing epo...
keskarnitish/Recipes
examples/ImageNet Pretrained Network (VGG_S).ipynb
mit
!wget https://s3.amazonaws.com/lasagne/recipes/pretrained/imagenet/vgg_cnn_s.pkl """ Explanation: Introduction This example demonstrates using a network pretrained on ImageNet for classification. The model used was converted from the VGG_CNN_S model (http://arxiv.org/abs/1405.3531) in Caffe's Model Zoo. For details o...
ConnectedSystems/veneer-py
doc/training/5_Running_Iteratively.ipynb
isc
import veneer v = veneer.Veneer(port=9876) """ Explanation: Session 5: Running Iteratively Running Source models from Python becomes more compelling when you start running the model multiple times, modifying something (parameters, inputs, structure) about the model between runs. At the same time, the number of possibl...
chengsoonong/mclass-sky
projects/david/lab/experiment_log_regression.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.optimize as opt from scipy.special import expit # The logistic sigmoid function %matplotlib inline """ Explanation: Classification COMP4670/8600 - Introduction to Statistical Machine Learning - Tutorial 3 $\newcommand{\trace}[1]{\ope...
tensorflow/quantum
docs/tutorials/qcnn.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...
google/jax-md
notebooks/nve_neighbor_list.ipynb
apache-2.0
#@title Imports & Utils !pip install jax-md import numpy as onp from jax.config import config ; config.update('jax_enable_x64', True) import jax.numpy as np from jax import random from jax import jit from jax import lax import time from jax_md import space from jax_md import smap from jax_md import energy from jax...
sorter43/PR2017LSBOLP
BaseClass/Porazdelitve.ipynb
apache-2.0
% matplotlib inline import numpy as np import matplotlib.pyplot as plt data = np.loadtxt ('../ratingSAMPLE.csv', delimiter=",", skiprows=0) """ Explanation: Porazdelitev End of explanation """ ratingsNum=list() for number in np.arange(1,10): ratingsNum.append(len(data[data[:,2]==number,2])) plt.figure() plt.ba...
chunweixu/Deep-Learning
language-translation/.ipynb_checkpoints/dlnd_language_translation-checkpoint.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...
amitkaps/hackermath
Module_3a_linear_algebra_eigenvectors.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline plt.style.use('fivethirtyeight') plt.rcParams['figure.figsize'] = (10, 6) def vector_plot (vector): X,Y,U,V = zip(*vector) C = [1,1,2,2] plt.figure() ax = plt.gca() ax.quiver(X,Y,U,V,C, angles='xy',scale_units='xy',scale=1) ...
google/compass
packages/propensity/12.cleanup.ipynb
apache-2.0
# Add custom utils module to Python environment. import os import sys sys.path.append(os.path.abspath(os.pardir)) from google.cloud import bigquery from utils import helpers """ Explanation: 12. Cleanup BigQuery artifacts This notebook helps to clean up interim tables generated while executing notebooks from 01 to 09...
QuantEcon/QuantEcon.notebooks
ddp_ex_MF_7_6_5_py.ipynb
bsd-3-clause
%matplotlib inline import itertools import numpy as np from scipy import sparse import matplotlib.pyplot as plt from quantecon.markov import DiscreteDP maxcap = 30 n = maxcap + 1 # Number of states m = n # Number of actions a1, b1 = 14, 0.8 a2, b2 = 10, 0.4 F = lambda x: a1 * x**b1 # Benefit from irrigat...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-1/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-1', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-1 Topic: Landice Sub-Topics: Glaciers, Ice. Properties:...
ltiao/project-euler
problem-7-10001st-prime.ipynb
unlicense
from itertools import count, islice from collections import defaultdict def _sieve_of_eratosthenes(): factors = defaultdict(set) for n in count(2): if factors[n]: for m in factors.pop(n): factors[n+m].add(m) else: factors[n*n].add(n) yield n ...
tensorflow/docs-l10n
site/ja/guide/saved_model.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...
ajhenrikson/phys202-2015-work
assignments/project/NeuralNetworks.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt from IPython.html.widgets import interact from sklearn.datasets import load_digits digits = load_digits() print(digits.data.shape) def show_digit(i): plt.matshow(digits.images[i]); interact(show_digit, i=(0,100)); """ Explanation: Neural Networks This project w...
ES-DOC/esdoc-jupyterhub
notebooks/dwd/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', 'dwd', 'sandbox-2', 'aerosol') """ Explanation: ES-DOC CMIP6 Model Properties - Aerosol MIP Era: CMIP6 Institute: DWD Source ID: SANDBOX-2 Topic: Aerosol Sub-Topics: Transport, Emissions, Concent...
guruucsd/EigenfaceDemo
python/PCA Demo.ipynb
mit
from numpy.random import standard_normal # Gaussian variables N = 1000; P = 5 X = standard_normal((N, P)) W = X - X.mean(axis=0,keepdims=True) print(dot(W[:,0], W[:,1])) """ Explanation: PCA and EigenFaces Demo In this demo, we will go through the basic concepts behind the principal component analysis (PCA). We will...
phockett/ePSproc
notebooks/utilDev/zenodo_data_download_tests_200720.ipynb
gpl-3.0
import requests # From doi urlDOI = 'http://dx.doi.org/10.5281/zenodo.3629721' r = requests.get(urlDOI) r.ok dir(r) # r.json() Throws an error, not sure why! # import json # json.loads(r.text) # Ah, same error - seems to be formatting issue? # JSONDecodeError: Expecting value: line 2 colum...
nick-youngblut/SIPSim
ipynb/bac_genome/fullCyc/Day1_fullDataset/rep10_noPCR.ipynb
mit
import os import glob import re import nestly %load_ext rpy2.ipython %load_ext pushnote %%R library(ggplot2) library(dplyr) library(tidyr) library(gridExtra) library(phyloseq) ## BD for G+C of 0 or 100 BD.GCp0 = 0 * 0.098 + 1.66 BD.GCp100 = 1 * 0.098 + 1.66 """ Explanation: TODO: rerun; DBL default changed Goal Ex...
google/earthengine-community
tutorials/time-series-visualization-with-altair/index.ipynb
apache-2.0
import ee ee.Authenticate() ee.Initialize() """ Explanation: Time Series Visualization with Altair Author: jdbcode This tutorial provides methods for generating time series data in Earth Engine and visualizing it with the Altair library using drought and vegetation response as an example. Topics include: Time series ...
econ-ark/HARK
examples/ConsIndShockModel/KinkedRconsumerType.ipynb
apache-2.0
# Initial imports and notebook setup, click arrow to show import matplotlib.pyplot as plt import numpy as np from HARK.ConsumptionSaving.ConsIndShockModel import KinkedRconsumerType from HARK.utilities import plot_funcs_der, plot_funcs mystr = lambda number: "{:.4f}".format(number) """ Explanation: KinkedRconsumerT...
mne-tools/mne-tools.github.io
0.19/_downloads/d52b5321a00f5cf4d4be975019fb541b/plot_morph_surface_stc.ipynb
bsd-3-clause
# Author: Tommy Clausner <tommy.clausner@gmail.com> # # License: BSD (3-clause) import os import mne from mne.datasets import sample print(__doc__) """ Explanation: Morph surface source estimate This example demonstrates how to morph an individual subject's :class:mne.SourceEstimate to a common reference space. We a...
ajgpitch/qutip-notebooks
examples/qip-optpulseprocessor.ipynb
lgpl-3.0
from numpy import pi from qutip.qip.device import OptPulseProcessor from qutip.qip.circuit import QubitCircuit from qutip.qip.operations import expand_operator, toffoli from qutip.operators import sigmaz, sigmax, identity from qutip.states import basis from qutip.metrics import fidelity from qutip.tensor import tensor ...
ijstokes/bokeh-blaze-tutorial
solutions/1.6 Layout (solution).ipynb
mit
# Import the functions from your file from viz import climate_map, legend, timeseries # Create your plots with your new functions climate_map = climate_map() legend = legend() timeseries = timeseries() # Test the visualizations in the notebook from bokeh.plotting import show, output_notebook output_notebook() show...
yttty/python3-scraper-tutorial
Python_Spider_Tutorial_06.ipynb
gpl-3.0
from urllib.request import urlopen from bs4 import BeautifulSoup html = urlopen("https://en.wikipedia.org/wiki/Python_(programming_language)") bsObj = BeautifulSoup(html.read(), "html.parser") for link in bsObj.findAll("a"): if 'href' in link.attrs: print(link.attrs['href']) """ Explanation: 用Python 3开发网络...
jay-johnson/sci-pype
examples/ML-IRIS-Extract-Models-From-Cache.ipynb
apache-2.0
# Setup the Sci-pype environment import sys, os # Only redis is needed for this notebook: os.environ["ENV_DEPLOYMENT_TYPE"] = "JustRedis" # Load the Sci-pype PyCore as a named-object called "core" and environment variables from src.common.load_ipython_env import * """ Explanation: Extracting the IRIS Models from Cac...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_introduction.ipynb
bsd-3-clause
import mne """ Explanation: .. _intro_tutorial: Basic MEG and EEG data processing MNE-Python reimplements most of MNE-C's (the original MNE command line utils) functionality and offers transparent scripting. On top of that it extends MNE-C's functionality considerably (customize events, compute contrasts, group statis...
pyemma/deeplearning
assignment2/BatchNormalization.ipynb
gpl-3.0
# 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 ...
ES-DOC/esdoc-jupyterhub
notebooks/ncc/cmip6/models/noresm2-mh/atmoschem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-mh', 'atmoschem') """ Explanation: ES-DOC CMIP6 Model Properties - Atmoschem MIP Era: CMIP6 Institute: NCC Source ID: NORESM2-MH Topic: Atmoschem Sub-Topics: Transport, Emissions ...
chongxi/spiketag
notebooks/LMNN.ipynb
bsd-3-clause
%pylab inline x = numpy.array([[0,0],[-1,0.1],[0.3,-0.05],[0.7,0.3],[-0.2,-0.6],[-0.15,-0.63],[-0.25,0.55],[-0.28,0.67]]) y = numpy.array([0,0,0,0,1,1,2,2]) """ Explanation: Metric Learning with the Shogun Machine Learning Toolbox Building up the intuition to understand LMNN First of all, let us introduce LMNN throug...
maliyngh/LTPython
LightTools_Data_Examples.ipynb
apache-2.0
# Import the packages/libraries you typically use import clr import System import numpy as np import matplotlib.pyplot as plt #This forces plots inline in the Spyder/Python Command Console %matplotlib inline #In the line below, make sure the path matches your installation! LTCOM64Path="C:\\Program Files\\Optical Resea...
tensorflow/docs-l10n
site/ja/tensorboard/graphs.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...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/launching_into_ml/solutions/decision_trees_and_random_Forests_in_Python.ipynb
apache-2.0
# Scikit-learn is a free machine learning library for Python. # It features various algorithms like random forests, and k-neighbours. # It also supports Python numerical and scientific libraries like NumPy and SciPy. !pip install scikit-learn==0.22.2 """ Explanation: Decision Trees and Random Forests in Python Learnin...
amirziai/learning
algorithms/Merge-Sort.ipynb
mit
import random random.seed(0) from resources.utils import run_tests """ Explanation: Merge Sort Known to John von Neumann in 1945, 70+ years ago Step 0- Testing utilities Take a look at resources/utils.py if you're curious. End of explanation """ def split(input_list): """ Splits a list into two pieces :p...
NYUDataBootcamp/Projects
UG_S17/Wang-VIX.ipynb
mit
# Setup import sys # system module import pandas as pd # data package import matplotlib.pyplot as plt # graphics module import datetime as dt # date and time module import seaborn as sns # seaborn graphics module import os ...
networks-lab/mkD3
.ipynb_checkpoints/INTEG 120-checkpoint.ipynb
gpl-3.0
# Only run this the VERY first time !pip install metaknowledge !pip install networkx !pip install pandas !pip install python-louvain # Run this before you do anything else import metaknowledge as mk import networkx as nx import pandas import community import webbrowser """ Explanation: <center> <img src="http://netwo...
ledeprogram/algorithms
class7/homework/wang_zhizhou_7.ipynb
gpl-3.0
import pandas as pd %matplotlib inline from sklearn import datasets from pandas.tools.plotting import scatter_matrix import matplotlib.pyplot as plt from sklearn import tree iris = datasets.load_iris() x = iris.data[:,2:] y = iris.target plt.figure(2, figsize=(8, 6)) plt.scatter(x[:, 0], x[:, 1], c=y, cmap=plt.cm...
mne-tools/mne-tools.github.io
dev/_downloads/5bedf835c134d956a9b527dc8c5f488c/20_rejecting_bad_data.ipynb
bsd-3-clause
import os import mne sample_data_folder = mne.datasets.sample.data_path() sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', 'sample_audvis_filt-0-40_raw.fif') raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False) events_file = os.path.join(sample_data...
miqlar/PyFME
examples/examples-notebook/example_001.ipynb
mit
# -*- coding: utf-8 -*- """ Explanation: EXAMPLE 001 This is the first example o PyFME. The main purpose of this example is to check if the aircraft trimmed in a given state maintains the trimmed flight condition. The aircraft used is a Cessna 310, ISA1976 integrated with Flat Earth (euler angles). Example with trimme...
DTOcean/dtocean-core
notebooks/DTOcean Tidal Hydrodynamics + Database Example.ipynb
gpl-3.0
%matplotlib inline from IPython.display import display, HTML import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (14.0, 8.0) import numpy as np from dtocean_core import start_logging from dtocean_core.core import Core from dtocean_core.menu import DataMenu, ModuleMenu, ProjectMenu from dtocean_core.pip...
citxx/sis-python
crash-course/strings.ipynb
mit
s1 = "Строки можно задавать в двойных кавычках" s2 = 'А можно в одинарных' print(s1, type(s1)) print(s2, type(s2)) """ Explanation: <h1>Содержание<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Спецсимволы" data-toc-modified-id="Спецсимволы-1">Спецсимволы</a></span></li><li...
zomansud/coursera
ml-classification/week-3/module-5-decision-tree-assignment-1-blank.ipynb
mit
import graphlab graphlab.canvas.set_target('ipynb') """ Explanation: Identifying safe loans with decision trees The LendingClub is a peer-to-peer leading company that directly connects borrowers and potential lenders/investors. In this notebook, you will build a classification model to predict whether or not a loan pr...
knowledgeanyhow/notebooks
noaa/hdtadash/weather_dashboard.ipynb
mit
%matplotlib inline import os import struct import glob import pandas as pd import numpy as np import datetime as dt import matplotlib.pyplot as plt import seaborn as sns import folium from IPython.display import HTML from IPython.display import Javascript, display """ Explanation: NOAA Weather Analysis Frequency of D...
google/tf-quant-finance
tf_quant_finance/examples/jupyter_notebooks/Black_Scholes_Price_and_Implied_Vol.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
jamesjia94/BIDMach
tutorials/MLscalePart1.ipynb
bsd-3-clause
import BIDMat.{CMat,CSMat,DMat,Dict,IDict,Image,FMat,FND,GDMat,GMat,GIMat,GSDMat,GSMat,HMat,IMat,Mat,SMat,SBMat,SDMat} import BIDMat.MatFunctions._ import BIDMat.SciFunctions._ import BIDMat.Solvers._ import BIDMat.JPlotting._ import BIDMach.Learner import BIDMach.models.{FM,GLM,KMeans,KMeansw,ICA,LDA,LDAgibbs,Model,NM...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/miroc6/land.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'miroc6', 'land') """ Explanation: ES-DOC CMIP6 Model Properties - Land MIP Era: CMIP6 Institute: MIROC Source ID: MIROC6 Topic: Land Sub-Topics: Soil, Snow, Vegetation, Energy Balance, ...
romeokienzler/uhack
projects/bosch/ETLPython.ipynb
apache-2.0
import ibmos2spark # @hidden_cell credentials = { 'auth_url': 'https://identity.open.softlayer.com', 'project_id': '6aaf54352357483486ee2d4981f8ef15', 'region': 'dallas', 'user_id': 'b160340071b3407ca50c6b9a46b0bb25', 'username': 'member_b092a5c6f5c11f819059a83dfbd5d922b8a2299b', 'password': '...
QuantumDamage/AQIP
workspace/03-api.ipynb
apache-2.0
%matplotlib inline import requests from pandas.io.json import json_normalize import pandas as pd """ Explanation: Official documentation: http://powietrze.gios.gov.pl/pjp/content/api# End of explanation """ r = requests.get('http://api.gios.gov.pl/pjp-api/rest/station/findAll') allStations = json_normalize(r.json(...
LucaCanali/Miscellaneous
Spark_Physics/ATLAS_Higgs_opendata/H_ZZ_4l_analysis_basic_experiment_data.ipynb
apache-2.0
# Run this if you need to install Apache Spark (PySpark) # !pip install pyspark # Install sparkhistogram # Note: if you cannot install the package, create the computeHistogram # function as detailed at the end of this notebook. !pip install sparkhistogram # Run this to download the dataset # It is a small file (20...
buckleylab/Buckley_Lab_SIP_project_protocols
sequence_analysis_walkthrough/PIPITS_Fungal_ITS_Pipeline.ipynb
mit
import os # Provide the directory for your index and read files ITS = '/home/roli/FORESTs_BHAVYA/WoodsLake/raw_seq/ITS/' # Provide datasets = [['ITS',ITS,'ITS.metadata.pipits.Woods.tsv']] # Ensure your reads files are named accordingly (or modify to suit your needs) readFile1 = 'read1.fq.gz' readFile2 = 'read2.fq.g...
cleuton/datascience
datavisualization/data_visualization_python_2_english.ipynb
apache-2.0
import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d, Axes3D # Objects for 3D charts %matplotlib inline df = pd.read_csv('../datasets/evasao.csv') # School dropout data I collected df.head() """ Explanation: Data visualization with Python 2 - Data with more than 2 dimensions Cleu...
jamesorr/mocsy
notebooks/mocsy_errors.ipynb
mit
%%bash pwd mkdir code cd code git clone https://github.com/jamesorr/mocsy.git cd mocsy make pwd """ Explanation: Examples of propagating uncertainties in mocsy <hr> James Orr - 11 November 2018<br> <img align="left" width="60%" src="http://www.lsce.ipsl.fr/Css/img/banniere_LSCE_75.png" ><br><br> LSCE/IPSL, CEA-CNRS-UV...
mclaughlin6464/pearce
notebooks/Compute Shape Noise.ipynb
mit
from matplotlib import pyplot as plt %matplotlib inline #import seaborn as sns #sns.set() import matplotlib.colors as colors import numpy as np #from nbodykit.source.catalog.halos import HaloCatalog #from nbodykit.source.catalog.file import HDFCatalog #from nbodykit.cosmology import Cosmology #from nbodykit.algorithms...
pdh21/XID_plus
docs/notebooks/examples/XID+_example_pyvo_prior.ipynb
mit
fields = ['AKARI-NEP', 'AKARI-SEP', 'Bootes', 'CDFS-SWIRE', 'COSMOS', 'EGS', 'ELAIS-N1', 'ELAIS-N2', 'ELAIS-S1', 'GAMA-09', 'GAMA-12', 'GAMA-15', 'HDF-N', 'Herschel-Stripe-82', 'Lockman-SWIRE', 'NGP', 'SA13', 'SGP', 'SPIRE-NEP', 'SSDF', 'XMM-13hr', 'XMM-LSS', 'xFLS'] field_use = fields[6] print(f...
jseabold/statsmodels
examples/notebooks/theta-model.ipynb
bsd-3-clause
import numpy as np import pandas as pd import pandas_datareader as pdr import matplotlib.pyplot as plt import seaborn as sns plt.rc("figure",figsize=(16,8)) plt.rc("font",size=15) plt.rc("lines",linewidth=3) sns.set_style("darkgrid") """ Explanation: The Theta Model The Theta model of Assimakopoulos & Nikolopoulos (20...
bwinkel/cygrid
notebooks/04_sightline_gridding.ipynb
gpl-3.0
%load_ext autoreload %autoreload 2 %matplotlib inline %config InlineBackend.figure_format = 'retina' """ Explanation: Sightline gridding We demonstrate the gridding of selected sightlines with cygrid. This can be particularly useful if you have some high-resolution data such as QSO absorption spectra and want to get a...
geography-munich/sciprog
material/sub/jrjohansson/Lecture-7-Revision-Control-Software.ipynb
apache-2.0
from IPython.display import Image """ Explanation: Revision control software J.R. Johansson (jrjohansson at gmail.com) The latest version of this IPython notebook lecture is available at http://github.com/jrjohansson/scientific-python-lectures. The other notebooks in this lecture series are indexed at http://jrjohanss...
geilerloui/deep-learning
autoencoder/Convolutional_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) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
ibm-cds-labs/pixiedust
notebook/Intro to PixieDust.ipynb
apache-2.0
#!pip install --user --upgrade pixiedust """ Explanation: Hello PixieDust! This sample notebook provides you with an introduction to many features included in PixieDust. You can find more information about PixieDust at https://pixiedust.github.io/pixiedust/. To ensure you are running the latest version of PixieDust un...
jldinh/multicell
examples/05 - Gierer-Meinhardt.ipynb
mit
%matplotlib notebook """ Explanation: In this example, we will use Multicell to simulate the self-organization of a geometrical Turing pattern (Turing 1952; Note about other proposals and ways to produce spatial patterns), based on equations developed by Gierer and Meinhardt (Gierer and Meinhardt 1972). These equation...
atlury/deep-opencl
DL0110EN/4.3.3mist1layerassignmnt.ipynb
lgpl-3.0
import torch import torch.nn as nn import torchvision.transforms as transforms import torchvision.datasets as dsets import torch.nn.functional as F import matplotlib.pylab as plt import numpy as np """ Explanation: <div class="alert alert-block alert-info" style="margin-top: 20px"> <a href="http://cocl.us/pytorch_li...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/launching_into_ml/solutions/improve_data_quality.ipynb
apache-2.0
# Use the chown command to change the ownership of the repository to user !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst """ Explanation: Improving Data Quality Learning Objectives Resolve missing values Convert the Date feature column to a datetime format Rename a feature column, remove a value f...
tensorflow/tensorflow
tensorflow/lite/g3doc/models/convert/metadata_writer_tutorial.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
vsporeddy/bigbang
examples/Plot Activity.ipynb
gpl-2.0
%matplotlib inline """ Explanation: This notebook shows how BigBang can help you explore a mailing list archive. First, use this IPython magic to tell the notebook to display matplotlib graphics inline. This is a nice way to display results. End of explanation """ import bigbang.mailman as mailman import bigbang.gra...
qutip/qutip-notebooks
examples/energy-levels.ipynb
lgpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from numpy import pi from qutip import * """ Explanation: QuTiP example: Energy-levels of a quantum systems as a function of a single parameter J.R. Johansson and P.D. Nation For more information about QuTiP see http://qutip.org End of explanation...
fastai/fastai
dev_nbs/course/lesson3-planet.ipynb
apache-2.0
%matplotlib inline from fastai.vision.all import * from nbdev.showdoc import * """ Explanation: Multi-label prediction with Planet Amazon dataset End of explanation """ # ! {sys.executable} -m pip install kaggle --upgrade """ Explanation: Getting the data The planet dataset isn't available on the fastai dataset pa...