repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
zaqwes8811/micro-apps
self_driving/deps/Kalman_and_Bayesian_Filters_in_Python_master/02-Discrete-Bayes.ipynb
mit
from __future__ import division, print_function %matplotlib inline #format the book import book_format book_format.set_style() """ Explanation: Table of Contents Discrete Bayes Filter End of explanation """ import numpy as np belief = np.array([1./10]*10) print(belief) """ Explanation: The Kalman filter belongs to...
cbpygit/pypmj
examples/Extensions explained - materials.ipynb
gpl-3.0
import os os.environ['PYPMJ_CONFIG_FILE'] = '/path/to/your/config.cfg' """ Explanation: Imports and configuration We set the path to the config.cfg file using the environment variable 'PYPMJ_CONFIG_FILE'. If you do not have a configuration file yet, please look into the Setting up a configuration file example. End of ...
BrownDwarf/ApJdataFrames
notebooks/Douglas2017_extra_1.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import pandas as pd pd.options.display.max_columns = 150 %config InlineBackend.figure_format = 'retina' import astropy from astropy.table import Table from astropy.io import ascii import numpy as np """ Explanation: ApJdataFrames Douglas_2017 Ext...
thiagoqd/queirozdias-deep-learning
seq2seq/sequence_to_sequence_implementation.ipynb
mit
import numpy as np import time import helper source_path = 'data/letters_source.txt' target_path = 'data/letters_target.txt' source_sentences = helper.load_data(source_path) target_sentences = helper.load_data(target_path) """ Explanation: Character Sequence to Sequence In this notebook, we'll build a model that ta...
sueiras/training
sklearn/03 - Control overfit and hyperparameter optimization.ipynb
gpl-3.0
from __future__ import print_function from sklearn import __version__ as sklearn_version print('Sklearn version:', sklearn_version) """ Explanation: Sklearn control overfit example - Use the California house database to show how to control overfit tuning the model parameters End of explanation """ from sklearn impo...
Lattecom/HYStudy
scripts/[HYStudy 14th] SymPy, Matplotlib 1.ipynb
mit
import sympy sympy.init_printing(use_latex='mathjax') """ Explanation: Symbolic operation with sympy End of explanation """ # define symbol x = sympy.symbols('x') print(type(x)) x # define fuction f = x**2 + 4*x f # differentiation sympy.diff(f) # simplify function sympy.simplify(f) # solving equation from symp...
NYUDataBootcamp/Materials
Code/notebooks/bootcamp_practice_a_answerkey.ipynb
mit
# to make sure things are working, run this import pandas as pd print('Pandas version: ', pd.__version__) """ Explanation: Data Bootcamp: Code Practice A (answerkey) Optional Code Practice A: Jupyter basics and Python's graphics tools (the Matplotlib package). The goals are to become familiar with Jupyter and Matp...
walkon302/CDIPS_Recommender
notebooks/Plotting_Sequences_in_low_dimensions.ipynb
apache-2.0
# our lib from lib.resnet50 import ResNet50 from lib.imagenet_utils import preprocess_input, decode_predictions #keras from keras.preprocessing import image from keras.models import Model import glob def preprocess_img(img_path): img = image.load_img(img_path, target_size=(224, 224)) x = image.img_to_array(...
ericmjl/systems-microbiology-hiv
Problem Set.ipynb
mit
# This cell loads the data and cleans it for you, and log10 transforms the drug resistance values. # Remember to run this cell if you want to have the data loaded into memory. DATA_HANDLE = 'drug_data/hiv-protease-data.csv' # specify the relative path to the protease drug resistance data N_DATA = 8 # specify the numb...
whitead/numerical_stats
unit_9/hw_2017/problem_set_2.ipynb
gpl-3.0
from scipy.integrate import quad import numpy as np quad(np.sin, 0, np.pi)[0] """ Explanation: Problem 1 Instructions Evaluate the following definite integrals using the quad function and the lambda keyword. You may only report your answer in Python and you should only print the integral area and nothing else. Do not...
Dataweekends/odsc_intro_to_data_science
Titanic Survival Workshop.ipynb
mit
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Predicting survival of Titanic Passengers This notebook explores a dataset containing information of passengers of the Titanic. The dataset can be downloaded from Kaggle Tutorial goals Explore the dataset Build...
xpharry/Udacity-DLFoudation
your-first-network/.ipynb_checkpoints/dlnd-your-first-neural-network-checkpoint.ipynb
mit
%matplotlib inline %config InlineBackend.figure_format = 'retina' import numpy as np import pandas as pd import matplotlib.pyplot as plt """ Explanation: Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code...
shapiromatron/bmds-server
scripts/tdist-approximation.ipynb
mit
%matplotlib inline import json import numpy as np import pandas as pd from scipy.stats import t """ Explanation: tdist estimation proof in javascript This notebook should act as a proof to the reliability of the javascript estimation. This method is used for plotting confidence intervals on group summary data. Since ...
mathinmse/mathinmse.github.io
Lecture-22-Phase-Field-Basics.ipynb
mit
import matplotlib.pyplot as plt import numpy as np %matplotlib notebook def plot_p_and_g(): phi = np.linspace(-0.1, 1.1, 200) g=phi**2*(1-phi)**2 p=phi**3*(6*phi**2-15*phi+10) # Changed 3 to 1 in the figure call. plt.figure(1, figsize=(12,6)) plt.subplot(121) plt.plot(phi, g, linewidth=1.0...
lhcb/opendata-project
Example-Analysis.ipynb
gpl-2.0
from __future__ import print_function from __future__ import division %pylab inline execfile('Data/setup_example.py') """ Explanation: Analysis of Nobel prize winners Welcome to the programming example page. This page shows an example analysis of Nobel prize winners. The coding commands and techniques that are demons...
UltronAI/Deep-Learning
CS231n/reference/CS231n-master/assignment1/features.ipynb
mit
import random import numpy as np from cs231n.data_utils import load_CIFAR10 import matplotlib.pyplot as plt %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-reloading extenrnal modu...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/03_tensorflow/e_ai_platform.ipynb
apache-2.0
import os PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID BUCKET = 'cloud-training-demos-ml' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-central1' # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 # For Python Code # Model Info MODEL_NAME = 'taxifare' # Model Version MODEL_VERSION = 'v1' # Training D...
ComputationalModeling/spring-2017-danielak
past-semesters/spring_2016/day-by-day/day18-kinematics-terminal-velocity-of-a-skydiver/Day_18_pre_class_notebook.ipynb
agpl-3.0
from IPython.display import YouTubeVideo # WATCH THE VIDEO IN FULL-SCREEN MODE YouTubeVideo("JXJQYpgFAyc",width=640,height=360) # Numerical integration """ Explanation: Day 18 Pre-class assignment Goals for today's pre-class assignment In this pre-class assignment, you are going to learn how to: Numerically integ...
ajrader/timeseries
notebooks/Prophet_QuickStart_Example.ipynb
apache-2.0
peyton_dataset_url = 'https://github.com/facebookincubator/prophet/blob/master/examples/example_wp_peyton_manning.csv' peyton_filename = '../datasets/example_wp_peyton_manning.csv' import pandas as pd import numpy as np from fbprophet import Prophet # NB: this didn't work as of 8/22/17 #import io #import requests #s=...
ClimateTools/Correlation_EPSL
Proctor_NAO_bandwidth.ipynb
mit
%matplotlib inline from scipy import interpolate from scipy import special from scipy.signal import butter, lfilter, filtfilt import matplotlib.pyplot as plt import numpy as np from numpy import genfromtxt from nitime import algorithms as alg from nitime import utils from scipy.stats import t import pandas as pd """ E...
moble/PostNewtonian
PNTerms/AngularMomentum.ipynb
mit
AngularMomentum_NoSpin = PNCollection() AngularMomentum_Spin = PNCollection() """ Explanation: The following PNCollection objects will contain all the terms in the different parts of the binding energy. End of explanation """ AngularMomentum_NoSpin.AddDerivedVariable('L_coeff', M**2*nu/v) """ Explanation: Individua...
phanrahan/magmathon
notebooks/intermediate/PopCount.ipynb
mit
import magma as m """ Explanation: PopCount8 In this tutorial, we show how to construct a circuit to compute an 8-bit PopCount (population count). End of explanation """ from mantle import FullAdder """ Explanation: In this example, we are going to use the built-in fulladder from Mantle. End of explanation """ # ...
EmissionsIndex/Emissions-Index
Code/EIA bulk download - non-facility (distributed PV & state-level).ipynb
gpl-3.0
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import io, time, json import pandas as pd import os import numpy as np import math """ Explanation: National generation and fuel consumption The data in this notebook is generation and consumption by fuel type for the entire US. These values are ...
weleen/mxnet
example/notebooks/tutorials/char_lstm.ipynb
apache-2.0
import os import urllib import zipfile if not os.path.exists("char_lstm.zip"): urllib.urlretrieve("http://data.mxnet.io/data/char_lstm.zip", "char_lstm.zip") with zipfile.ZipFile("char_lstm.zip","r") as f: f.extractall("./") with open('obama.txt', 'r') as f: print f.read()[0:1000] """ Explanation: Cha...
lsanomaly/lsanomaly
lsanomaly/notebooks/digits.ipynb
mit
import os from IPython.display import Image import numpy as np from pathlib import Path from sklearn import metrics cwd = os.getcwd() os.chdir(Path(cwd).parents[1]) from lsanomaly import LSAnomaly import lsanomaly.notebooks.digits as demo digits = os.path.join(os.getcwd(), "lsanomaly", "notebooks", "digits.png") ""...
CPernet/LanguageDecision
notebooks/individuals/controls.ipynb
gpl-3.0
# Environment setup %matplotlib inline %cd /lang_dec # Imports import warnings; warnings.filterwarnings('ignore') import hddm import numpy as np import matplotlib.pyplot as plt from utils import model_tools, signal_detection # Import control models controls_data = hddm.load_csv('/lang_dec/data/controls_clean.csv') con...
StefanoAllesina/ISC
regex/solutions/MapOfScience_solution.ipynb
gpl-2.0
import re import csv """ Explanation: Map of Science Solution Read the file pubmed_results.txt, and extract all the US ZIP codes. First, import the modules we'll need. End of explanation """ with open('../data/MapOfScience/pubmed_results.txt') as f: my_text = f.read() len(my_text) """ Explanation: Now read the...
pyconsk/meetup
Bratislava/201508/Ludolph.ipynb
cc0-1.0
pip install ludolph """ Explanation: Ludolph Ludolph je jednoduchý XMPP klient napísaný v Pythone, ktorý dokáže odpovedať na správy podľa toho ako si ho naprogramujeme ;) XMPP Extensible Messaging and Presence Protocol (XMPP) (predtým známy ako Jabber) je protokol používaný na sieťovú komunikáciu, podobne ako AIM, I...
tensorflow/docs-l10n
site/ja/io/tutorials/prometheus.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...
shakhova/BananaML
kaggle_flight/Desicion_trees_practise.ipynb
gpl-3.0
from __future__ import division, print_function # отключим всякие предупреждения Anaconda import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd %matplotlib inline import seaborn as sns from matplotlib import pyplot as plt plt.rcParams['figure.figsize'] = (6,4) xx = np.linspace(0,1,50...
Diyago/Machine-Learning-scripts
classification/ods_session3_decision_trees.ipynb
apache-2.0
import numpy as np import pandas as pd from matplotlib import pyplot as plt %matplotlib inline from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.metrics import accuracy_score from sklearn.tree import DecisionTreeClassifier, export_graphviz """ Explanation: <center> Деревья решений для кла...
jlema/Udacity-Self-Driving-Car-Engineer-Nanodegree
Term 1- Computer Vision and Deep Learning/Project 1 - Finding Lane Lines in a Video Stream/P1.ipynb
apache-2.0
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg') #printing out some stats and plotting print('This image is:', type(image), 'with dimensions:', i...
ANTsX/ANTsPy
tutorials/motionCorrectionExample.ipynb
apache-2.0
import ants import numpy as np """ Explanation: Motion correction in ANTsPy We rely on ants.registration to do motion correction which provides the user with full access to parameters and outputs. The key steps, then, are to: * split the N dimensional (e.g. N=4) image to a list of N-1 dimensional images * run registr...
certik/chess
examples_manual/Convergence3.ipynb
mit
%pylab inline ! grep "multipv 1" log4.txt | grep -v lowerbound | grep -v upperbound > log4_g.txt def parse_info(l): D = {} k = l.split() i = 0 assert k[i] == "info" i += 1 while i < len(k): if k[i] == "depth": D[k[i]] = int(k[i+1]) i += 2 elif k[i] == "...
mne-tools/mne-tools.github.io
0.23/_downloads/51cca4c9f4bd40623cb6bfa890e2eb4b/20_erp_stats.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt from scipy.stats import ttest_ind import mne from mne.channels import find_ch_adjacency, make_1020_channel_selections from mne.stats import spatio_temporal_cluster_test np.random.seed(0) # Load the data path = mne.datasets.kiloword.data_path() + '/kword_metadata-epo...
kaleoyster/ProjectNBI
nbi-utilities/data_gen/decisionFlowChart/Untitled.ipynb
gpl-2.0
category = Counter(df['category']).keys() values = Counter(df['category']).values() plt.bar(category, values) plt.xticks(rotation='vertical') plt.show() """ Explanation: Number of bridges with respect to baseline difference score End of explanation """ category = Counter(df['intervention']).keys() values = Counter(d...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-3/atmos.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-3', 'atmos') """ Explanation: ES-DOC CMIP6 Model Properties - Atmos MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-3 Topic: Atmos Sub-Topics: Dynamical Core, Radiation, Turbul...
FRESNA/atlite
examples/plotting_with_atlite.ipynb
gpl-3.0
import os import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import seaborn as sns import geopandas as gpd import pandas as pd from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() import cartopy.crs as ccrs from cartopy.crs import PlateCarree as plate import...
mtasende/Machine-Learning-Nanodegree-Capstone
notebooks/prod/n03_day14_model_choosing_close_feat_all_syms_equal.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 %matplotlib inline %pylab inline pylab.rcParams['figure.figsize'] = (20.0, 10...
esa-as/2016-ml-contest
MandMs/Facies_classification-M&Ms_SVM_rbf_kernel.ipynb
apache-2.0
%matplotlib inline import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from sklearn import preprocessing from sklearn.metrics import f1_score, accuracy_score, make_scorer from sklearn.model_selection import LeaveOneGroupOut, validation_curve import pandas as pd from pandas import set_option se...
statsmodels/statsmodels.github.io
v0.13.0/examples/notebooks/generated/regression_plots.ipynb
bsd-3-clause
%matplotlib inline from statsmodels.compat import lzip import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.formula.api import ols plt.rc("figure", figsize=(16, 8)) plt.rc("font", size=14) """ Explanation: Regression Plots End of explanation """ prestige = sm.datasets.ge...
openai/openai-python
examples/embeddings/Zero-shot_classification.ipynb
mit
import pandas as pd import numpy as np from sklearn.metrics import classification_report df = pd.read_csv('output/embedded_1k_reviews.csv') df['babbage_similarity'] = df.babbage_similarity.apply(eval).apply(np.array) df['babbage_search'] = df.babbage_search.apply(eval).apply(np.array) df= df[df.Score!=3] df['sentime...
eric-haibin-lin/mxnet
example/multi-task/multi-task-learning.ipynb
apache-2.0
import logging import random import time import matplotlib.pyplot as plt import mxnet as mx from mxnet import gluon, nd, autograd import numpy as np """ Explanation: Multi-Task Learning Example This is a simple example to show how to use mxnet for multi-task learning. The network is jointly going to learn whether a n...
liganega/Gongsu-DataSci
ref_materials/excs/Lab-08.ipynb
gpl-3.0
Celsius = [36.2, 36.7, 47.3, 17.8] """ Explanation: 연습문제 리스트 조건제시법 예제 섭씨 온도로 이루어진 리스트가 다음과 있다. End of explanation """ Fahrenheit = [1.8 * C + 32 for C in Celsius] Fahrenheit """ Explanation: 위 리스트를 이용하여 화씨 온도로 이루어진 리스트를 구현하는 방법은 아래와 같다. End of explanation """ colors = ["red", "purple", "yellow", "blue", "green"] ...
arturops/deep-learning
intro-to-tflearn/TFLearn_Sentiment_Analysis.ipynb
mit
import pandas as pd import numpy as np import tensorflow as tf import tflearn from tflearn.data_utils import to_categorical """ Explanation: Sentiment analysis with TFLearn In this notebook, we'll continue Andrew Trask's work by building a network for sentiment analysis on the movie review data. Instead of a network w...
robotcator/gensim
docs/notebooks/word2vec.ipynb
lgpl-2.1
# import modules & set up logging import gensim, logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) sentences = [['first', 'sentence'], ['second', 'sentence']] # train word2vec on the two sentences model = gensim.models.Word2Vec(sentences, min_count=1) """ Explanation:...
gaufung/PythonStandardLibrary
mathematic/math.ipynb
mit
import math print('pi', math.pi) print('e', math.e) print('nan', math.nan) print('inf', math.inf) """ Explanation: The math module implements many of the IEEE functions that would normally be found in the native platform C libraries for complex mathematical operations using floating point values, including logarithms ...
survey-methods/samplics
docs/source/tutorial/estimation.ipynb
mit
from IPython.core.display import Image, display import numpy as np import pandas as pd import samplics from samplics.datasets import Nhanes2, Nhanes2brr, Nhanes2jk, Nmihs from samplics.estimation import TaylorEstimator, ReplicateEstimator """ Explanation: Estimation of population parameters The objective of this tu...
empet/Plotly-plots
Les-miserables-network.ipynb
gpl-3.0
import igraph as ig """ Explanation: A 3D graph representing the network of coappearances of characters in Victor Hugo's novel Les Miserables ## We define our graph as an igraph.Graph object. Python igraph is a library for high-performance graph generation and analysis. End of explanation """ import json data = []...
wbbeyourself/cn-deep-learning
dog-project/dog_app.ipynb
mit
from sklearn.datasets import load_files from keras.utils import np_utils import numpy as np from glob import glob # 定义函数来加载train,test和validation数据集 def load_dataset(path): data = load_files(path) dog_files = np.array(data['filenames']) dog_targets = np_utils.to_categorical(np.array(data['target']), ...
rabernat/xgcm
doc/example_mitgcm.ipynb
mit
import xarray as xr import numpy as np import xgcm from matplotlib import pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (10,6) """ Explanation: MITgcm Example xgcm is developed in close coordination with the xmitgcm package. The metadata in datasets constructed by xmitgcm should always be compatibl...
trangel/Data-Science
bayesian_modeling/TRG_finding_suspect.ipynb
gpl-3.0
try: import google.colab IN_COLAB = True except: IN_COLAB = False if IN_COLAB: print("Downloading Colab files") ! shred -u setup_google_colab.py ! wget https://raw.githubusercontent.com/hse-aml/bayesian-methods-for-ml/master/setup_google_colab.py -O setup_google_colab.py import setup_google_...
saashimi/code_guild
interactive-coding-challenges/graphs_trees/bst/bst_challenge.ipynb
mit
class Node(object): def __init__(self, data): # TODO: Implement me pass def insert(root, data): # TODO: Implement me pass """ Explanation: <small><i>This notebook was prepared by Donne Martin. Source and license info is on GitHub.</i></small> Challenge Notebook Problem: Implement a binar...
matousc89/Python-Adaptive-Signal-Processing-Handbook
notebooks/adaptive_filters_realtime.ipynb
mit
import numpy as np import matplotlib.pylab as plt import padasip as pa %matplotlib inline plt.style.use('ggplot') # nicer plots np.random.seed(52102) # always use the same random seed to make results comparable """ Explanation: Adaptive Filters Real-time Use with Padasip Module This tutorial shows how to use Padasip ...
mkliegl/custom-sklearn
heavytail.ipynb
mit
from __future__ import print_function import numpy as np from sklearn.linear_model import Ridge from flexible_linear import FlexibleLinearRegression import matplotlib import matplotlib.pyplot as plt matplotlib.style.use('ggplot') %matplotlib inline np.random.seed(1) """ Explanation: Cost function for heavy-tailed n...
AEW2015/PYNQ_PR_Overlay
docs/source/6a_base_overlay_iop.ipynb
bsd-3-clause
from pynq import Overlay from pynq.iop import Pmod_OLED from pynq.iop import PMODB ol = Overlay("base.bit") ol.download() oled = Pmod_OLED(PMODB) """ Explanation: Using Peripherals with the Base overlay Base overlay The PYNQ-Z1 has 2 Pmod connectors. PMODA and PMODB as indicated below are connected to the FPGA fabric...
atulsingh0/MachineLearning
python_DC/ST_Python_02b.ipynb
gpl-3.0
# import import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline sns.set() %run ST_Python_02a.py #import ipynb.fs.full.ST_Python_02a import io from nbformat import current def execute_notebook(nbfile): with io.open(nbfile) as f: nb = current.re...
DawesLab/LabNotebooks
Jones Calculus for EIT Setup.ipynb
mit
qwp = np.matrix([[1, 0],[0, -1j]]) R(-np.pi/4)*qwp*R(np.pi/4) qwp45 = wp(np.pi/2, np.pi/4) qwp45 wp(np.pi/2, 0) vpol = np.matrix([[0,0],[0,1]]) vpol np.exp(1j*np.pi/4) horiz = np.matrix([[1],[0]]) output = qwp*horiz intensity(output) before_cell = wp(np.pi/2,np.pi/4)*wp(np.pi,np.pi/10)*horiz output = vpol*wp(...
ellisonbg/leafletwidget
examples/DrawControl.ipynb
mit
dc = DrawControl(marker={'shapeOptions': {'color': '#0000FF'}}, rectangle={'shapeOptions': {'color': '#0000FF'}}, circle={'shapeOptions': {'color': '#0000FF'}}, circlemarker={}, ) def handle_draw(target, action, geo_json): print(action) print(...
cdt15/lingam
examples/BottomUpParceLiNGAM.ipynb
mit
import numpy as np import pandas as pd import graphviz import lingam from lingam.utils import print_causal_directions, print_dagc, make_dot import warnings warnings.filterwarnings('ignore') print([np.__version__, pd.__version__, graphviz.__version__, lingam.__version__]) np.set_printoptions(precision=3, suppress=Tru...
metpy/MetPy
v0.11/_downloads/8532b75251585046a16f04a9afaef079/Advanced_Sounding.ipynb
bsd-3-clause
import matplotlib.pyplot as plt 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 """ Explanation: Advanced Sounding Plot a sounding using MetPy with more advanced features. Beyond just plotting data, this ...
sevamoo/SOMPY
sompy/examples/.ipynb_checkpoints/AirFlights_hexagonal_grid-checkpoint.ipynb
apache-2.0
%matplotlib inline import math import glob import matplotlib.pyplot as plt import numpy as np import pandas as pd import urllib3 from sklearn.externals import joblib import random import matplotlib from sompy.sompy import SOMFactory from sompy.visualization.plot_tools import plot_hex_map import logging """ Explanatio...
LFPy/LFPy
examples/LFPy-example-08.ipynb
gpl-3.0
# importing some modules, setting some matplotlib values for pl.plot. import LFPy import numpy as np import scipy.stats import matplotlib.pyplot as plt plt.rcParams.update({'font.size' : 12, 'figure.facecolor' : '1', 'figure.subplot.wspace' : 0.5, 'figure....
PyLCARS/PythonUberHDL
myHDL_ComputerFundamentals/Memorys/.ipynb_checkpoints/FirstInFirstOutMemory-checkpoint.ipynb
bsd-3-clause
from myhdl import * from myhdlpeek import Peeker import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline from sympy import * init_printing() import random #https://github.com/jrjohansson/version_information %load_ext version_information %version_information myhdl, myhdlpeek, numpy, ...
yl565/statsmodels
examples/notebooks/predict.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function import numpy as np import statsmodels.api as sm """ Explanation: Prediction (out of sample) End of explanation """ nsample = 50 sig = 0.25 x1 = np.linspace(0, 20, nsample) X = np.column_stack((x1, np.sin(x1), (x1-5)**2)) X = sm.add_constant(X) beta = [5., 0.5...
science-of-imagination/nengo-buffer
Project/trained_mental_rotation_ens_inhibition.ipynb
gpl-3.0
import nengo import numpy as np import cPickle from nengo_extras.data import load_mnist from nengo_extras.vision import Gabor, Mask from matplotlib import pylab import matplotlib.pyplot as plt import matplotlib.animation as animation import scipy.ndimage from scipy.ndimage.interpolation import rotate """ Explanation: ...
GoogleCloudPlatform/vertex-ai-samples
notebooks/community/gapic/automl/showcase_automl_video_classification_batch.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 video classification model for batch prediction <table align=...
jasonpcasey/ipeds-peers
.ipynb_checkpoints/peer_examples-checkpoint.ipynb
mit
nx.degree(g, 3) nx.degree(g, 4) """ Explanation: A node's degree is the number of connections it has. End of explanation """ nx.clustering(g, 0) nx.clustering(g, 4) nx.clustering(g, 1) """ Explanation: The local clustering coefficient is the fraction of a node's connections that are also connected. End of explan...
CUBoulder-ASTR2600/lectures
lecture_02_basics.ipynb
isc
10 / 3 # We provide integers # What will the output be? """ Explanation: Saving your iPython notebook File -> Save and Checkpoint Can change the name also in that menu. But also possible via clicking the name above. Talk about command mode and edit mode of cells. And the help window. Data Types: Integers vs. Floa...
Microno95/DESolver
docs/examples/numpy/Example 3 - NumPy - N-Body Systems.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import desolver as de import desolver.backend as D D.set_float_fmt('float64') """ Explanation: N-Body Gravitationally Interacting System Let's try doing something more complicated: N-body dynamics. As the name implies, we have $N$ interacting bodies where the i...
SParadiso18/juliasets
juliaplots.ipynb
mit
from juliaset import JuliaSet """ Explanation: Julia Set Plotting Extension Load module for a JuliaSet that conforms to the specified interface. It is wise to run the test suite in test_juliaset.py with nosetests prior to attempting to plot here. End of explanation """ # Math libraries import numpy as np from math i...
phobson/statsmodels
examples/notebooks/tsa_arma_1.ipynb
bsd-3-clause
%matplotlib inline from __future__ import print_function import numpy as np import statsmodels.api as sm import pandas as pd from statsmodels.tsa.arima_process import arma_generate_sample np.random.seed(12345) """ Explanation: Autoregressive Moving Average (ARMA): Artificial data End of explanation """ arparams = n...
ttsuchi/ttsuchi.github.io
notebooks/PCA.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: Principal Component Analysis and EigenFaces In this notebook, I will go through the basic concepts behind the principal component a...
ucsd-ccbb/jupyter-genomics
notebooks/networkAnalysis/drug_gene_networks/drug_gene_networks.ipynb
mit
# import some useful packages import numpy as np import matplotlib.pyplot as plt import seaborn import networkx as nx import pandas as pd import random import json # latex rendering of text in graphs import matplotlib as mpl mpl.rc('text', usetex = False) mpl.rc('font', family = 'serif') % matplotlib inline """ Expl...
stevetjoa/stanford-mir
audio_representation.ipynb
mit
x, sr = librosa.load('audio/c_strum.wav') ipd.Audio(x, rate=sr) """ Explanation: &larr; Back to Index Audio Representation In performance, musicians convert sheet music representations into sound which is transmitted through the air as air pressure oscillations. In essence, sound is simply air vibrating (Wikipedia). ...
kraemerd17/kraemerd17.github.io
courses/python/material/ipynbs/NumPy Basics.ipynb
mit
import numpy as np """ Explanation: NumPy: Vectorized Array Processing in Python NumPy, short for Numerical Python, is the fundamental package required for high performance scientific computing and data analysis. It is the foundation on which nearly all of the higher-level tools we will use are built. Here are some of...
angelmtenor/data-science-keras
property_maintenance_fines.ipynb
mit
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import helper import keras helper.info_gpu() #sns.set_palette("GnBu_d") #helper.reproducible(seed=0) # Setup reproducible results from run to run using Keras %matplotlib inline """ Explanation: Property Maintenance...
sinamoeini/mapp4py
examples/fracture-gcmc-tutorial/dislocation.ipynb
mit
import numpy as np import matplotlib.pyplot as plt import mapp4py from mapp4py import md from lib.elasticity import rot, cubic, resize, displace, HirthEdge, HirthScrew """ Explanation: Introdcution This trial describes how to create edge and screw dislocations in iron BCC strating with one unitcell containing two atom...
programmingscience/code
2014/20141230_2DPlotsonPythonP2.ipynb
gpl-3.0
from pylab import * t = arange(0.0, 2.0,0.01) y = sin(2*pi*t) plot(t, y) xlabel('Time (s)') ylabel('Voltage (mV)') title('The simplest one, buddies') grid(True) show() """ Explanation: 20141230_2DPlotsonPythonP2.ipynb Two-dimensional plots on Python [Part II] Support material for the blog post "Two-dimensional p...
nsrchemie/code_guild
wk1/notebooks/wk1.0.ipynb
mit
count = 1 for elem in range(1, 3 + 1): count *= elem print(count) """ Explanation: Wk1.0 Warm-up: I got 32767 problems and overflow is one of them. 1. Swap the values of two variables, a and b without using a temporary variable. 2. Suppose I had six different sodas. In how many different combinations could I...
sharynr/notebooks
Import from Cloudant Python example.ipynb
apache-2.0
from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() """ Explanation: Python example using Spark SQL over Cloudant as a source This sample notebook is written in Python and expects the Python 3.5 or higher runtime. Make sure the kernel is started and you are connected to it when executing t...
dolittle007/dolittle007.github.io
notebooks/getting_started.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt # Initialize random number generator np.random.seed(123) # True parameter values alpha, sigma = 1, 1 beta = [1, 2.5] # Size of dataset size = 100 # Predictor variable X1 = np.random.randn(size) X2 = np.random.randn(size) * 0.2 # Simulate outcome variable Y = alpha...
mne-tools/mne-tools.github.io
0.24/_downloads/64e3b6395952064c08d4ff33d6236ff3/evoked_whitening.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis A. Engemann <denis.engemann@gmail.com> # # License: BSD-3-Clause import mne from mne import io from mne.datasets import sample from mne.cov import compute_covariance print(__doc__) """ Explanation: Whitening evoked data with a noise covari...
kmunve/APS
aps/notebooks/new_snow_problem.ipynb
mit
# -*- coding: utf-8 -*- %matplotlib inline from __future__ import print_function import pylab as plt import datetime import numpy as np plt.rcParams['figure.figsize'] = (14, 6) plt.rcParams.update({'font.size': 22}) plt.xkcd() """ Explanation: APS - new snow Imports End of explanation """ from matplotlib.patches imp...
p0licat/university
Experiments/Crawling/Jupyter Notebooks/Maria-Iuliana Bocicor.ipynb
mit
class HelperMethods: @staticmethod def IsDate(text): # print("text") # print(text) for c in text.lstrip(): if c not in "1234567890 ": return False return True import pandas import requests page = requests.get('https://sites.google.com/view/iuliana-bo...
NuSTAR/nustar_lunar_pointing
notebooks/Convert_Example.ipynb
mit
import sys from os.path import * import os # For loading the NuSTAR data from astropy.io import fits # Load the NuSTAR python libraries import nustar_pysolar as nustar """ Explanation: Code for converting an observation to solar coordinates Step 1: Run the pipeline on the data to get mode06 files with the correct...
ajrichards/phylogenetic-models
lda/herve-vertebrates-example.ipynb
bsd-3-clause
import os import numpy as np from vertebratesLib import * split = "SPLIT1" summaryTree,summarySpecies,splitPositions = get_split_data(split) print summaryTree.shape """ Explanation: LDA on vertebrates Notes on the data In this example the tree is contstrained In this example we have to extract position,transition,...
cfjhallgren/shogun
doc/ipython-notebooks/neuralnets/autoencoders.ipynb
gpl-3.0
%pylab inline %matplotlib inline import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') from scipy.io import loadmat from shogun import RealFeatures, MulticlassLabels, Math # load the dataset dataset = loadmat(os.path.join(SHOGUN_DATA_DIR, 'multiclass/usps.mat')) Xall = dataset['data'] # the usps dat...
CrowdTruth/CrowdTruth-core
tutorial/notebooks/Sparse Multiple Choice Task - Person Annotation in Video.ipynb
apache-2.0
import pandas as pd test_data = pd.read_csv("../data/person-video-sparse-multiple-choice.csv") test_data.head() """ Explanation: CrowdTruth for Sparse Multiple Choice Tasks: Person Annotation in Video In this tutorial, we will apply CrowdTruth metrics to a multiple choice crowdsourcing task for Person Annotation from...
tpin3694/tpin3694.github.io
machine-learning/ridge_regression.ipynb
mit
# Load libraries from sklearn.linear_model import Ridge from sklearn.datasets import load_boston from sklearn.preprocessing import StandardScaler """ Explanation: Title: Ridge Regression Slug: ridge_regression Summary: How to conduct ridge regression in scikit-learn for machine learning in Python. Date: 2017-09-...
urgedata/pythondata
fbprophet/.ipynb_checkpoints/fbprophet_part_one-checkpoint.ipynb
mit
import pandas as pd import numpy as np from fbprophet import Prophet import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize']=(20,10) plt.style.use('ggplot') """ Explanation: Import necessary libraries End of explanation """ sales_df = pd.read_csv('../examples/retail_sales.csv', index_co...
tritemio/multispot_paper
out_notebooks/usALEX-5samples-PR-raw-out-all-ph-17d.ipynb
mit
ph_sel_name = "all-ph" data_id = "17d" # ph_sel_name = "all-ph" # data_id = "7d" """ Explanation: Executed: Mon Mar 27 11:34:28 2017 Duration: 8 seconds. usALEX-5samples - Template This notebook is executed through 8-spots paper analysis. For a direct execution, uncomment the cell below. End of explanation """ fr...
google/applied-machine-learning-intensive
content/03_regression/03_regression_quality/colab.ipynb
apache-2.0
# 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 the L...
drabastomek/learningPySpark
Chapter09/LearningPySpark_Chapter09.ipynb
gpl-3.0
import blaze as bl """ Explanation: Hybrid data representation using Blaze Import the Blaze. End of explanation """ import numpy as np simpleArray = np.array([ [1,2,3], [4,5,6] ]) """ Explanation: Abstract data Working with NumPy array Let's create a simple NumPy array: we first load NumPy and ...
aanishn/aanishn.github.io
artifacts/Kaggle_Dogs_Vs_Cats_Using_LeNet_on_Google_Colab_TPU.ipynb
mit
!pip install kaggle api_token = {"username":"xxxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxx"} import json import zipfile import os os.mkdir('/root/.kaggle') with open('/root/.kaggle/kaggle.json', 'w') as file: json.dump(api_token, file) !chmod 600 /root/.kaggle/kaggle.json # !kaggle config path -p /root !kaggle competi...
herruzojm/udacity-deep-learning
batch-norm/Batch_Normalization_Lesson.ipynb
mit
# Import necessary packages import tensorflow as tf import tqdm import numpy as np import matplotlib.pyplot as plt %matplotlib inline # Import MNIST data so we have something for our experiments from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) "...
tensorflow/tfx
docs/tutorials/tfx/template.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...
sthuggins/phys202-2015-work
assignments/assignment04/MatplotlibEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 1 Imports End of explanation """ import os assert os.path.isfile('yearssn.dat') """ Explanation: Line plot of sunspot data Download the .txt data for the "Yearly mean total sunspot number [1700 - now]" from th...
IST256/learn-python
content/lessons/02-Variables/LAB-Variables.ipynb
mit
a = "4" type(a) # should be str a = 4 type(a) # should be int """ Explanation: Class Coding Lab: Variables And Types The goals of this lab are to help you to understand: Python data types Getting input as different types Formatting output as different types Basic arithmetic operators How to create a program from an ...
google/starthinker
colabs/barnacle_dv360.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: DV360 User Audit Gives DV clients ability to see which users have access to which parts of an account. Loads DV user profile mappings using the API into BigQuery and connects to a DataStudio dashboard. License Copyright 2020 Google LLC, Licensed ...