repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
muratcemkose/cy-rest-python | advanced/CytoscapeREST_KEGG_time_series.ipynb | mit | import json
import requests
import pandas as pd
PORT_NUMBER = 1234
BASE_URL = "http://localhost:" + str(PORT_NUMBER) + "/v1/"
HEADERS = {'Content-Type': 'application/json'}
"""
Explanation: Visualizing time series metabolome profile
by Kozo Nishida (Riken, Japan)
Software Requirments
Please install the following soft... |
scollis/scipy_2015 | example/test.ipynb | bsd-2-clause | import numpy as np
import pandas as pd
import pandas.io.data as pdd
from urllib import urlretrieve
%matplotlib inline
"""
Explanation: <img src="CA_logo.png" alt="Continuum Analytics" width="20%" align="right" border="4"><br><br><br><br>
Interactive Financial Analytics with Python & IPython
Tutorial with Examples bas... |
kubeflow/examples | natural-language-processing-with-disaster-tweets-kaggle-competition/natural-language-processing-with-disaster-tweets-kale.ipynb | apache-2.0 | pip install -r requirements.txt
"""
Explanation: Basic Intro
In this competition, you’re challenged to build a machine learning model that predicts which Tweets are about real disasters and which one’s aren’t.
What's in this kernel?
Basic EDA
Data Cleaning
Baseline Model
Unzipping the file
Importing required Librar... |
ctroupin/OceanData_NoteBooks | PythonNotebooks/PlatformPlots/plot_CMEMS_mooring.ipynb | gpl-3.0 | %matplotlib inline
import netCDF4
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import colors
from mpl_toolkits.basemap import Basemap
"""
Explanation: The objective of this notebook is to show how to read and plot data from a mooring (time series).
End of explanation
"""
... |
sthuggins/phys202-2015-work | assignments/assignment03/NumpyEx02.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 2
Imports
End of explanation
"""
def np_fact(n):
"""Compute n! = n*(n-1)*...*1 using Numpy."""
np_fact.arange()
np_fact.cumprod()
assert np_fact(0)==1
assert np_fact(1)=... |
skkandrach/foundations-homework | Homework_8_DIY_Soma.ipynb | mit | import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df= pd.read_excel("NHL 2014-15.xls")
!pip install xlrd
df.columns.value_counts()
"""
Explanation: 2016 NHL Hockey Data Set - Sasha Kandrach
End of explanation
"""
df.head()
"""
Explanation: Here's all of our data:
End of explanation
"""
... |
robin-vjc/nsopy | notebooks/AnalyticalExample.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib notebook
%cd ..
"""
Explanation: nsopy: basic usage examples
Generally, the inputs required are
a first-order oracle of the problem: for a given $x_k \in \mathbb{X} \subseteq \mathbb{R}^n$, it returns $f(x_k)$ and ... |
NekuSakuraba/my_capstone_research | subjects/Multivariate t-distribution.ipynb | mit | from numpy.linalg import inv
import numpy as np
from math import pi, sqrt, gamma
from scipy.stats import t
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: https://stackoverflow.com/questions/29798795/multivariate-student-t-distribution-with-python
https://docs.scipy.org/doc/scipy-0.19.0/reference/... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/supplemental_gradient_boosting/c_boosted_trees_model_understanding.ipynb | apache-2.0 | import time
# We will use some np and pandas for dealing with input data.
import numpy as np
import pandas as pd
# And of course, we need tensorflow.
import tensorflow as tf
from matplotlib import pyplot as plt
from IPython.display import clear_output
tf.__version__
"""
Explanation: Model understanding and interpre... |
google-research/proteinfer | colabs/Random_EC.ipynb | apache-2.0 | %tensorflow_version 1
!git clone https://github.com/google-research/proteinfer
%cd proteinfer
!pip3 install -qr requirements.txt
import pandas as pd
import tensorflow
import inference
import parenthood_lib
import baseline_utils,subprocess
import shlex
import tqdm
import sklearn
import numpy as np
import utils
im... |
Xero-Hige/Notebooks | Algoritmos I/2018-1C/Parcialito_1_Resolucion_Propuesta.ipynb | gpl-3.0 | def mi_otra_funcion(inicio,final):
for i in range(inicio,final+1,2):
for j in range(inicio,final+1,2):
print(i,end=" ")
print()
mi_otra_funcion(3,7)
"""
Explanation: Parcialito 1 (Solucion propuesta)
Ejercicio 1
Enunciado
1) Dada la siguiente función:
``` python
def mi_funcion(p,q):
... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/05_review/labs/5_train.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 AI Platform
TFVERSION = "1.14" # TF version for CAIP to use
import os
os.environ["BUCKET"] = BUCKET
os.envir... |
ES-DOC/esdoc-jupyterhub | notebooks/nasa-giss/cmip6/models/sandbox-2/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nasa-giss', 'sandbox-2', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NASA-GISS
Source ID: SANDBOX-2
Topic: Ocean
Sub-Topics: Timestepping Framework,... |
bioe-ml-w18/bioe-ml-winter2018 | homeworks/SVMs-example.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# use seaborn plotting defaults
import seaborn as sns; sns.set()
"""
Explanation: This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content is available on GitHub. The text is re... |
prashantas/MyDataScience | PandasPractice.ipynb | bsd-2-clause | import numpy as np
import pandas as pd
labels = ['a','b','c']
my_data = [10,20,30]
arr = np.array(my_data)
d = {'a':10,'b':20,'c':30}
print ("Labels:", labels)
print("My data:", my_data)
print("Dictionary:", d)
"""
Explanation: Pandas Practice
Series
Loading packages and initializations
End of explanation
"""
pd.S... |
AllenDowney/ThinkBayes2 | examples/skeet2.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import classes from thinkbayes2
from thinkbayes2 import Hist, Pmf, Suite, Beta
import thinkplot
import... |
jamesjia94/BIDMach | tutorials/NVIDIA/.ipynb_checkpoints/CreateNets-checkpoint.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... |
linhbngo/cpsc-4770_6770 | 05-intro-to-mpi.ipynb | gpl-3.0 | %%writefile codes/openmpi/first.c
#include <stdio.h>
#include <sys/utsname.h>
#include <mpi.h>
int main(int argc, char *argv[]){
MPI_Init(&argc, &argv);
struct utsname uts;
uname (&uts);
printf("My process is on node %s.\n", uts.nodename);
MPI_Finalize();
return 0;
}
!mpicc codes/openmpi/first.c -o ~/first... |
muku42/bokeh | examples/interactions/interactive_bubble/gapminder.ipynb | bsd-3-clause | fertility_df, life_expectancy_df, population_df_size, regions_df, years, regions = process_data()
sources = {}
region_color = regions_df['region_color']
region_color.name = 'region_color'
for year in years:
fertility = fertility_df[year]
fertility.name = 'fertility'
life = life_expectancy_df[year]
li... |
musketeer191/job_analytics | .ipynb_checkpoints/feat_extract-checkpoint.ipynb | gpl-3.0 | doc_skill = buildDocSkillMat(jd_docs, skill_df, folder=SKILL_DIR)
with(open(SKILL_DIR + 'doc_skill.mtx', 'w')) as f:
mmwrite(f, doc_skill)
"""
Explanation: Build feature matrix
The matrix is a JD-Skill matrix where each entry $e(d, s)$ is the number of times skill $s$ occurs in job description $d$.
End of explana... |
sdpython/ensae_teaching_cs | _doc/notebooks/exams/td_note_2017_2.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.e - TD noté, 21 février 2017
Solution du TD noté, celui-ci présente un algorithme pour calculer les coefficients d'une régression quantile et par extension d'une médiane dans un espace à plusieurs dimensions.
End of explanation
"""
i... |
NEONScience/NEON-Data-Skills | tutorials/Python/Hyperspectral/uncertainty-and-validation/hyperspectral_variation_py/hyperspectral_variation_py.ipynb | agpl-3.0 | import h5py
import csv
import numpy as np
import os
import gdal
import matplotlib.pyplot as plt
import sys
from math import floor
import time
import warnings
warnings.filterwarnings('ignore')
def h5refl2array(h5_filename):
hdf5_file = h5py.File(h5_filename,'r')
#Get the site name
file_attrs_string = str(l... |
msultan/msmbuilder | examples/Fs-Peptide-command-line.ipynb | lgpl-2.1 | # Work in a temporary directory
import tempfile
import os
os.chdir(tempfile.mkdtemp())
# Since this is running from an IPython notebook,
# we prefix all our commands with "!"
# When running on the command line, omit the leading "!"
! msmb -h
"""
Explanation: Modeling dynamics of FS Peptide
This example shows a typica... |
etendue/deep-learning | language-translation/dlnd_language_translation.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... |
sheikhomar/ml | scikit-learn.ipynb | mit | import numpy as np
"""
Explanation: Scikit-Learn
scikit-learn is a Python library that provides many machine learning algorithms via a consistent API known as the estimator.
End of explanation
"""
from sklearn.model_selection import train_test_split
# Let X be our input data consisting of
# 5 samples and 2 features... |
jhjungCode/pytorch-tutorial | 01_Variables.ipynb | mit | import torch
a = torch.Tensor([1])
b = torch.Tensor([2])
print(a+b)
"""
Explanation: "1 더하기 2는?" 부터 시작하기
사실 누구나 다 아는 "hello world"부터 시작하고 싶었지만, 기본(주로사용하는) 변수가 정수나 실수라고 생각하시면 됩니다.
그래서 "1 + 2"를 계산하는 코드를 만들도록 하겠습니다.
End of explanation
"""
import torch
a = torch.Tensor([1, 1, 1])
b = torch.Tensor([2, 3, 4])
print(a+... |
jtwhite79/pyemu | verification/Freyberg/.ipynb_checkpoints/verify_null_space_proj-checkpoint.ipynb | bsd-3-clause | %matplotlib inline
import os
import shutil
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pyemu
"""
Explanation: verify pyEMU null space projection with the freyberg problem
End of explanation
"""
mc = pyemu.MonteCarlo(jco="freyberg.jcb",verbose=False,forecasts=[])
mc.drop_prior_inform... |
ES-DOC/esdoc-jupyterhub | notebooks/mohc/cmip6/models/ukesm1-0-mmh/aerosol.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mohc', 'ukesm1-0-mmh', 'aerosol')
"""
Explanation: ES-DOC CMIP6 Model Properties - Aerosol
MIP Era: CMIP6
Institute: MOHC
Source ID: UKESM1-0-MMH
Topic: Aerosol
Sub-Topics: Transport, Emissions,... |
sfomel/ipython | Qingdao.ipynb | gpl-2.0 | from m8r import view
view('data')
"""
Explanation: Section
List
One
Two
Link: See Madagascar
Explanation for the modeling part
We create a model in time-velocity space $(t_0,v)$, then we model data by spreading in time-diatance space $(t,x)$ over hyperbolas $t(x) = \sqrt{t_0^2 + \frac{x^2}{v^2}}$.
End of explanatio... |
mayank-johri/LearnSeleniumUsingPython | Section 1 - Core Python/Chapter 08 - Modules/Chapter8_Modules.ipynb | gpl-3.0 | import os
def get_os_details():
print(os.name)
print(type(os.name))
print(os.path.abspath(os.path.curdir))
get_os_details()
"""
Explanation: Modules
A module is a file/directory containing Python definitions and statements.
In Python, modules are python files which can be imported into a program. They c... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Data-Capstone-Projects/911 Calls Data Capstone Project - Solutions.ipynb | mit | import numpy as np
import pandas as pd
"""
Explanation: 911 Calls Capstone Project - Solutions
For this capstone project we will be analyzing some 911 call data from Kaggle. The data contains the following fields:
lat : String variable, Latitude
lng: String variable, Longitude
desc: String variable, Description of th... |
azhurb/deep-learning | reinforcement/Q-learning-cart.ipynb | mit | import gym
import tensorflow as tf
import numpy as np
"""
Explanation: Deep Q-learning
In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use Q-learning to train an agent to play a game called Cart-Pole. In this game, a freely swinging p... |
wbinventor/openmc | examples/jupyter/mdgxs-part-ii.ipynb | mit | %matplotlib inline
import math
import matplotlib.pyplot as plt
import numpy as np
import openmc
import openmc.mgxs
"""
Explanation: This IPython Notebook illustrates the use of the openmc.mgxs.Library class. The Library class is designed to automate the calculation of multi-group cross sections for use cases with on... |
psas/liquid-engine-analysis | Simulation_and_Optimization/Launcher_Settings_Optimization.ipynb | gpl-3.0 | # all of our comparisons are ratios instead of subtractions because
# it's normalized, instead of dependent on magnitudes of variables and constraints
def objective_additive(var, cons):
return np.linalg.norm(var - cons)**2 / 2
# minimize this, **2 makes it well behaved w.r.t. when var=cons
def objective(var, cons... |
eusebioaguilera/scalablemachinelearning | Lab02/ML_lab2_word_count_student.ipynb | gpl-3.0 | labVersion = 'cs190_week2_word_count_v_1_0'
"""
Explanation: +
Word Count Lab: Building a word count application
This lab will build on the techniques covered in the Spark tutorial to develop a simple word count application. The volume of unstructured text in existence is growing dramatically, and Spark is an excell... |
mirjalil/DataScience | bigdata-platforms/pyspark-get-started.ipynb | gpl-2.0 | from pyspark import SparkContext
sc = SparkContext()
int_RDD = sc.parallelize(range(10), 3)
int_RDD
int_RDD.collect()
int_RDD.glom().collect()
"""
Explanation: PySpark for Data Analysis
Different ways of creating RDD
parallelize
read data from file
apply transformation to some existing RDDs
Basic Operations
End... |
amitkaps/machine-learning | cf_mba/notebook/1. Collaborative Filtering.ipynb | mit | #Import libraries
import pandas as pd
from scipy.spatial.distance import cosine
data = pd.read_csv("../data/groceries.csv")
data.head(100)
#Assume that for all items only one quantity was bought
"""
Explanation: Collaborative Filtering
Item Based: which takes similarities between items’ consumption histories
User ... |
philmui/datascience2016fall | lecture02.ingestion/lecture02.ingestion.ipynb | mit | from __future__ import print_function
import csv
my_reader = csv.DictReader(open('data/eu_revolving_loans.csv', 'r'))
"""
Explanation: Lecture 01 : intro, inputs, numpy, pandas
1. Inputs: CSV / Text
We will start by ingesting plain text.
End of explanation
"""
for line in my_reader:
print(line)
"""
Explanatio... |
nate-d-olson/micro_rm_dev | dev/.ipynb_checkpoints/notebook_2014_12_12-checkpoint.ipynb | gpl-2.0 | %%bash
java -Xmx4G -jar ../utilities/pilon-1.10.jar \
--genome ../data/RM8375/ref/CFSAN008157.HGAP.fasta \
--frags ../analysis/bioinf/sequence_purity/mapping/SRR1555296.bam \
--changes --vcf --tracks \
--fix "all" --debug #note --fix "all" default
"""
Exp... |
ljo/collatex-tutorial | unit5/CollateX and XML, Part 2.ipynb | gpl-3.0 | from collatex import *
from lxml import etree
import json,re
"""
Explanation: CollateX and XML, Part 2
David J. Birnbaum (djbpitt@gmail.com, http://www.obdurodon.org), 2015-06-29
This example collates a single line of XML from four witnes... |
batfish/pybatfish | docs/source/notebooks/filters.ipynb | apache-2.0 | bf.set_network('generate_questions')
bf.set_snapshot('generate_questions')
"""
Explanation: Access-lists and firewall rules
This category of questions allows you to analyze the behavior of access
control lists and firewall rules. It also allows you to comprehensively
validate (aka verification) that some traffic is o... |
LSSTDESC/Monitor | examples/depth_curve_example.ipynb | bsd-3-clause | import desc.monitor
import matplotlib.pyplot as plt
%matplotlib inline
%load_ext autoreload
%autoreload 2
"""
Explanation: Measuring 5-sigma Depth Curves
In this notebook we will extract an object light curve from the Twinkles field, and measure the 5-sigma limiting depth at each epoch. The reason to do this is to sta... |
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | doc/notebooks/automaton.is_coaccessible.ipynb | gpl-3.0 | import vcsn
"""
Explanation: automaton.is_coaccessible
Whether all its states are coaccessible, i.e., its transposed automaton is accessible, in other words, all its states cab reach a final state.
Preconditions:
- None
See also:
- automaton.coaccessible
- automaton.is_accessible
- automaton.trim
Examples
End of expla... |
ccwang002/play_aiohttp | 1_demo.ipynb | mit | @asyncio.coroutine
def quote_simple(url='http://localhost:5566/quote/uniform', slow=False):
r = yield from aiohttp.request(
'GET', url, params={'slow': True} if slow else {}
)
if r.status != 200:
logger.error('Unsuccessful response [Status: %s (%d)]'
% (r.reason, r.stat... |
mattilyra/gensim | docs/notebooks/WMD_tutorial.ipynb | lgpl-2.1 | from time import time
start_nb = time()
# Initialize logging.
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s')
sentence_obama = 'Obama speaks to the media in Illinois'
sentence_president = 'The president greets the press in Chicago'
sentence_obama = sentence_obama.lower().split()... |
regardscitoyens/consultation_an | exploitation/analyse_quanti_theme5.ipynb | agpl-3.0 | def loadContributions(file, withsexe=False):
contributions = pd.read_json(path_or_buf=file, orient="columns")
rows = [];
rindex = [];
for i in range(0, contributions.shape[0]):
row = {};
row['id'] = contributions['id'][i]
rindex.append(contributions['id'][i])
if (withsexe... |
tanghaibao/goatools | notebooks/background_genes_ncbi.ipynb | bsd-2-clause | from goatools.cli.ncbi_gene_results_to_python import ncbi_tsv_to_py
ncbi_tsv = 'gene_result.txt'
output_py = 'genes_ncbi_10090_proteincoding.py'
ncbi_tsv_to_py(ncbi_tsv, output_py)
"""
Explanation: How to download background genes from NCBI
Example
1) Download mouse (TaxID=10090) protein-coding genes
Query NCBI Gene... |
mcamack/Jupyter-Notebooks | tensorflow/tensorflow101.ipynb | apache-2.0 | import tensorflow as tf
"""
Explanation: TensorFlow
References:
* TensorFlow Getting Started
* Tensor Ranks, Shapes, and Types
Overview
TensorFlow has multiple APIs:
* TensorFlow Core: lowest level, complete control, fine tuning capabilities
* Higher Level APIs: easier to learn, abstracted. (example: tf.estimator help... |
YuriyGuts/kaggle-quora-question-pairs | notebooks/feature-oofp-nn-mlp-with-magic.ipynb | mit | from pygoose import *
import gc
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import *
from keras import backend as K
from keras.models import Model, Sequential
from keras.layers import *
from keras.optimizers import *
from keras.callbacks i... |
jmhummel/IMDb-predictive-analytics | src/notebook.ipynb | mit | # data analysis and wrangling
import pandas as pd
import numpy as np
import random as rnd
from scipy.stats import truncnorm
# visualization
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
# machine learning
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC, Linea... |
GoogleCloudPlatform/vertex-ai-samples | notebooks/community/gapic/automl/showcase_automl_tabular_classification_online_explain.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: AutoML tabular classification model for online prediction with expla... |
khalido/nd101 | sentiment_network/Sentiment Classification - Project 3 Solution.ipynb | gpl-3.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()... |
xesscorp/myhdlpeek | examples/peeker_tables.ipynb | mit | from myhdl import *
from myhdlpeek import Peeker # Import the myhdlpeeker module.
def mux(z, a, b, sel):
"""A simple multiplexer."""
@always_comb
def mux_logic():
if sel == 1:
z.next = a # Signal a sent to mux output when sel is high.
else:
z.next = b # Signal b s... |
mikekestemont/wuerzb15 | Chapter 2 - Stepping up with SciPy.ipynb | mit | import scipy as sp
"""
Explanation: Chapter 2 - Stepping up with SciPy
Numpy is a powerful, yet very basic library, which can be a little abstract to introduce -- and a little tedious to practice. To perform more interesting things to Numpy matrices, we now turn to a number of interesting libraries, which have been bu... |
pgmpy/pgmpy_notebook | notebooks/2. Bayesian Networks.ipynb | mit | from IPython.display import Image
"""
Explanation: Bayesian Network
End of explanation
"""
Image('../images/2/student_full_param.png')
"""
Explanation: Bayesian Models
What are Bayesian Models
Independencies in Bayesian Networks
How is Bayesian Model encoding the Joint Distribution
How we do inference from Bayesia... |
bloomberg/bqplot | examples/Tutorials/Object Model.ipynb | apache-2.0 | from bqplot import (
LinearScale,
Axis,
Figure,
OrdinalScale,
LinearScale,
Bars,
Lines,
Scatter,
)
# first, let's create two vectors x and y to plot using a Lines mark
import numpy as np
x = np.linspace(-10, 10, 100)
y = np.sin(x)
# 1. Create the scales
xs = LinearScale()
ys = LinearS... |
mne-tools/mne-tools.github.io | 0.19/_downloads/defd59f40a19378fba659a70b6f1ec76/plot_sensors_decoding.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import mne
from mne.datasets import sample
from mne.decoding import (SlidingEstimator, GeneralizingEstimator, Scaler,
... |
spacecowboy/article-annriskgroups-source | AnnGroups.ipynb | gpl-3.0 | # import stuffs
%matplotlib inline
import numpy as np
import pandas as pd
from pyplotthemes import get_savefig, classictheme as plt
plt.latex = True
"""
Explanation: AnnGroups
This is just a test script to verify that the ANN code works as expected. It also serves as an example
for the usage.
It is NOT used for result... |
tensorflow/docs-l10n | site/en-snapshot/io/tutorials/bigtable.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/vertex-ai-samples | notebooks/community/migration/UJ6 legacy AutoML Natural Language Text Classification.ipynb | apache-2.0 | ! pip3 install google-cloud-automl
"""
Explanation: AutoML natural language text classification model
Installation
Install the latest version of AutoML SDK.
End of explanation
"""
! pip3 install google-cloud-storage
"""
Explanation: Install the Google cloud-storage library as well.
End of explanation
"""
import o... |
erdewit/ib_insync | notebooks/basics.ipynb | bsd-2-clause | import ib_insync
print(ib_insync.__all__)
"""
Explanation: Basics
Let's first take a look at what's inside the ib_insync package:
End of explanation
"""
from ib_insync import *
util.startLoop()
"""
Explanation: Importing
The following two lines are used at the top of all notebooks. The first line imports everything... |
mne-tools/mne-tools.github.io | 0.20/_downloads/a0b8e095ddf79d437494061b36af56fb/plot_resolution_metrics.ipynb | bsd-3-clause | # Author: Olaf Hauk <olaf.hauk@mrc-cbu.cam.ac.uk>
#
# License: BSD (3-clause)
import mne
from mne.datasets import sample
from mne.minimum_norm import make_inverse_resolution_matrix
from mne.minimum_norm import resolution_metrics
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects/'
fn... |
DS-100/sp17-materials | sp17/labs/lab03/lab03.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import seaborn as sns
%matplotlib inline
import matplotlib.pyplot as plt
# These lines load the tests.
!pip install -U okpy
from client.api.notebook import Notebook
ok = Notebook('lab03.ok')
"""
Explanation: Lab 3: Intro to Visualizations
Authors: Sam Lau, Deb Nolan
Due 11:59pm ... |
letsgoexploring/teaching | winter2017/econ129/python/Econ129_Winter2017_Homework2.ipynb | mit | # Question 1
"""
Explanation: Homework 2 (DUE: Thursday February 16)
Instructions: Complete the instructions in this notebook. You may work together with other students in the class and you may take full advantage of any internet resources available. You must provide thorough comments in your code so that it's clear... |
cathalmccabe/PYNQ | boards/Pynq-Z1/base/notebooks/video/hdmi_video_pipeline.ipynb | bsd-3-clause | from pynq.overlays.base import BaseOverlay
from pynq.lib.video import *
base = BaseOverlay("base.bit")
"""
Explanation: Video Pipeline Details
This notebook goes into detail about the stages of the video pipeline in the base overlay and is written for people who want to create and integrate their own video IP. For mo... |
ljvmiranda921/pyswarms | docs/examples/usecases/train_neural_network.ipynb | mit | # Import modules
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
# Import PySwarms
import pyswarms as ps
# Some more magic so that the notebook will reload external python modules;
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext au... |
quantumfx/binary-lens | oldcode/lens_simulation_gauss_pulse.ipynb | gpl-3.0 | res = 10000 # 1 sample is 1/res*1.6ms, 1e7 to resolve 311Mhz
n = 40 * res # grid size, total time
n = n-1 # To get the wave periodicity edge effects to work out
#freq = 311.25 # MHz, observed band
freq = 0.5 # Test, easier on computation
p_spin = 1.6 # ms, spin period
freq *= 1e6 #MHz to Hz
p_spin *= 1e-3 #ms to s
p... |
machlearn/ipython-notebooks | ML Process - Preprocessing.ipynb | mit | from sklearn import preprocessing
import numpy as np
X = np.array([[1.,-1.,2.],
[2., 0.,0.],
[0., 1.,-1.]])
X_scaled = preprocessing.scale(X)
X_scaled
X_scaled.mean(axis = 0)
X_scaled.std(axis=0)
"""
Explanation: Package: sklearn.preprocessing
change raw feature vectors into a representa... |
gabrielelanaro/chemview | notebooks/QuickStart.ipynb | lgpl-2.1 | from chemview import MolecularViewer
"""
Explanation: To import chemview you can write and execute the following code in a cell:
End of explanation
"""
import numpy as np
coordinates = np.array([[0.00, 0.13, 0.00], [0.12, 0.07, 0.00], [0.12,-0.07, 0.00],
[0.00,-0.14, 0.00], [-0.12,-0.07, 0.00]... |
vitojph/2016progpln | notebooks/9-tweepy.ipynb | mit | import tweepy
# añade las credenciales de tu aplicación de twitter como cadenas de texto
CONSUMER_KEY = 'CAMBIA ESTO'
CONSUMER_SECRET = 'CAMBIA ESTO'
ACCESS_TOKEN = 'CAMBIA ESTO'
ACCESS_TOKEN_SECRET = 'CAMBIA ESTO'
# autentica las credenciales
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access... |
ES-DOC/esdoc-jupyterhub | notebooks/niwa/cmip6/models/ukesm1-0-ll/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'niwa', 'ukesm1-0-ll', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NIWA
Source ID: UKESM1-0-LL
Topic: Ocnbgchem
Sub-Topics: Tracers.
Propert... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/structured/solutions/1b_prepare_data_babyweight.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: LAB 1b: Prepare babyweight dataset.
Learning Objectives
Setup up the environment
Preprocess natality dataset
Augment natality dataset
Create the train and eval tables in BigQuery
Ex... |
ozorich/phys202-2015-work | assignments/assignment06/InteractEx05.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.html.widgets import interact, interactive, fixed
from IPython.display import display
from IPython.display import SVG
"""
Explanation: Interact Exercise 5
Imports
Put the standard imports for Matplotlib, Numpy and the IPython widgets in ... |
wasit7/tutorials | notebooks/ipcluster.ipynb | mit | from IPython import parallel
c=parallel.Client()
dview=c.direct_view()
dview.block=True
"""
Explanation: IPython.parallel
To start the cluster, you can use notebook GUI or command line $ipcluster start
End of explanation
"""
c.ids
"""
Explanation: Check a number of cores
End of explanation
"""
import numpy as np
... |
probml/pyprobml | notebooks/book2/28/poisson_lds_example.ipynb | mit |
!pip install -qq git+git://github.com/lindermanlab/ssm-jax-refactor.git
try:
import ssm
except ModuleNotFoundError:
%pip install -qq ssm
import ssm
"""
Explanation: <a href="https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/poisson_lds_example.ipynb" target="_parent"><... |
KiranArun/A-Level_Maths | Differentiation/Differentiation.ipynb | mit | # With all python examples, beware that python can't handle numbers too small so some results will be inaccurate
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Differentiation
End of explanation
"""
def f(x): # sample function
return x**2
# graph data arrays
x = np.linspace(-10,10,210)
y = ... |
gte620v/PythonTutorialWithJupyter | exercises/Ex1-Dice_Simulation_empty.ipynb | mit | import random
def single_die():
"""Outcome of a single die roll"""
pass
"""
Explanation: Dice Simulaiton
In this excercise, we want to simulate the outcome of rolling dice. We will walk through several levels of building up funcitonality.
Single Die
Let's create a function that will return a random value bet... |
afunTW/dsc-crawling | appendix_ptt/03_crawl_image.ipynb | apache-2.0 | import requests
import re
import json
import os
from PIL import Image
from bs4 import BeautifulSoup, NavigableString
from pprint import pprint
ARTICLE_URL = 'https://www.ptt.cc/bbs/Gossiping/M.1538373690.A.72D.html'
"""
Explanation: 爬取文章上的內文的所有文章
你有可能會遇到「是否滿18歲」的詢問頁面
解析 ptt.cc/bbs 裏面文章的結構
爬取文章
解析並確認圖片格式
下載圖片
URL h... |
google/starthinker | colabs/ga_timeline.ipynb | apache-2.0 | !pip install git+https://github.com/google/starthinker
"""
Explanation: 1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
End of explanation
"""
CLOUD_PROJECT = 'PASTE PROJECT ID HERE'
print("Cloud Project Set To: %s" % CLOUD_PROJECT)
... |
amueller/odscon-sf-2015 | 06 - Working With Text Data.ipynb | cc0-1.0 | #! tar -xf data/aclImdb.tar.bz2 --directory data
from sklearn.datasets import load_files
reviews_train = load_files("data/aclImdb/train/")
text_train, y_train = reviews_train.data, reviews_train.target
print("Number of documents in training data: %d" % len(text_train))
print(np.bincount(y_train))
reviews_test = loa... |
ARM-software/lisa | ipynb/deprecated/examples/energy_meter/EnergyMeter_Gem5.ipynb | apache-2.0 | from conf import LisaLogging
LisaLogging.setup()
# One initial cell for imports
import json
import logging
import os
from env import TestEnv
# Suport for FTrace events parsing and visualization
import trappy
from trappy.ftrace import FTrace
from trace import Trace
# Support for plotting
# Generate plots inline
%mat... |
shinys825/lc_project | codes/LC_DataFrame(Cleaning)_descrete Variable.ipynb | mit | lc_data = pd.DataFrame.from_csv('./lc_dataframe(cleaning).csv')
lc_data = lc_data.reset_index()
lc_data.tail()
"""
Explanation: Pandas DataFrame
End of explanation
"""
x = lc_data['grade']
sns.distplot(x, color = 'r')
plt.show()
"""
Explanation: V4 grade (범주형 데이터형)
LC assigned loan grade
A,B,C,D,E,F,G = {1, 2, 3, 4... |
jay-johnson/sci-pype | red10/Red10-SPY-Multi-Model-Price-Forecast.ipynb | apache-2.0 | from __future__ import print_function
import sys, os, requests, json, datetime
# Load the environment and login the user
from src.common.load_redten_ipython_env import user_token, user_login, csv_file, run_job, core, api_urls, ppj, rt_url, rt_user, rt_pass, rt_email, lg, good, boom, anmt, mark, ppj, uni_key, rest_logi... |
saashimi/code_guild | wk9/notebooks/.ipynb_checkpoints/ch4.What Are We Doing With All These Tests?-checkpoint.ipynb | mit | %cd ../testing/superlists/
!python3 functional_tests.py
"""
Explanation: Using Selenium to Test User Interactions
Where were we at the end of the last chapter? Let’s rerun the test and find out:
End of explanation
"""
%%writefile functional_tests.py
from selenium import webdriver
from selenium.webdriver.common.key... |
kambysese/mnefun | examples/funloc/mnefun-demo.ipynb | bsd-3-clause | import mnefun
from score import score
import numpy as np
try:
# Use niprov as handler for events if it's installed
from niprov.mnefunsupport import handler
except ImportError:
handler = None
"""
Explanation: Funloc experiment
The experiment was a simple audio/visual oddball detection task. One
potential p... |
gansanay/datascience-theoryinpractice | statistics-theoryinpractice/01_DiscreteProbabilityDistributions.ipynb | mit | N = 6
xk = np.arange(1,N+1)
fig, ax = plt.subplots(1, 1)
ax.plot(xk, sps.randint.pmf(xk, xk[0], 1+xk[-1]), 'ro', ms=12, mec='r')
ax.vlines(xk, 0, sps.randint.pmf(xk, xk[0], 1+xk[-1]), colors='r', lw=4)
plt.show()
"""
Explanation: Discrete probability distributions
Rigorous definitions of discrete probability laws and ... |
graemeglass/pandas-intro | pandas-intro.ipynb | apache-2.0 | from IPython.display import Image
Image(url='panda1.jpg')
"""
Explanation: Intro to Pandas
http://pandas.pydata.org/
End of explanation
"""
import pandas as pd
# a scalar value
pd.Series(1)
a = pd.Series([1,2,3,6,7,9])
print(a)
# Accessing elements
# Index look up, Element 0th, 1st element
print(a[0])
# Using a ma... |
radicalrafi/radicalrafi.github.io | posts/Deep_Learning_Scribbling_I_Deep_Learning_Frameworks.ipynb | mit | # KERAS SEQUENTIAL EXAMPLE FOR CLASSIFICATIOn
from keras import models,layers,datasets
(x_train,y_train),(x_test,y_test) = datasets.mnist.load_data()
import numpy as np
from keras import utils
y_test = utils.to_categorical(y_test)
y_train = utils.to_categorical(y_train)
# NORMALIZE THE DATA
def normalizer(x):
... |
PythonFreeCourse/Notebooks | week01/4_Variables.ipynb | mit | print(3.14159265358 * 5 * 5 * 2)
"""
Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית.">
<p style... |
xpharry/Udacity-DLFoudation | tutorials/sentiment_network/Sentiment Classification - Mini Project 2.ipynb | mit | 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()... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepping Framework, Advection... |
Kismuz/btgym | examples/data_domain_api_intro.ipynb | lgpl-3.0 | # Make data domain - top-level data structure:
domain = BTgymRandomDataDomain(
filename='../examples/data/DAT_ASCII_EURUSD_M1_2016.csv',
target_period={'days': 50, 'hours': 0, 'minutes': 0}, # use last 50 days of one year data as 'target domain'
# so w... |
AllenDowney/ModSimPy | soln/chap11soln.ipynb | mit | # Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
# import functions from the modsim.py module
from modsim import *
"""
Explanation: Modeling and Simulati... |
AaronCWong/phys202-2015-work | assignments/assignment03/NumpyEx04.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 4
Imports
End of explanation
"""
import networkx as nx
K_5=nx.complete_graph(5)
nx.draw(K_5)
"""
Explanation: Complete graph Laplacian
In discrete mathematics a Graph is a set of vertices or n... |
numerical-mooc/assignment-bank-2015 | cdigangi8/Managing_Epidemics_Model.ipynb | mit | %matplotlib inline
import numpy
from matplotlib import pyplot
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 16
"""
Explanation: Copyright (c)2015 DiGangi, C.
Managing Epidemics Through Mathematical Modeling
This lesson will examine the spread of an epidemic over time using ... |
Neuroglycerin/neukrill-net-work | notebooks/3 convolutional layers (96-96-48 channels) 2 fully connected (512-512 units).ipynb | mit | print('## Model structure summary\n')
print(model)
params = model.get_params()
n_params = {p.name : p.get_value().size for p in params}
total_params = sum(n_params.values())
print('\n## Number of parameters\n')
print(' ' + '\n '.join(['{0} : {1} ({2:.1f}%)'.format(k, v, 100.*v/total_params)
... |
amcdawes/QMlabs | Chapter 1 - Mathematical Preliminaries.ipynb | mit | import matplotlib.pyplot as plt
from numpy import array, sin, sqrt, dot, outer
%matplotlib inline
"""
Explanation: Chapter 1
An introduction to the Jupyter Notebook and some practice with probability ideas from Chapter 1.
1.1 Probability
1.1.1 Moments of Measured Data
The Jupyter Notebook has two primary types of cell... |
rtidatascience/connected-nx-tutorial | notebooks/3. Visualizing Graphs.ipynb | mit | import networkx as nx
import matplotlib.pyplot as plt
%matplotlib inline
GA = nx.read_gexf('../data/ga_graph.gexf')
print(nx.info(GA))
"""
Explanation: Visualizing Graphs
Basic NetworkX & Matplotlib (nx.draw)
Detailed Plotting w/ Networkx & Matplotlib
Plotting attributes
<center><img src="https://i2.wp.com/flowin... |
sempwn/ABCPRC | Tutorial_Epidemiology.ipynb | mit | %matplotlib inline
import ABCPRC as prc
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
"""
Explanation: ABC PRC Tutorial
In this tutorial we will be constructing our own individual-based model and performing model fitting on the resulting summary statistics it produces.
End of explanati... |
mit-crpg/openmc | examples/jupyter/triso.ipynb | mit | %matplotlib inline
from math import pi
import numpy as np
import matplotlib.pyplot as plt
import openmc
import openmc.model
"""
Explanation: Modeling TRISO Particles
OpenMC includes a few convenience functions for generationing TRISO particle locations and placing them in a lattice. To be clear, this capability is not... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.