repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
BinRoot/TensorFlow-Book
ch09_cnn/Concept03_cnn.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import cifar_tools import tensorflow as tf learning_rate = 0.001 names, data, labels = \ cifar_tools.read_data('./cifar-10-batches-py') """ Explanation: Ch 09: Concept 03 Convolution Neural Network Load data from CIFAR-10. End of explanation """ x = tf.place...
ueapy/enveast_python_course_materials
Day_1/04-Semantics-Operators.ipynb
mit
# addition, subtraction, multiplication (4 + 8) * (6.5 - 3) # True division print(11 / 2) # Floor division print(11 // 2) """ Explanation: Basic Python Semantics: Operators Arithmetic Operations | Operator | Name | Description | |--------------|---------------...
tpin3694/tpin3694.github.io
machine-learning/.ipynb_checkpoints/describe_a_matrix-checkpoint.ipynb
mit
# Load library import numpy as np """ Explanation: Title: Describe An Array Slug: describe_a_matrix Summary: How to describe an array. Date: 2017-09-03 12:00 Category: Machine Learning Tags: Vectors Matrices Arrays Authors: Chris Albon Preliminaries End of explanation """ # Create matrix matrix = np.array([[1,...
numerical-mooc/assignment-bank-2015
mjorisch/Orbital_Perturbations.ipynb
mit
from matplotlib import pyplot import numpy from numpy import linalg %matplotlib inline from matplotlib import rcParams rcParams['font.family'] = 'serif' rcParams['font.size'] = 16 def Kepler_eqn(e, M): """Takes the eccentricity and mean anomaly of an orbit to solve Kepler's equation Parameters: ------...
atcemgil/notes
KNN.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pylab as plt df = pd.read_csv(u'data/iris.txt',sep=' ') df X = np.hstack([ np.matrix(df.sl).T, np.matrix(df.sw).T, np.matrix(df.pl).T, np.matrix(df.pw).T]) print X[:5] # sample view c = np.matrix(df.c).T print c[:5] """ Exp...
sameersingh/ml-discussions
week5/kaggle_comp.ipynb
apache-2.0
# Import all required libraries from __future__ import division # For python 2.* import numpy as np import matplotlib.pyplot as plt import mltools as ml np.random.seed(0) %matplotlib inline """ Explanation: In this week's homework assignment we want you to start playing around with different classifiers and try to s...
mzszym/oedes
examples/ac/unipolar-prl100.ipynb
agpl-3.0
%matplotlib inline import matplotlib.pylab as plt import oedes import numpy as np import scipy.constants # for epsilon_0 oedes.init_notebook() """ Explanation: AC simulation of asymmetric single carrier devices This shows calculation of simulated capacitance-voltage (C-V) curves using AC analysis functionality. It re...
mne-tools/mne-tools.github.io
0.20/_downloads/ad29ebf74c7706fc10eea18e56a6fec7/plot_brainstorm_phantom_ctf.ipynb
bsd-3-clause
# Authors: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne import fit_dipole from mne.datasets.brainstorm import bst_phantom_ctf from mne.io import read_raw_ctf print(__doc__) """ Explanation: Brainstorm CT...
mjuenema/ipython-notebooks
easysnmp.ipynb
bsd-2-clause
import easysnmp session = easysnmp.Session(hostname='localhost', community='public', version=2, timeout=1, retries=1, use_sprint_value=True) # IMPORTANT: use_sprint_value=True for proper formatting of values location = session.get('sysLocation.0') location.oid, location.oid_index, location...
google/physics-math-tutorials
colabs/Introduction to Abstract Algebra, Exercise Session_ the RSA cryptosystem.ipynb
apache-2.0
# Exercise: Implement the shift cipher for strings composed of capital letters. # Input: a string whose characters are either capital letters or spaces, and # a shift length n. # Output: the encrypted string def rot_n(plaintext, n): # TODO: Your implementation here pass """ Explanation: Copyright 2021 Google LLC L...
pyemma/deeplearning
assignment1/two_layer_net.ipynb
gpl-3.0
# A bit of setup import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.neural_net import TwoLayerNet %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' # for auto-reloadi...
clauwag/WikipediaGenderInequality
notebooks/Network - 01 - Biography Connectivity.ipynb
mit
from __future__ import print_function, unicode_literals from dbpedia_utils import iter_entities_from from collections import defaultdict, Counter import pandas as pd import numpy as np import json import gzip import dbpedia_config import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline source_folder...
ES-DOC/esdoc-jupyterhub
notebooks/miroc/cmip6/models/nicam16-7s/toplevel.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-7s', 'toplevel') """ Explanation: ES-DOC CMIP6 Model Properties - Toplevel MIP Era: CMIP6 Institute: MIROC Source ID: NICAM16-7S Sub-Topics: Radiative Forcings. Properties: 85 ...
barjacks/pythonrecherche
Kursteilnehmer/Thierry Seiler/06 /03 Python Functions, 10 Übungen.ipynb
mit
def test(element): element = element * 2 return element """ Explanation: 03 Python Functions, 10 Übungen Hier nochmals zur Erinnerung, wie Funktionen geschrieben werden. End of explanation """ test(5) """ Explanation: Multipliziert Integers oder Floats mit 2 End of explanation """ def highestNumber(lst): ...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_read_epochs.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # # License: BSD (3-clause) import mne from mne import io from mne.datasets import sample print(__doc__) data_path = sample.data_path() """ Explanation: Reading epochs from a raw FIF file Th...
bennyrowland/suspect
docs/notebooks/tut1_intro.ipynb
mit
import suspect import numpy as np from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Introduction to MRS processing with Suspect Welcome to the first in our series of tutorials in how to use Suspect for working with MR spectroscopy data. In this introduction, we will present some of the basic fea...
Kaggle/learntools
notebooks/sql/raw/ex5.ipynb
apache-2.0
# Set up feedback system from learntools.core import binder binder.bind(globals()) from learntools.sql.ex5 import * print("Setup Complete") """ Explanation: Introduction You are getting to the point where you can own an analysis from beginning to end. So you'll do more data exploration in this exercise than you've don...
jdhp-docs/python-notebooks
signal_processing_wavelet_transform_fr.ipynb
mit
%matplotlib inline import matplotlib matplotlib.rcParams['figure.figsize'] = (7, 7) from astropy.io import fits import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import PIL.Image as pil_img # PIL.Image is a module not a class... """ Explanation: Transformée en ondelettes ...
GoogleCloudPlatform/tf-estimator-tutorials
08_Text_Analysis/06 - Part_4 - Text Classification - Hacker News - DNNClassifier with TF.IDF.ipynb
apache-2.0
import os class Params: pass # Set to run on GCP Params.GCP_PROJECT_ID = 'ksalama-gcp-playground' Params.REGION = 'europe-west1' Params.BUCKET = 'ksalama-gcs-cloudml' Params.PLATFORM = 'local' # local | GCP Params.DATA_DIR = 'data/news' if Params.PLATFORM == 'local' else 'gs://{}/data/news'.format(Params.BUCKE...
joommf/tutorial
workshops/2017-04-24-Intermag2017/tutorial4_current_induced_dw_motion.ipynb
bsd-3-clause
# Definition of parameters L = 500e-9 # sample length (m) w = 20e-9 # sample width (m) d = 2.5e-9 # discretisation cell size (m) Ms = 5.8e5 # saturation magnetisation (A/m) A = 15e-12 # exchange energy constant (J/) D = 3e-3 # Dzyaloshinkii-Moriya energy constant (J/m**2) K = 0.5e6 # uniaxial anisotropy constant...
antoniomezzacapo/qiskit-tutorial
community/games/quantum_awesomeness.ipynb
apache-2.0
device = 'ibmq_16_melbourne' """ Explanation: <img src="../../images/qiskit-heading.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> Quantum Awesomeness The latest version of this notebook is available on https://github.co...
intuinno/gatherplot
data/airline.ipynb
mit
import pandas as pd import numpy as np alldata = pd.read_csv('2008.csv') alldata.shape """ Explanation: Gatherplot IPython Demo Using Airline Data This notebook shows how we can use the gatherplot with ipython Data Source 2008 Airline Data from http://stat-computing.org/dataexpo/2009/ Gatherplot Gatherplot.or...
mercybenzaquen/foundations-homework
foundations_hw/05/Homework_5_Spotify.ipynb
mit
for every_lil in Lil_info: print(every_lil['name'], every_lil['popularity'],"Genre:",(", ".join(every_lil['genres']))) if every_lil['genres'] == []: print("No genres listed") """ Explanation: 1# Do a search and print a list of 50 that are playable in the USA (or the country of your choice), along with ...
billbrod/spatial-frequency-preferences
notebooks/How-to-use-model.ipynb
mit
# import necessary packages %matplotlib inline %load_ext autoreload %autoreload 2 import sys sys.path.append('..') import sfp import pandas as pd import torch import numpy as np import matplotlib.pyplot as plt from tqdm.auto import tqdm import seaborn as sns """ Explanation: This notebook presents the model developed...
Upward-Spiral-Science/grelliam
code/test_assumptions.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import os import csv import igraph as ig %matplotlib inline font = {'weight' : 'bold', 'size' : 18} import matplotlib matplotlib.rc('font', **font) # Initializing dataset names dnames = list(['../data/desikan/KKI2009']) print "Dataset: " + ", ".join(dname...
qiu997018209/MachineLearning
七月在线机器学习在bat工业中应用项目实战/随机森林/随机森林.ipynb
apache-2.0
%pylab inline # 导入训练集、验证集和测试集 import pandas as pd samtrain = pd.read_csv('samtrain.csv') samval = pd.read_csv('samval.csv') samtest = pd.read_csv('samtest.csv') # 使用 sklearn的随机森林模型,其模块叫做 sklearn.ensemble.RandomForestClassifier # 在这里我们需要将标签列 ('activity') 转换为整数表示, # 因为Python的RandomForest package需要这样的格式。 # 其对应关系如下:...
weleen/mxnet
example/notebooks/basic/ndarray.ipynb
apache-2.0
import mxnet as mx # create a 1-dimensional array with a python list a = mx.nd.array([1,2,3]) # create a 2-dimensional array with a nested python list b = mx.nd.array([[1,2,3], [2,3,4]]) {'a.shape':a.shape, 'b.shape':b.shape} """ Explanation: NDArray Tutorial In MXNet, NDArray is the core datastructure for all mathem...
tschinz/iPython_Workspace
02_WP/General/VarData_SpeedCalculation_Comparison.ipynb
gpl-2.0
import math import datetime def varData_speedCalc_comparison(test_case, test_title, test_description, test_time=None, cups_speed=250.0, substrate_size_mm=None, substrate_size_px=None, dpi_image=[360.0,360.0]): inch2mm = 25.4 # mm/inch bpp = 4.0 # bit/px if test_time == None: test_...
tensorflow/neural-structured-learning
research/neural_clustering/examples/ncp_demo_with_mog_data.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 u...
nishantsbi/pattern_classification
clustering/hierarchical/clust_complete_linkage.ipynb
gpl-3.0
%load_ext watermark %watermark -a "Sebastian Raschka" -d -v """ Explanation: [<- back to pattern_classification] End of explanation """ import pandas as pd import numpy as np np.random.seed(123) variables = ['X', 'Y', 'Z'] labels = ['ID_0','ID_1','ID_2','ID_3','ID_4'] X = np.random.random_sample([5,3])*10 df = p...
SergioSantGre/project_portfolio
P1_SSG.ipynb
lgpl-3.0
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline """ Explanation: Self-Driving Car Engineer Nanodegree Project: Finding Lane Lines on the Road In this project, you will use the tools you learned about in the lesson to ide...
googledatalab/notebooks
samples/ML Toolbox/Regression/Census/2 Service Preprocess.ipynb
apache-2.0
import google.datalab as datalab import google.datalab.ml as ml import mltoolbox.regression.dnn as regression import os """ Explanation: Data Preparation and Preprocessing with BigQuery This notebook is the first of a set of steps to run machine learning on the cloud. This step is about data preparation and preprocess...
metpy/MetPy
v0.10/_downloads/ef4bfbf049be071a6c648d7918a50105/Simple_Sounding.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np import pandas as pd import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import add_metpy_logo, SkewT from metpy.units import units # Change default to be better for skew-T plt.rcParams['figure.figsize'] = (9, 9) # Upper air data can be...
e-sr/SDWirkungNi
DSP/auswertungLS.ipynb
cc0-1.0
%reset -f %matplotlib notebook %load_ext autoreload %autoreload 1 %aimport functions # %qtconsole import numpy as np import acoustics from functions import * import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns mpl.rcParams['lines.linewidth']=0.5 """ Explanation: Auswertung der Lichtschrankes...
tinenbruno/aes_classifier
jupyter_notebooks/AVA Dataset Notebook.ipynb
mit
import pandas as pd import numpy as np import seaborn import matplotlib.pyplot as plt %matplotlib inline """ Explanation: AVA dataset explorer This study aims to explore and select a chunk of the AVA dataset to be used in preliminary tests of a aesthetic classifier. End of explanation """ ava_header = ["row_number"...
oneyb/eaternity
importing-agribalyse-1.3-with-ecoinvent-3.2-cutoff.ipynb
gpl-3.0
from brightway2 import * """ Explanation: Import Agribalyse and link to ecoinvent 3.2 cutoff Agribalyse is a French LCI database of agricultural products. It builds on top of ecoinvent 3.2. It was exported from SimaPro, so the names of ecoinvent processes are mangled, and need to be fixed back to standard ecoinvent. T...
tensorflow/docs-l10n
site/en-snapshot/model_optimization/guide/pruning/pruning_with_sparsity_2_by_4.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...
tensorflow/tfx
docs/tutorials/tfx/penguin_tft.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...
Britefury/deep-learning-tutorial-pydata2016
INTRO ML 01 - Machine learning - a very basic introduction.ipynb
mit
%matplotlib inline import numpy as np from matplotlib import pyplot as plt from sklearn.datasets import load_iris import seaborn as sns from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import LinearSVC from sklearn.ensemble import RandomForestClassifier """ Explanation: Machine Learning - a very ba...
ilanman/gdi
prework/00_Week0_I.ipynb
mit
my_variable = 2 my_variable my_variable = 2 my_variable # no output print "hello" my_variable = 2 print my_variable type(my_variable) my_variable = 2 print my_variable print type(my_variable) # printing a variable is different from the output of its value my_variable = my_variable + 1 my_variable my_varia...
NAU-CFL/Python_Learning_Source
03_Data_and_Expressions_Lecture.ipynb
mit
type(1.0) 3+6 type(1) # Limit of Precision 1.0/3 5.0//3 3*(1.0/3) # Built-in Format Function 12.0/5 a = format(12.0/5, '.2f') a type(a) # It's string careful. float(a) int('123') str(13) a 5.0/7 2*a float(format(5.0/7, '.2f')) """ Explanation: Python Basics Data and Expressions A literal is a sequence...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session03/Day4/ANTARES/miniAntaresSolutions_serial.ipynb
mit
import numpy as np import scipy.stats as spstat import pandas as pd import matplotlib.pyplot as plt %matplotlib notebook """ Explanation: Challenges of Streaming Data: Building an ANTARES-like Pipeline for Data Management and Discovery Version 0.1 By AA Miller 2017 Apr 10 Edited by Gautham Narayan, 2017 Apr 26 As ...
mjbrodzik/ipython_notebooks
charis/modice_area_by_country_and_year.ipynb
apache-2.0
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd %pylab inline filename = 'modice_v4_3strikes_by_country_by_yr.txt' df3 = pd.read_csv( filename, delim_whitespace=True, index_col=0 ) df3 """ Explanation: MODICE v04 area by country, 2000-2014 End of explanation """ sorte...
vascotenner/holoviews
doc/Tutorials/Containers.ipynb
bsd-3-clause
import numpy as np import holoviews as hv hv.notebook_extension() """ Explanation: This notebook serves as a reference for all the container types in HoloViews, with an extensive list of small, self-contained examples wherever possible, allowing each container type to be understood and tested independently. The contai...
WNoxchi/Kaukasos
research/autocsv-dev.ipynb
mit
%matplotlib inline %reload_ext autoreload %autoreload 2 from pathlib import Path import numpy as np import pandas as pd import os import matplotlib.pyplot as plt from cifar_utils import count_files PATH = Path('data/cifar10') """ Explanation: AutoCSV Dev WNixalo –– 2018/6/2-3 End of explanation """ with open(PATH...
ghvn7777/ghvn7777.github.io
content/feature_engineering/2017_04_22_predict_ibm_attrition.ipynb
apache-2.0
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline # Import statements required for Plotly import plotly.offline as py py.init_notebook_mode(connected=True) import plotly.graph_objs as go i...
google-research/evoflow
notebooks/onemax.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 & Creative Common licence 4.0 # EvoFlow and its tutorials are released under the Apache 2.0 licence # its documentaton is licensed under the Creative Common licence 4.0 """ Explanation: Copyright 2020 The EvoFlow Authors. End of explanation """ # installing the ...
amkatrutsa/MIPT-Opt
Spring2020/acc_grad.ipynb
mit
import numpy as np n = 100 # Random # A = np.random.randn(n, n) # A = A.T.dot(A) # Clustered eigenvalues A = np.diagflat([np.ones(n//4), 10 * np.ones(n//4), 100*np.ones(n//4), 1000* np.ones(n//4)]) U = np.random.rand(n, n) Q, _ = np.linalg.qr(U) A = Q.dot(A).dot(Q.T) A = (A + A.T) * 0.5 print("A is normal matrix: ||AA*...
nsaunier/CIV8760
Python/tutoriel-pandas.ipynb
mit
import pandas as pd import numpy as np from pandas import DataFrame,read_csv """ Explanation: Tutoriel sur Pandas 1. Importer pandas L'étape la plus importante est d'importer les bibliothèques nécessaires: End of explanation """ #Emplacement des compteurs avec la correspondance pour les noms dans les fichiers de com...
srodriguex/coursera_data_analysis_tools
Week_3.ipynb
mit
# Import all ploting and scientific library, # and embed figures in this file. %pylab inline # Package to manipulate dataframes. import pandas as pd # Nice looking plot functions. import seaborn as sn # The Pearson correlation function. from scipy.stats import pearsonr # Read the dataset. df = pd.read_csv('data/gap...
irazhur/StatisticalMethods
examples/XrayImage/FirstLook.ipynb
gpl-2.0
import astropy.io.fits as pyfits import numpy as np import os.path import astropy.visualization as viz import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 10.0) """ Explanation: A First Look at an X-ray Image Dataset Images are data. They can be 2D, from cameras, or 1D, from spe...
ueapy/ueapy.github.io
content/notebooks/2017-01-20-function-quirks.ipynb
mit
def my_super_function(): pass def even_better(): print('This is executed within a function') even_better() type(even_better) """ Explanation: Let's review the basics Functions without arguments End of explanation """ import numpy as np def uv2wdir(u, v): """Calculate horizontal wind direction (meteor...
tensorflow/docs-l10n
site/en-snapshot/agents/tutorials/9_c51_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...
zerothi/sids
docs/visualization/viz_module/diy/Building a plot class.ipynb
lgpl-3.0
from sisl.viz.plotly import Plot class HappinessPlot(Plot): pass """ Explanation: Building a plot class Following this guide, you will not only build a very flexible plot class that you will be able to use in a wide range of cases, but also your class will be automatically recognized by the graphical interface. T...
besser82/shogun
doc/ipython-notebooks/logdet/logdet.ipynb
bsd-3-clause
%matplotlib inline from scipy.sparse import eye from scipy.io import mmread from matplotlib import pyplot as plt import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') matFile=os.path.join(SHOGUN_DATA_DIR, 'logdet/apache2.mtx.gz') M = mmread(matFile) rows = M.shape[0] cols = M.shape[1] A = M + eye(row...
nicocardiel/numina
doc/notebooks/Wavelength_Calibration.ipynb
gpl-3.0
from __future__ import division from __future__ import print_function import sys import numpy as np from numpy.polynomial import polynomial from scipy.stats import norm import scipy.misc import matplotlib.pyplot as plt import itertools ldebug = True # display intermediate information lplot = True # display interme...
OSGeoLabBp/tutorials
english/data_processing/lessons/bridge_observations_tps.ipynb
cc0-1.0
import re # for regular expressions import numpy as np # for vector/matri operations import matplotlib.pyplot as plt # for charts import pandas as pd # for table like data structures from datetime import datetime, timedelta # for time/date handling """ Explanatio...
wikistat/Ateliers-Big-Data
Cdiscount/Part3-AIF-PythonKeras-TextGeneration-Cdiscount-Copy1.ipynb
mit
#Importation des librairies utilisées import pandas as pd import numpy as np import pickle import functools from tqdm import tqdm import keras.models as km import keras.layers as kl """ Explanation: Ateliers: Technologies de l'intelligence Artificielle <center> <a href="http://www.insa-toulouse.fr/" ><img src="http:...
amcdawes/QMlabs
Chapter 6 - Spin.ipynb
mit
from numpy import sin,cos,pi,sqrt from qutip import * pz = Qobj([[1],[0]]) mz = Qobj([[0],[1]]) px = Qobj([[1/sqrt(2)],[1/sqrt(2)]]) mx = Qobj([[1/sqrt(2)],[-1/sqrt(2)]]) py = Qobj([[1/sqrt(2)],[1j/sqrt(2)]]) my = Qobj([[1/sqrt(2)],[-1j/sqrt(2)]]) Sx = 1/2.0*sigmax() Sy = 1/2.0*sigmay() Sz = 1/2.0*sigmaz() py """ Ex...
Kaggle/learntools
notebooks/python/raw/ex_7.ipynb
apache-2.0
from learntools.core import binder; binder.bind(globals()) from learntools.python.ex7 import * print('Setup complete.') """ Explanation: Try It Yourself There are only three problems in this last set of exercises, but they're all pretty tricky, so be on guard! Run the setup code below before working on the questions....
donaghhorgan/COMP9033
labs/08c - Recommender systems.ipynb
gpl-3.0
%matplotlib inline import pandas as pd from sklearn.metrics import mean_absolute_error from sklearn.model_selection import GridSearchCV, KFold, cross_val_predict from sklearn.neighbors import KNeighborsRegressor """ Explanation: Lab 08c: Recommender systems Introduction In this lab, you will build a simple movie reco...
sofroniewn/2P-RAM-pipeline
notebooks/sources-view.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt pathToImage = '/Users/nick/Downloads/neurofinder.02.00/images_summary/mean.tif' pathToSources = '/Users/nick/Downloads/neurofinder.02.00/regions/regions3.json' pathToSourcesGT = '/Users/nick/Downloads/neurofinder.02.00/regions/regionsRand.json' import extraction as ...
weikang9009/pysal
notebooks/viz/splot/mapping_vba.ipynb
bsd-3-clause
import pysal.lib as lp from pysal.lib import examples import geopandas as gpd import pandas as pd import matplotlib.pyplot as plt import matplotlib import numpy as np %matplotlib inline """ Explanation: Mapping with splot and PySAL Imports End of explanation """ link_to_data = examples.get_path('columbus.shp') gdf ...
Jay-Oh-eN/data-science-workshops
presenting-data.ipynb
mit
from bokeh.plotting import figure, show, output_notebook output_notebook() """ Explanation: Presenting Data Your job as a data scientist is to communicate. Often you are communicating insight from distilling lots of data (models, stats, EDA, narative/editorialization) // making data accessible/self-service (run queri...
sorig/shogun
doc/ipython-notebooks/pca/pca_notebook.ipynb
bsd-3-clause
%pylab inline %matplotlib inline import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') # import all shogun classes from shogun import * """ Explanation: Principal Component Analysis in Shogun By Abhijeet Kislay (GitHub ID: <a href='https://github.com/kislayabhi'>kislayabhi</a>) This notebook is about...
ud3sh/coursework
deeplearning.ai/coursera-improving-neural-networks/week3/TensorFlow_Tutorial_v3b.ipynb
unlicense
import math import numpy as np import h5py import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.python.framework import ops from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict %matplotlib inline np.random.seed(1) """ Explanation: TensorFlow Tutorial Welcome to this w...
feststelltaste/software-analytics
demos/20210630_WeAreDevelopersWorldCongress/Production Coverage Demo Notebook (complete).ipynb
gpl-3.0
import pandas as pd coverage = pd.read_csv("../dataset/jacoco.csv") coverage = coverage[['PACKAGE', 'CLASS', 'LINE_COVERED' ,'LINE_MISSED']] coverage['LINES'] = coverage.LINE_COVERED + coverage.LINE_MISSED coverage.head(1) """ Explanation: Context John Doe remarked in #AP1432 that there may be too much code in our app...
ereodeereigeo/dataTritiumWS22
analisis promedios-Copy1.ipynb
gpl-2.0
import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Importamos las librerías necesarias End of explanation """ import ext_datos as ext import procesar as pro import time_plot as tplt """ Explanation: Importamos las librerías creadas para trabajar End of explanation """ dia1 = ...
mirjalil/DataScience
notebooks/computer-vision/.ipynb_checkpoints/face-landmarks-checkpoint.ipynb
gpl-2.0
import numpy as np import matplotlib from matplotlib import pyplot as plt %matplotlib inline import pandas """ Explanation: Playing with Eigen Faces In this tutorial article, we want to learn how to combine landmark points together in order to create new faces. This process is used in developing Active Shape Model (...
adlyons/AWOT
examples/awot_cfad_demo.ipynb
gpl-2.0
import awot import os import matplotlib.pyplot as plt %matplotlib inline """ Explanation: <h2>Demonstrating Frequency Distribution Plots in AWOT</h2> <h4>Additionally, other RadarUtility tools are shown</h4> End of explanation """ p3f = os.path.join("/Users/guy/data/dynamo/", "111124I", "0705_windsyn.nc") wcrf = os....
rahulremanan/python_tutorial
Fundamentals_of_deep-learning/notebooks/01_Introduction_Building_a_neural_network.ipynb
mit
if input_1 == input_2: output = 0 else: output = 1 """ Explanation: Introduction to Neural Networks: Author: Dr. Rahul Remanan Dr. Jesse Kanter CEO and Chief Imagination Officer Moad Computer Launch this notebook in Google Colab This is a hands-on workshop notebook on deep-learning using python 3. In this noteboo...
quantopian/research_public
notebooks/data/eventvestor.shareholder_meetings/notebook.ipynb
apache-2.0
# import the dataset from quantopian.interactive.data.eventvestor import shareholder_meetings # or if you want to import the free dataset, use: # from quantopian.data.eventvestor import shareholder_meetings_free # import data operations from odo import odo # import other libraries we will use import pandas as pd # Le...
pelodelfuego/word2vec-toolbox
notebook/classification/taxonomy.ipynb
gpl-3.0
summaryDf = pd.DataFrame([extractSummaryLine(l) for l in open('../../data/learnedModel/taxo/summary.txt').readlines()], columns=['full', 'strict', 'clf', 'feature', 'post', 'precision', 'recall', 'f1']) summaryDf = summaryDf[summaryDf['clf'] != 'KNeighborsClassifier'] directDf = summaryDf[summ...
edhuckle/statsmodels
examples/notebooks/statespace_local_linear_trend.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import pandas as pd from scipy.stats import norm import statsmodels.api as sm import matplotlib.pyplot as plt """ Explanation: State space modeling: Local Linear Trends This notebook describes how to extend the Statsmodels statespace classes to create and estimate a custom model....
kriete/cie5703_notebooks
week_6_Rotterdam.ipynb
mit
import matplotlib.pyplot as plt import pandas as pd import numpy as np %matplotlib inline plt.style.use('ggplot') """ Explanation: Assignment CIE 5703 - week 6 Import libraries End of explanation """ data = pd.read_csv('rotterdam_rg_2003-2014.csv', skipinitialspace=True) """ Explanation: Rotterdam rain gauge datase...
lowks/micromeritics
documentation/thickness.ipynb
gpl-3.0
%matplotlib inline import numpy as np from micromeritics import thickness as t, plots Prel = np.array([0.000000448802,0.000000936935,0.00000148652,0.00000209607,0.00000276863,0.00000351456, 0.00000435161,0.00000526938,0.00000630655,0.00000748296,0.00000884365,0.0000104439,0.0000123147, ...
anisfeld/MachineLearning
Diagnostic/.ipynb_checkpoints/ML HW0-1-checkpoint.ipynb
mit
import numpy as np import pandas as pd import requests from urllib.parse import quote_plus, urlencode # Helper Functions def check_nulls(df, col): ''' returns df with NaN in specified column ''' return df.ix[df.ix[:,col].isnull()] def get_notnulls(df, col): ''' returns df with NaN in specified...
dsacademybr/PythonFundamentos
Cap03/Notebooks/DSA-Python-Cap03-05-Metodos.ipynb
gpl-3.0
# Versão da Linguagem Python from platform import python_version print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version()) """ Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 3</font> Download: http://github.com/dsacademybr End of explanation """ # Crian...
ajgpitch/qutip-notebooks
examples/piqs-entropy_purity.ipynb
lgpl-3.0
from time import clock import matplotlib.pyplot as plt import numpy as np from qutip import * from qutip.piqs import * from scipy.sparse import block_diag from scipy.sparse.linalg import eigsh, eigs from scipy import log """ Explanation: Calculate Von Neumann Entropy and Purity for Dicke-Basis density matrix in presen...
BIDS-collaborative/purchasing
script/time_clustering/time_analysis.ipynb
isc
# Parsing date columns allows us to do some nifty things with pandas date_columns = ['po_closed_date', 'creation_date'] data = pd.read_csv(data_path, parse_dates=date_columns) data['cost_total'] = data.unit_price * data.quantity """ Explanation: Modified data The first step was to select a subset of useful columns, ...
dtamayo/MachineLearning
Day1/05_model_evaluation_tts.ipynb
gpl-3.0
from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target # print the shapes of X and y print X.shape print y.shape # STEP 1: split X and y into training and testing sets from sklearn.cross_validation import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_...
Chipe1/aima-python
improving_sat_algorithms.ipynb
mit
from logic import * """ Explanation: Propositional Logic Improving Boolean Satisfiability Algorithms Introduction A propositional formula $\Phi$ in Conjunctive Normal Form (CNF) is a conjunction of clauses $\omega_j$, with $j \in {1,...,m}$. Each clause being a disjunction of literals and each literal being either a ...
pybel/pybel-notebooks
integration/Resolving Names of Complexes.ipynb
apache-2.0
import itertools as itt import math import time import os import pybel import networkx as nx from pybel.constants import * import matplotlib.pyplot as plt import pybel_tools as pbt from pybel_tools.visualization import to_jupyter %matplotlib inline pybel.__version__ pbt.__version__ time.asctime() """ Explanation: ...
tensorflow/examples
courses/udacity_intro_to_tensorflow_for_deep_learning/l10c03_nlp_constructing_text_generation_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...
FRESNA/powerplantmatching
doc/example.ipynb
gpl-3.0
import powerplantmatching as pm import pandas as pd """ Explanation: Example of Use End of explanation """ geo = pm.data.GEO() geo.head() """ Explanation: Load open source data published bei the Global Energy Observation, GEO. As you might know, this is not the original format of the database but the standardized ...
caromedellin/Python-notes
exploratory-data-analysis/Final Project.ipynb
mit
import pandas as pd import numpy as np congress_words = pd.read_csv("../data/legislators.csv") congress_words = pd.DataFrame(congress_words) congress_words.head() congress_words.columns.tolist() """ Explanation: Congress Words End of explanation """ l_bioGuides = congress_words.bioguide_id.tolist() print l_bioGuid...
ES-DOC/esdoc-jupyterhub
notebooks/ipsl/cmip6/models/sandbox-3/ocnbgchem.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'ipsl', 'sandbox-3', 'ocnbgchem') """ Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem MIP Era: CMIP6 Institute: IPSL Source ID: SANDBOX-3 Topic: Ocnbgchem Sub-Topics: Tracers. Properties:...
Quadrocube/rep
howto/04-howto-folding.ipynb
apache-2.0
%pylab inline """ Explanation: About This notebook demonstrates stacking machine learning algorithm - folding, which physics use in their analysis. End of explanation """ import numpy, pandas from rep.utils import train_test_split from sklearn.metrics import roc_auc_score sig_data = pandas.read_csv('toy_datasets/to...
mathinmse/mathinmse.github.io
Lecture-10B-Reading-and-Writing-Data.ipynb
mit
x1 = np.linspace(0, 10, 9) y1 = x1**2 np.savetxt('test_data_001.txt', (x1,y1)) """ Explanation: A simple function with dependence on only one independent variable might be written to a file like this: End of explanation """ x2 = np.linspace(0, 1, 100) y2 = np.exp(x) np.savetxt('test_data_002.txt', (x2,y2)) """ Expl...
nadvamir/deep-learning
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...
param411singh/inf1340-2015-notebooks
Week 4.ipynb
mit
x = 1 y = 2 y != x """ Explanation: Overview Hour 1 Boolean Expressions Logical Operators Repetition Structures Hour 2 Repetition Structures continued Hour 3 Programming Exercise Lab Exercise 1 The intention is to complete the lab during class We made an exception for last week, since it was the first one. Solution...
unmrds/cc-python
1.2-The Basics.ipynb
apache-2.0
# The interpreter can be used as a calculator, and can also echo or concatenate strings. 3 + 3 3 * 3 3 ** 3 3 / 2 # classic division - output is a floating point number # Use quotes around strings, single or double, but be consistent to the extent possible 'dogs' "dogs" "They're going to the beach" 'He said "I...
ES-DOC/esdoc-jupyterhub
notebooks/noaa-gfdl/cmip6/models/sandbox-3/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'noaa-gfdl', 'sandbox-3', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: NOAA-GFDL Source ID: SANDBOX-3 Topic: Landice Sub-Topics: Glaciers, Ice. P...
mdpiper/wunderkammer
jupyter-notebook-widgets.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from ipywidgets import interact """ Explanation: Widgets in a Jupyter Notebook An example of using version 4.x widgets in a Jupyter Notebook. Reference: https://ipywidgets.readthedocs.io/en/latest/. Depending on the current state of your Python inst...
chris1610/pbpython
notebooks/Google-Forms-Data-Analysis.ipynb
bsd-3-clause
import gspread from oauth2client.client import SignedJwtAssertionCredentials import pandas as pd import json """ Explanation: Visualizing Google Forms Data with Seaborn This is the second part of an article from Practical Business Python describing how to retrieve and analyze data from a Google Form. Please review par...
catalyst-cooperative/pudl
devtools/harvesting_debug.ipynb
mit
pudl_settings = pudl.workspace.setup.get_defaults() settings_file_name= 'etl_full.yml' etl_settings = EtlSettings.from_yaml( pathlib.Path(pudl_settings['settings_dir'], settings_file_name)) validated_etl_settings = etl_settings.datasets datasets = validated_etl_settings.get_datasets() eia_settings ...
mikekestemont/ghent1516
Chapter 9 - Text analysis.ipynb
mit
ls data/arabian_nights """ Explanation: Chapter 9: What we have covered so far (and a bit more) In this chapter, we will work our way through a concise review of the Python functionality we have covered so far. Throughout this chapter, we will work with a interesting, yet not too large dataset, namely the well-known ...
google-research/google-research
rllim/main_local_dynamics_recovery.ipynb
apache-2.0
import os from git import Repo # Current working directory repo_dir = os.getcwd() + '/repo' if not os.path.exists(repo_dir): os.makedirs(repo_dir) # Clones github repository if not os.listdir(repo_dir): git_url = "https://github.com/google-research/google-research.git" Repo.clone_from(git_url, repo_dir) ...
daniaki/Enrich2
docs/notebooks/unique_barcodes.ipynb
gpl-3.0
% matplotlib inline import os.path from collections import Counter import numpy as np import pandas as pd import matplotlib.pyplot as plt from enrich2.variant import WILD_TYPE_VARIANT import enrich2.plots as enrich_plot pd.set_option("display.max_rows", 10) # rows shown when pretty-printing """ Explanation: Selecting...
cerrno/neurokernel
notebooks/sensory_int.ipynb
bsd-3-clause
%cd -q ~/neurokernel/examples/sensory_int/data %run gen_vis_input.py %run gen_olf_input.py %run gen_integrate.py """ Explanation: Sensory Integration Demo This notebook demonstrates how to use Neurokernel to integrate multiple independently developed LPUs. In this example, partial models of Drosophila's olfaction and ...