repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
tritemio/multispot_paper
LCOS_pattern/Pattern Roto-Translation Documentation.ipynb
mit
def rotate(x, y, angle): """Rotate the point (x, y) (or array of points) with respect to the origin. Arguments: x, y (floats or arrays): input coordinates to be transformed. angle (float): rotation angle in degrees. When the Y axis points up and the X axis points right, a positi...
probml/pyprobml
notebooks/book2/07/advi_beta_binom_jax.ipynb
mit
try: import jax except ModuleNotFoundError: %pip install -qqq jax jaxlib import jax import jax.numpy as jnp from jax import lax try: from tensorflow_probability.substrates import jax as tfp except ModuleNotFoundError: %pip install -qqq tensorflow_probability from tensorflow_probability.substra...
raschuetz/foundations-homework
Data_and_Databases_homework/03/.ipynb_checkpoints/homework_3_schuetz-checkpoint.ipynb
mit
from bs4 import BeautifulSoup from urllib.request import urlopen html_str = urlopen("http://static.decontextualize.com/widgets2016.html").read() document = BeautifulSoup(html_str, "html.parser") """ Explanation: Homework assignment #3 These problem sets focus on using the Beautiful Soup library to scrape web pages. Pr...
jdeitmerg/PlainReflow
design/PT100 optimization.ipynb
mit
from scipy.optimize import curve_fit import numpy as np from matplotlib import pyplot as plt %matplotlib inline eps = np.finfo(float).eps A = 3.9083e-3 B = -5.775e-7 term1 = (A/B/2)*(A/B/2) term2 = (1-96/100)/B print(term1, ' ', term2) # PT100 formula: R = 100*(1+A*T+B*T²) # with A = 3.9083e-3 # B = -5.775e-...
mne-tools/mne-tools.github.io
0.16/_downloads/plot_point_spread.ipynb
bsd-3-clause
import os.path as op import numpy as np from mayavi import mlab import mne from mne.datasets import sample from mne.minimum_norm import read_inverse_operator, apply_inverse from mne.simulation import simulate_stc, simulate_evoked """ Explanation: Corrupt known signal with point spread The aim of this tutorial is to...
kscottz/PyBay2017
MovieTime.ipynb
apache-2.0
# Basemap Mosaic (v1 API) mosaicsSeries = 'global_quarterly_2017q1_mosaic' # Planet tile server base URL (Planet Explorer Mosaics Tiles) mosaicsTilesURL_base = 'https://tiles0.planet.com/experimental/mosaics/planet-tiles/' + mosaicsSeries + '/gmap/{z}/{x}/{y}.png' # Planet tile server url mosaicsTilesURL = mosaicsTiles...
ericmjl/Network-Analysis-Made-Simple
notebooks/05-casestudies/01-gameofthrones.ipynb
mit
from nams import load_data as cf books = cf.load_game_of_thrones_data() """ Explanation: Introduction In this chapter, we will use Game of Thrones as a case study to practice our newly learnt skills of network analysis. It is suprising right? What is the relationship between a fatansy TV show/novel and network science...
turbomanage/training-data-analyst
courses/machine_learning/deepdive/06_structured/5_train_keras.ipynb
apache-2.0
# change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'] = BUCKET os.environ['PROJECT'] = PROJECT os.environ['REGION'] = REGION os.environ['TFVERSION'] = '2.0' # not used in this notebook %%bash gcloud config set...
fluffy-hamster/A-Beginners-Guide-to-Python
A Beginners Guide to Python/19. For-Loops.ipynb
mit
a_string = "12345" a_list = list(range(1,6)) a_range_object = range(1, 6) for num in a_range_object: print(num, num*num) # prints num and num**2. for num in a_list: print(num, "is {}even".format("not " if num % 2 != 0 else "")) # returns num and whether it is/isnot even for num in a_string: print(int...
adityaka/misc_scripts
python-scripts/data_analytics_learn/link_pandas/Ex_Files_Pandas_Data/Exercise Files/02_07/Final/Input and Output.ipynb
bsd-3-clause
file_name_string = 'C:/Users/Charles Kelly/Desktop/Exercise Files/02_07/Final/EmployeesWithGrades.xlsx' employees_df = pd.read_excel(file_name_string, 'Sheet1', index_col=None, na_values=['NA']) employees_df """ Explanation: read from an Excel file documentation: http://pandas.pydata.org/pandas-docs/stable/generated/...
jrmontag/Data-Science-45min-Intros
clustering-algos/Clustering algorithm comparison.ipynb
unlicense
import time import hdbscan import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set(context='poster', style='darkgrid') sns.set_color_codes() from sklearn import cluster from sklearn import datasets """ Explanation: Comparing clustering algorithms 2017-09-08, Josh Montagu...
mne-tools/mne-tools.github.io
0.20/_downloads/d9e2f27df3a137317d331d3be6f3814d/plot_dics_source_power.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # Roman Goj <roman.goj@gmail.com> # Denis Engemann <denis.engemann@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import os.path as op import numpy as np import mne from mne.datasets import somato from...
mne-tools/mne-tools.github.io
0.18/_downloads/ec24ebcf066d9fa611749fe52d13e07b/plot_sensor_permutation_test.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import numpy as np import mne from mne import io from mne.stats import permutation_t_test from mne.datasets import sample print(__doc__) """ Explanation: Permutation T-test on sensor data One tests if the signal sign...
theandygross/TCGA_differential_expression
Notebooks/Exploratory/sigmoid_updown.ipynb
mit
paired_bp_tn_split(matched_rna.ix['WASF3'], codes) """ Explanation: Inactivation of the WASF3 gene in prostate cancer cells leads to suppression of tumorigenicity and metastases. End of explanation """ paired_bp_tn_split(matched_rna.ix['SGEF'], codes) """ Explanation: SGEF is overexpressed in prostate cancer and co...
carltoews/tennis
results/DI_plot1.ipynb
gpl-3.0
from IPython.display import display, HTML display(HTML('''<img src="image1.png",width=800,height=600>''')) """ Explanation: Plot 1: The predictive potential of rank difference End of explanation """ import numpy as np # numerical libraries import pandas as pd # for data analysis import matplotlib as mpl # a big libr...
jhillairet/scikit-rf
doc/source/examples/vectorfitting/vectorfitting_ex3_Agilent_E5071B.ipynb
bsd-3-clause
import skrf import numpy as np import matplotlib.pyplot as mplt """ Explanation: Ex3: Fitting spiky responses The Vector Fitting feature is demonstrated using a 4-port example network copied from the scikit-rf tests folder. This network is a bit tricky to fit because of its many resonances in the individual response. ...
georgetown-analytics/machine-learning
archive/notebook/energy_efficiency.ipynb
mit
%matplotlib inline import os import requests import pandas as pd import matplotlib.pyplot as plt from pandas.plotting import scatter_matrix from sklearn.linear_model import LinearRegression, Ridge from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import r2_score from sklearn.metrics import me...
mne-tools/mne-tools.github.io
0.23/_downloads/772492bca9aff751a357f5e3e0163e67/50_cluster_between_time_freq.ipynb
bsd-3-clause
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.time_frequency import tfr_morlet from mne.stats import permutation_cluster_test from mne.datasets import sample print(__doc__) """ Explanation: Non-parametri...
rrozewsk/OurProject
CDO_Tranches.ipynb
mit
R=0.4 PD= 0.05 # Probability of default per year PD = np.array([0.05*x for x in range(1,100) ]) # Probability of default per year beta = 0.3 CT = norm.ppf(PD) x = 0.5 def AA(CT,x,R): AAA = CT - np.sqrt(1-beta*beta)*norm.ppf(x/(1-R)) AAA[AAA < -10]=-10 AAA[AAA > 10] = 10 return AAA """ Explanation: Qu...
tensorflow/federated
docs/tutorials/working_with_client_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 under...
KEHANG/AutoFragmentModeling
ipython/1. frag_mech_generation/generate_fragment_mechanism.ipynb
mit
import os from tqdm import tqdm from rmgpy import settings from rmgpy.data.rmg import RMGDatabase from rmgpy.kinetics import KineticsData from rmgpy.rmg.model import getFamilyLibraryObject from rmgpy.data.kinetics.family import TemplateReaction from rmgpy.data.kinetics.depository import DepositoryReaction from rmgpy.d...
jrg365/gpytorch
examples/07_Pyro_Integration/Pyro_GPyTorch_High_Level.ipynb
mit
import math import torch import pyro import tqdm import gpytorch from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Predictions with Pyro + GPyTorch (High-Level Interface) Overview In this example, we will give an overview of the high-level Pyro-GPyTorch integration - designed for predictive mod...
anhaidgroup/py_entitymatching
notebooks/guides/end_to_end_em_guides/Basic EM Workflow DBLP ACM.ipynb
bsd-3-clause
# Import libraries import py_entitymatching as em import pandas as pd import os, sys print('python version: ' + sys.version ) print('pandas version: ' + pd.__version__ ) print('magellan version: ' + em.__version__ ) """ Explanation: This quickstart guide explains how to match two tables using Magellan. Our goal is to...
AlfiyaZi/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter4_TheGreatestTheoremNeverTold/Ch4_LawOfLargeNumbers_PyMC3.ipynb
mit
%matplotlib inline import numpy as np from IPython.core.pylabtools import figsize import matplotlib.pyplot as plt figsize( 12.5, 5 ) sample_size = 100000 expected_value = lambda_ = 4.5 poi = np.random.poisson N_samples = range(1,sample_size,100) for k in range(3): samples = poi( lambda_, sample_size ) ...
Gleiwer/kaggle_house_prices
3_Data_preparation.ipynb
gpl-3.0
import nltk import pandas as pd import math %matplotlib inline import matplotlib import matplotlib.pyplot as plt from matplotlib import gridspec from sklearn import datasets, linear_model import numpy as np from numbers import Number from sklearn import preprocessing def correlation_matrix(df,figsize=(15,15)): f...
tensorflow/docs-l10n
site/zh-cn/quantum/tutorials/hello_many_worlds.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...
huizhuzhao/jupyter_notebook
examples/keras_preprocessing_image.ipynb
mit
n_samples = 50 batch_size = 14 iterator = image.Iterator(N=n_samples, batch_size=batch_size, shuffle=True, seed=123) for ii in range(5): data = next(iterator.index_generator) print ('current_batch_size: {0}'.format(data[-1]), data) """ Explanation: class Iterator() 生成一个 index_generator,通过调用 next() 方法该生成器可以产生一串...
mauroalberti/gsf
docs/notebooks/Basic spatial data.ipynb
gpl-3.0
%load_ext autoreload %autoreload 1 """ Explanation: Basic spatial data March 2018, June 2019. Mauro Alberti. Last version: 2021-04-04 Last running version: 2021-04-24 Developement code: End of explanation """ %matplotlib inline """ Explanation: 1. Introduction gsf is a library for the processing of geometric and ge...
noppanit/machine-learning
pizza-franchise/Pizza Franchise.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt """ Explanation: Introduction We're going to explore Pizza Franshise data set from http://college.cengage.com/mathematics/brase/understandable_statistics/7e/students/datasets/slr/frames/frame.html We want ...
lukasmerten/CRPropa3
doc/pages/example_notebooks/basics/basics.v4.ipynb
gpl-3.0
from crpropa import * # simulation: a sequence of simulation modules sim = ModuleList() # add propagator for rectalinear propagation sim.add(SimplePropagation()) # add interaction modules sim.add(PhotoPionProduction(CMB())) sim.add(ElectronPairProduction(CMB())) sim.add(NuclearDecay()) sim.add(MinimumEnergy(1 * EeV)...
shngli/Data-Mining-Python
IMDB movie data visualization/IMDB visualization.ipynb
gpl-3.0
ratingsFile = open('ratings.list','r') countriesFile = open('countries.list','r') output = open('countryRating.txt','w') # Start readline() at the appropriate line while True: if countriesFile.readline() == "COUNTRIES LIST\n": break; countriesFile.readline() while True: if ratingsFile.readline() == "M...
empet/PSCourse
Monty-Hall.ipynb
bsd-3-clause
from IPython.display import YouTubeVideo YouTubeVideo('mhlc7peGlGg#t=15') """ Explanation: <center> Monty-Hall</center> Problema cunoscuta sub numele Monty Hall sau Let's make a deal este o problema de probabilitati a carei solutie pare nefireasca. Ea este legata de emisiunile/spectacolele TV cu aceste nume. Formulare...
BrownDwarf/ApJdataFrames
notebooks/BCAH2002.ipynb
mit
%pylab inline import seaborn as sns sns.set_context("notebook", font_scale=1.5) import warnings warnings.filterwarnings("ignore") import pandas as pd """ Explanation: ApJdataFrames BCAH2002 Title: Evolutionary models for low-mass stars and brown dwarfs: uncertainties and limits at very young ages Authors: BCAH Data...
afedynitch/MCEq
examples/Basic_flux.ipynb
bsd-3-clause
import matplotlib.pyplot as plt import numpy as np #import solver related modules from MCEq.core import MCEqRun import mceq_config as config #import primary model choices import crflux.models as pm """ Explanation: Simplest possible example Compute the fluxes of atmospheric leptons for a standard set of models at a f...
agdestine/machine-learning
notebook/Visualization.ipynb
mit
%matplotlib inline import os import pandas as pd import seaborn as sns import matplotlib as mpl import matplotlib.pyplot as plt # Setup context and style sns.set_context('talk') sns.set_style('whitegrid') IRIS = os.path.join("..", "data", "iris.csv") data = pd.read_csv(IRIS) """ Explanation: Multi-Dimension Vis...
mcc-petrinets/formulas
spot/tests/python/automata.ipynb
mit
a = spot.translate('(a U b) & GFc & GFd', 'BA', 'complete'); a """ Explanation: To build an automaton, simply call translate() with a formula, and a list of options to characterize the automaton you want (those options have the same name as the long options name of the ltl2tgba tool, and they can be abbreviated). End ...
lmoresi/UoM-VIEPS-Intro-to-Python
Notebooks/Numpy+Scipy/2 - Application - The Game of Life.ipynb
mit
%pylab inline import numpy as np import matplotlib.pyplot as plt start = np.array([[1,0,0,0,0,0], [0,0,0,1,0,0], [0,1,0,1,0,0], [0,0,1,1,0,0], [0,0,0,0,0,0], [0,0,0,0,0,1]]) """ Explanation: The game of life (John Conway) The u...
diegocavalca/Studies
programming/Python/tensorflow/exercises/Math_Part3_Solutions.ipynb
cc0-1.0
from __future__ import print_function import tensorflow as tf import numpy as np from datetime import date date.today() author = "kyubyong. https://github.com/Kyubyong/tensorflow-exercises" tf.__version__ np.__version__ sess = tf.InteractiveSession() """ Explanation: Math Part 3 End of explanation """ _X = np.a...
chinapnr/python_study
Python 基础课程/Python Basic Lesson 10 - 函数参数和匿名函数.ipynb
gpl-3.0
# 函数默认参数 def cal_0(money, rate=0.1): return money + money * rate print(cal_0(100)) print(cal_0(100,0.2)) print(cal_0(rate=0.3,money=100)) # 函数默认参数 def cal_1(money, bonus=1000, month=12,a=1, b=2): i = money * month + bonus return i print(cal_1(5000)) print(cal_1(5000, 2000)) print(cal_1(5000, 2000, 10...
google/starthinker
colabs/floodlight_monitor.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: CM360 Floodlight Monitor Monitor floodlight impressions specified in sheet and send email alerts. License Copyright 2020 Google LLC, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wi...
facaiy/book_notes
Reinforcement_Learing_An_Introduction/Multi-armed_Bandits/note.ipynb
cc0-1.0
reward_funcs = [ lambda size: np.random.normal(0.2, 1, size), lambda size: np.random.normal(-0.8, 1, size), lambda size: np.random.normal(1.5, 1, size), lambda size: np.random.normal(0.4, 1, size), lambda size: np.random.normal(1.2, 1, size), lambda size: np.random.normal(-1.3, 1, size), lam...
vierth/chinese_stylometry
Stanford DH Asia Python Basics.ipynb
gpl-3.0
# You can store integers x = 10 # You can store strings y = "Hi, my name is Paul" # A variable can be as long as you like. It is best to use variable names # that express what the variable is. long_variable_names_work_too = 1.3 hi = 'hello' """ Explanation: Digital Humanities Asia Workshop Stylometerics and Genre R...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/06_structured/1_explore.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'] = BUCKET os.environ['PROJECT'] = PROJECT os.environ['REGION'] = REGION %%bash if ! gsuti...
gnu-user/mcsc-6030-assignments
Assignment-03/question-1/Numerical-Quadrature-with-the-Trapezoid-Rule.ipynb
mit
import numpy as np import matplotlib.pyplot as mpl %matplotlib inline def f1(x): return 1. + x**3 a1 = 0. b1 = 2. int_true1 = (b1-a1) + (b1**4 -a1**4) / 4. print "true integral: %22.14e" % int_true1 """ Explanation: Numerical Quadrature with the trapezoid rule Numerical quadrature refers to approximating a defin...
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/6_serving_babyweight.ipynb
apache-2.0
%%bash # Check your project name export PROJECT=$(gcloud config list project --format "value(core.project)") echo "Your current GCP Project Name is: "$PROJECT import os os.environ["BUCKET"] = "your-bucket-id-here" # Recommended: use your project name """ Explanation: LAB 6: Serving baby weight predictions Learning O...
crowd-course/datascience
evaluating estimator performance using cross-validation.ipynb
mit
import numpy as np from sklearn import cross_validation from sklearn import datasets from sklearn import svm iris = datasets.load_iris() iris.data.shape, iris.target.shape ((150, 4), (150,)) """ Explanation: Learning the parameters of a prediction function and testing it on the same data is a methodological mistake: ...
gururajl/deep-learning
intro-to-tensorflow/intro_to_tensorflow.ipynb
mit
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
whitead/numerical_stats
unit_7/lectures/lecture_2.ipynb
gpl-3.0
%matplotlib inline import random import numpy as np import matplotlib.pyplot as plt from math import sqrt, pi import scipy import scipy.stats plt.style.use('seaborn-whitegrid') !pip install --user pydataset """ Explanation: 1D Data Analysis, Histograms, Boxplots, and Violin Plots Unit 7, Lecture 2 Numerical Methods ...
watsonyanghx/CS231n
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...
adelavega/neurosynth-mfc
profiles.ipynb
mit
# Load a neurosynth dataset. If you generate your own dataset, you can try this with fewer or greater number of topics from neurosynth.base.dataset import Dataset dataset = Dataset.load("data/neurosynth_60_0.4.pkl") from sklearn.naive_bayes import GaussianNB from classification import RegionalClassifier from sklearn.m...
adrn/thejoker
docs/examples/Strader-circular-only.ipynb
mit
from astropy.io import ascii from astropy.time import Time import astropy.units as u import matplotlib.pyplot as plt %matplotlib inline import numpy as np import pymc3 as pm import pymc3_ext as pmx import exoplanet.units as xu import exoplanet as xo from pymc3_ext.distributions import Angle import corner import arviz ...
steinam/teacher
jup_notebooks/data-science-ipython-notebooks-master/numpy/02.07-Fancy-Indexing.ipynb
mit
import numpy as np rand = np.random.RandomState(42) x = rand.randint(100, size=10) print(x) """ Explanation: <!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> This notebook contains an excerpt from the Python Data Science Handbook by Jake VanderPlas; the content...
csdms/dakota
examples/hydrotrend-centered-parameter-study.ipynb
mit
from dakotathon import Dakota """ Explanation: <img src="http://csdms.colorado.edu/mediawiki/images/CSDMS_high_res_weblogo.jpg"> Centered Parameter Study with HydroTrend HydroTrend is a numerical model that creates synthetic river discharge and sediment load time series as a function of climate trends and basin morpho...
kubernetes-client/python
examples/notebooks/intro_notebook.ipynb
apache-2.0
from kubernetes import client, config """ Explanation: Managing kubernetes objects using common resource operations with the python client Some of these operations include; create_xxxx : create a resource object. Ex create_namespaced_pod and create_namespaced_deployment, for creation of pods and deployments respecti...
tuanavu/coursera-university-of-washington
machine_learning/2_regression/assignment/week2/week-2-multiple-regression-assignment-2-blank.ipynb
mit
import graphlab """ Explanation: Regression Week 2: Multiple Regression (gradient descent) In the first notebook we explored multiple regression using graphlab create. Now we will use graphlab along with numpy to solve for the regression weights with gradient descent. In this notebook we will cover estimating multiple...
science-of-imagination/nengo-buffer
Project/manipulation_combination_training.ipynb
gpl-3.0
import matplotlib.pyplot as plt %matplotlib inline import nengo import numpy as np import scipy.ndimage import matplotlib.animation as animation from matplotlib import pylab from PIL import Image import nengo.spa as spa import cPickle import random from nengo_extras.data import load_mnist from nengo_extras.vision impo...
phoebe-project/phoebe2-docs
2.3/tutorials/vgamma.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.3,<2.4" """ Explanation: Systemic Velocity Setup Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab). End of explanation """ import phoebe from phoebe import u # units import numpy as np impo...
cpcloud/ibis
docs/tutorial/01-Introduction-to-Ibis.ipynb
apache-2.0
import ibis """ Explanation: Introduction to Ibis Ibis is a Python framework to access data and perform analytical computations from different sources, in a standard way. In a way, you can think of Ibis as writing SQL in Python, with a focus on analytics, more than simply accessing data. And aside from SQL databases, ...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/02_execution/WIN-190410151110.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Basic PowerShell Execution Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/04/10 | | modification date | 2020/09/20 | | playbook related | [] ...
ptitjano/bokeh
examples/howto/charts/donut.ipynb
bsd-3-clause
d = Donut([2, 4, 5, 2, 8]) show(d) """ Explanation: Generic Examples Values with implied index End of explanation """ d = Donut(pd.Series([2, 4, 5, 2, 8], index=['a', 'b', 'c', 'd', 'e'])) show(d) """ Explanation: Values with Explicit Index End of explanation """ autompg.head() """ Explanation: Autompg Data Take...
wzhfy/spark
python/docs/source/getting_started/quickstart.ipynb
apache-2.0
from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() """ Explanation: Quickstart This is a short introduction and quickstart for the PySpark DataFrame API. PySpark DataFrames are lazily evaluated. They are implemented on top of RDDs. When Spark transforms data, it does not immediately compu...
mdalvi/financial-analysis-and-algo-trading
time_series_analysis/time_series_analysis_notes.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import statsmodels.api as sm # Importing built-in datasets in statsmodels df = sm.datasets.macrodata.load_pandas().data df.head() print(sm.datasets.macrodata.NOTE) df.head() df.tail() # statsmodels.timeseriesanalysis.dateto...
gvasold/gdp17
basics/basics_2.ipynb
apache-2.0
# Im Notebook basics_1.ipynb haben wir die Zeilen aus der Datei # names_short.txt in eine Liste von Zeilen namens clean_names eingelesen. # Das tun wir noch einmal, weil wir diese Liste weiterhin brauchen. with open('data/vornamen/names_short.txt', encoding='utf-8') as fh: clean_names = [line.rstrip() for line in f...
dsavransky/MAE2030
Notebooks/3D coords.ipynb
mit
from miscpy.utils.sympyhelpers import * init_printing() th,ph,psi,thd,phd,psid = symbols('theta,phi,psi,thetadot,phidot,psidot') w1,w2,w3 = symbols('omega_1,omega_2,omega_3') """ Explanation: 3D Coordinates and Kinematics Derivations Preamble stuff (can ignore) End of explanation """ cCi = Matrix(([cos(th),sin(th),...
AllenDowney/ThinkStats2
solutions/chap14soln.ipynb
gpl-3.0
from os.path import basename, exists def download(url): filename = basename(url) if not exists(filename): from urllib.request import urlretrieve local, _ = urlretrieve(url, filename) print("Downloaded " + local) download("https://github.com/AllenDowney/ThinkStats2/raw/master/code/th...
griffinfoster/fundamentals_of_interferometry
2_Mathematical_Groundwork/2_14_CLEAN_in_1D.ipynb
gpl-2.0
import warnings warnings.filterwarnings('ignore') import numpy as np import matplotlib.pyplot as plt from scipy import optimize as opt import scipy.signal as scg %matplotlib inline from ipywidgets import interact """ Explanation: Outline Glossary Mathematical Background Previous: 2.13 Spherical Trigonometry Next: 2....
tanmay987/deepLearning
intro-to-tflearn/TFLearn_Digit_Recognition_Solution.ipynb
mit
# Import Numpy, TensorFlow, TFLearn, and MNIST data import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist """ Explanation: Handwritten Number Recognition with TFLearn and MNIST In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9. This...
mdenker/elephant
doc/tutorials/parallel.ipynb
bsd-3-clause
import numpy as np import quantities as pq from elephant.spike_train_generation import homogeneous_poisson_process from elephant.statistics import mean_firing_rate, time_histogram from elephant.parallel import SingleProcess, ProcessPoolExecutor try: import mpi4py from elephant.parallel.mpi import MPIPoolExec...
JamesSample/icpw
toc_trends_oct_2016.ipynb
mit
# Import custom functions and connect to db resa2_basic_path = (r'C:\Data\James_Work\Staff\Heleen_d_W\ICP_Waters\Upload_Template' r'\useful_resa2_code.py') resa2_basic = imp.load_source('useful_resa2_code', resa2_basic_path) engine, conn = resa2_basic.connect_to_resa2() """ Explanation: TOC trend...
pycam/python-functions-and-modules
python_fm_3.ipynb
unlicense
import math print(math.pi, math.e) """ Explanation: Working with Python: functions and modules Session 3: Modules Importing modules and libraries Python file library Exercise 3.1 Using the csv module Exercise 3.2 Create your own module Exercise 3.3 Exercise 3.4 Importing modules and libraries Like other laguages, Py...
Bastien-Brd/pi-tuner
pitch_detection_from_samples.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Implementing and comparing several pitch detection methods on sample files For simplicity I am using the Anaconda distribution on my Macbook Pro for this notebook. The purpose is to first experiment here with s...
elektrobohemian/courses
hu_ibi/clustering_demo.ipynb
mit
!pip install jellyfish # The %... is an iPython thing, and is not part of the Python language. # In this case we're just telling the plotting library to draw things on # the notebook, instead of on a separate window. %matplotlib inline # See all the "as ..." contructs? They're just aliasing the package names. # That ...
McIntyre-Lab/ipython-demo
mahalanobis_distance.ipynb
gpl-2.0
import pandas as pd import numpy as np import scipy as sp import scipy.stats as stats import matplotlib.pyplot as plt import cPickle as pickle import os %matplotlib inline """ Explanation: Mahalanobis Distance This notebook shows how I think we should do Mahalanobis distance for the SECIM project. From JMP Website: T...
QuantCrimAtLeeds/PredictCode
examples/Networks/Case study Chicago/Hotspotting.ipynb
artistic-2.0
%matplotlib inline import matplotlib.pyplot as plt import matplotlib.collections import numpy as np import open_cp.network import open_cp.geometry import open_cp.network_hotspot import open_cp.logger open_cp.logger.log_to_true_stdout() import pickle, lzma with lzma.open("input_old.pic.xz", "rb") as f: timed_point...
amadeuspzs/travelTime
analysis.ipynb
mit
%matplotlib inline import pandas as pd, matplotlib.pyplot as plt, matplotlib.dates as dates, math from datetime import datetime from utils import find_weeks, find_days # custom from pytz import timezone from detect_peaks import detect_peaks from ipywidgets import interact, interactive, fixed, interact_manual """ Expla...
vicente-gonzalez-ruiz/YAPT
03-IO/19-database_access.ipynb
cc0-1.0
# Source: Manuel Torres. Universidad de Almería. import pymysql # Establecemos la conexion con la base de datos bd = pymysql.connect("localhost", "root", "gebd", "RRHH") # Preparamos el cursor que nos va a ayudar a realizar las operaciones con la base de datos cursor = bd.cursor() # Ejecutamos un query SQL usando...
gregorjerse/rt2
2015_2016/complexes/Alpha shapes vs. Vietoris Rips.ipynb
gpl-3.0
import dionysus import math from random import random from matplotlib import pyplot def generate_circle(n, radius, max_noise): """ Generate n points on a sphere with the center in the point (0,0) with the given radius. Noise is added so that the distance from the generated point to some poin...
gxxjjj/QuantEcon.py
solutions/lakemodel_solutions.ipynb
bsd-3-clause
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from quantecon.models import LakeModel alpha = 0.012 lamb = 0.2486 b = 0.001808 d = 0.0008333 g = b-d N0 = 100. e0 = 0.92 u0 = 1-e0 T = 50 """ Explanation: Lake Model Solutions Excercise 1 We begin by initializing the variables and import the nece...
arjunbazinga/arjunbazinga.github.io
_notebooks/2017-11-12-multi-armed-bandits.ipynb
apache-2.0
# Importing numpy for math, and matplotlib for plots import matplotlib.pyplot as plt import numpy as np %matplotlib inline """ Explanation: Multi Armed Bandit Problem An introduction to multi-armed bandits toc: true badges: true comments: true categories: [AI] image: images/chart-preview.png Problem Description I...
rahulkgup/deep-learning-foundation
gan_mnist/Intro_to_GANs_Exercises.ipynb
mit
%matplotlib inline import pickle as pkl import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data') """ Explanation: Generative Adversarial Network In this notebook, we'll be building a generativ...
ljwolf/ucgis_workshop_2016
notebooks/06 - Spatial Dynamics.ipynb
mit
f.header """ Explanation: To determine what is in the file, check the header attribute on the file object: End of explanation """ name = f.by_col('Name') name """ Explanation: Ok, lets pull in the name variable to see what we have End of explanation """ y1929 = f.by_col('1929') y1929 """ Explanation: Now obtai...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/GUI/.ipynb_checkpoints/4 - Widget List-checkpoint.ipynb
apache-2.0
import ipywidgets as widgets # Show all available widgets! widgets.Widget.widget_types.values() """ Explanation: Widget List This lecture will serve as a reference for widgets, providing a list of the GUI widgets available! Complete list For a complete list of the GUI widgets available to you, you can list the regist...
karlstroetmann/Artificial-Intelligence
Python/6 Classification/Digit-Recognition-SVM.ipynb
gpl-2.0
import gzip import pickle import numpy as np import sklearn.svm as svm """ Explanation: Digit Recognition using a Support Vector Machine End of explanation """ def load_data(): with gzip.open('../mnist.pkl.gz', 'rb') as f: train, validate, test = pickle.load(f, encoding="latin1") X_train = np.a...
tmilliman/phenocam_notebooks
python-vegindex_CLI/Using_the_python-vegindex_package.ipynb
cc0-1.0
%%bash generate_roi_timeseries --help """ Explanation: Using the python-vegindex package command line tools The python-vegindex package can be used to extract greeness-index values from PhenoCam Network images. In this notebook we'll download some images and a region-of-interest (ROI) mask list and extract the greene...
ES-DOC/esdoc-jupyterhub
notebooks/inpe/cmip6/models/sandbox-3/seaice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'inpe', 'sandbox-3', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: INPE Source ID: SANDBOX-3 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radi...
tensorflow/docs-l10n
site/ko/tutorials/keras/classification.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...
verilylifesciences/site-selection-tool
notebooks/trial_specification_demo.ipynb
bsd-3-clause
import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns sns.set_style('ticks') import functools import importlib.resources import numpy as np import os import pandas as pd pd.plotting.register_matplotlib_converters() import xarray as xr from IPython.display import display # bsst imports from b...
mne-tools/mne-tools.github.io
0.20/_downloads/c0b7aacae8a68010257e46e5ec530f2e/plot_compute_mne_inverse_raw_in_label.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import matplotlib.pyplot as plt import mne from mne.datasets import sample from mne.minimum_norm import apply_inverse_raw, read_inverse_operator print(__doc__) data_path = sample.data_path() fname_inv = data_path + '/MEG/sample/s...
fabianrost84/Rost-Rodrigo-Albors-et-al-2016
calculations/number_quiescent_cells.ipynb
bsd-3-clause
import pandas as pd import scipy as sp from scipy import stats import matplotlib.pyplot as plt %matplotlib inline %config InlineBackend.figure_format = 'svg' exec(open('settings.py').read(), globals()) cell_numbers = pd.read_csv('../data/cell_number_data.csv') outgrowth = pd.read_csv('../data/outgrowth.csv') lcell = ...
mavillan/SciProg
08_parallelism/08_parallelism.ipynb
gpl-3.0
import numpy as np import matplotlib.pyplot as plt import sys import memory_profiler %load_ext memory_profiler """ Explanation: <h1 align="center">Scientific Programming in Python</h1> <h2 align="center"> Topic 8: Basics of Parallelism </h2> Notebook created by Martín Villanueva - martin.villanueva@usm.cl - DI UTFSM ...
brian-rose/env-415-site
notes/RadiativeConvectiveEquilibrium.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt import netCDF4 as nc import climlab """ Explanation: ENV / ATM 415: Climate Laboratory Radiative- and Radiative-Convective Equilibrium with climlab Thursday March 31, 2016 End of explanation """ # Test in a 2-layer atmosphere col = climlab.GreyRa...
jo-tez/aima-python
neural_nets.ipynb
mit
from learning import * from notebook import psource, pseudocode """ Explanation: NEURAL NETWORKS This notebook covers the neural network algorithms from chapter 18 of the book Artificial Intelligence: A Modern Approach, by Stuart Russel and Peter Norvig. The code in the notebook can be found in learning.py. Execute t...
Danghor/Algorithms
Python/Chapter-09/Topological-Sorting.ipynb
gpl-2.0
def topo_sort(T, D): Parents = { t: set() for t in T } # dictionary of parents Children = { t: set() for t in T } # dictionary of children for s, t in D: Children[s].add(t) Parents [t].add(s) Orphans = { t for (t, P) in Parents.items() if len(P) == 0 } Sorted = [] count = 0...
bataeves/kaggle
sber/Model.ipynb
unlicense
def align_to_lb_score(df): # https://www.kaggle.com/c/sberbank-russian-housing-market/discussion/32717 df = df.copy() trainsub = df[df.timestamp < '2015-01-01'] trainsub = trainsub[trainsub.product_type=="Investment"] ind_1m = trainsub[trainsub.price_doc <= 1000000].index ind_2m = trainsub[trai...
MingChen0919/learning-apache-spark
notebooks/06-machine-learning/classification/decision-tree-classification.ipynb
mit
from pyspark import SparkContext sc = SparkContext(master = 'local') from pyspark.sql import SparkSession spark = SparkSession.builder \ .appName("Python Spark SQL basic example") \ .config("spark.some.config.option", "some-value") \ .getOrCreate() """ Explanation: Decision Tree Classifi...
nud3l/smart-contract-analysis
analysis/contract-analysis.ipynb
mit
import matplotlib.mlab as mlab import matplotlib.pyplot as plt import matplotlib as mpl import pymongo from pprint import pprint mpl.rcParams['figure.dpi'] = 300 mpl.rcParams['savefig.dpi'] = 300 mpl.rcParams['axes.titlesize'] = "small" mpl.rcParams['axes.labelsize'] = "large" db = pymongo.MongoClient() """ Explanat...
nagordon/mechpy
tutorials/design.ipynb
mit
# setup import numpy as np import sympy as sp import scipy from pprint import pprint sp.init_printing(use_latex='mathjax') import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (12, 8) # (width, height) plt.rcParams['font.size'] = 14 plt.rcParams['legend.fontsize'] = 16 from matplotlib import patches #ge...
mjbommar/scotus-uncertainty
simulate_baseline_performance.ipynb
bsd-2-clause
""" Setup the outcome map. Rows correspond to vote types. Columns correspond to disposition types. Element values correspond to: * -1: no precedential issued opinion or uncodable, i.e., DIGs * 0: affirm, i.e., no change in precedent * 1: reverse, i.e., change in precent """ outcome_map = pandas.DataFrame([[-1, 0,...
boada/planckClusters
analysis_ir/notebooks/04b. Understand LF.ipynb
mit
cosmo = LambdaCDM(H0=70, Om0=0.3, Ode0=0.7, Tcmb0=2.725) """ Explanation: Setup Cosmology End of explanation """ # check to make sure we have defined the bpz filter path if not os.getenv('EZGAL_FILTERS'): os.environ['EZGAL_FILTERS'] = (f'{os.environ["HOME"]}/Projects/planckClusters/MOSAICpipe/bpz-1.99.3/FILTER/'...
quantumlib/ReCirq
docs/qaoa/routing_with_tket.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...