repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
StingraySoftware/notebooks
Simulator/Lag Analysis.ipynb
mit
import numpy as np from matplotlib import pyplot as plt %matplotlib inline """ Explanation: Contents This notebook analyses lag-frequency spectrums of the light curves simulated through impulse response approach. First, a simple case with delta impulse response is covered. Subsequently, an energy-dependent impulse res...
wbinventor/openmc
examples/jupyter/tally-arithmetic.ipynb
mit
import glob from IPython.display import Image import numpy as np import openmc """ Explanation: This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) using the Python API in order to create derived tallies. Since no covariance information is obtained, it is assumed that tallies are...
karst87/ml
dev/pyml/datacamp/kaggle-python-tutorial-on-machine-learning/02_predicting-with-decision-trees.ipynb
mit
# Import the Pandas library import pandas as pd kaggle_path = "http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/" # Load the train and test datasets to create two DataFrames train_url = kaggle_path + "train.csv" train = pd.read_csv(train_url) test_url = kaggle_path + "test.csv" test = pd.read_csv(test_url) ...
zzsza/TIL
python/bayesian-optimization.ipynb
mit
!pip3 install bayesian-optimization """ Explanation: 베이지안 최적화 gaussian process를 사용한 bayesian global optimization library 최대한 적은 iteration으로 최대값을 구하는 것이 목표 원리 최적화하려는 함수를 가장 살 설명하는 함수의 사후 분포(가우시안 프로세스)를 구성해 작동 관측치가 많아지면 사후 분포가 개선되고 파라미터 공간에서 탐색할 가치가 있는 영역과 그렇지 않은 영역이 더 명확해짐 <img src="https://github.com/fmfn/Bayesia...
InsightLab/data-science-cookbook
2019/09-clustering/cl_AlefCarneiro.ipynb
mit
# import libraries # linear algebra import numpy as np # data processing import pandas as pd # data visualization from matplotlib import pyplot as plt # sys - to get maximum float value import sys # load the data with pandas url = 'https://raw.githubusercontent.com/InsightLab/data-science-cookbook/master/2019/09-c...
yafeunteun/wikipedia-spam-classifier
notebooks/feature_engineering.ipynb
mit
import sys sys.path.append("/usr/local/lib/python3.4/dist-packages/") sys.path.append("/usr/local/lib/python3.4/dist-packages/revscoring/") sys.path.append("/usr/local/lib/python3.4/dist-packages/more_itertools/") sys.path.append("/usr/local/lib/python3.4/dist-packages/deltas/") !sudo pip3 install dependencies deltas ...
vsoch/singularity-python
examples/shub/paper/compare_builds.ipynb
agpl-3.0
import numpy import os import pickle container_names = ['vsoch/singularity-hello-world', 'researchapps/quantum_state_diffusion', 'vsoch/pe-predictive'] base = "/home/vanessa/Documents/Work/singularity/hub" results = pickle.load(open('%s/results.pkl' %base,'rb')) df = results['df'...
adamamiller/PS1_star_galaxy
PS1casjobs/WeightsComparison.ipynb
mit
import numpy as np import pandas as pd from astropy.io import fits import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import describe, iqr %matplotlib notebook hst_data = fits.getdata("HST_COSMOS_features_adamamiller.fit") star = np.where(hst_data['MU_CLASS'] == 2) gal = np.where(hst_data['MU_CLASS...
KolesovDmitry/remote_sensing
slides/kazan-dsm/RemoteSensingIntro.ipynb
unlicense
import numpy as np import pandas as pd points = pd.read_csv('rand.txt') points.tail() y = points["class"] X = points[['r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7', 'r8', 'r9', 'r10', 'r11']] # Разбиваем на обучающее и тестовое множества: from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_tes...
mldbai/mldb
container_files/tutorials/Using pymldb Tutorial.ipynb
apache-2.0
from pymldb import Connection mldb = Connection("http://localhost") """ Explanation: Using pymldb Tutorial Interactions with MLDB occurs via a REST API. Interacting with a REST API over HTTP from a Notebook interface can be a little bit laborious if you're using a general-purpose Python library like requests directly,...
YeEmrick/learning
cs231/assignment/assignment2/FullyConnectedNets.ipynb
apache-2.0
# As usual, a bit of setup from __future__ import print_function import time import numpy as np import matplotlib.pyplot as plt from cs231n.classifiers.fc_net import * from cs231n.data_utils import get_CIFAR10_data from cs231n.gradient_check import eval_numerical_gradient, eval_numerical_gradient_array from cs231n.solv...
jpilgram/phys202-2015-work
assignments/assignment11/OptimizationEx01.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Optimization Exercise 1 Imports End of explanation """ # YOUR CODE HERE #raise NotImplementedError() def hat(x, a, b): return -a*x**2+b*x**4 assert hat(0.0, 1.0, 1.0)==0.0 assert hat(0.0, 1.0, 1.0...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_dics_source_power.ipynb
bsd-3-clause
# Author: Roman Goj <roman.goj@gmail.com> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import mne from mne.datasets import sample from mne.time_frequency import csd_epochs from mne.beamformer import dics_source_power print(__doc__) data_path = sample.data_path() raw_fname = data_pa...
phungkh/phys202-2015-work
days/day19/FittingModels.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy import optimize as opt from IPython.html.widgets import interact """ Explanation: Fitting Models Learning Objectives: learn to fit models to data using linear and non-linear regression. This material is licensed under the MIT license and...
jackkwong/python-yellow-page-scraping
marketing scraping project.ipynb
mit
from IPython.core.display import display, HTML import urllib2 import bs4 import urlparse import pandas as pd import numpy as np """ Explanation: Requirements From this url http://www.5metal.com.hk/ajax/pager/company_fea?view_amount=36&amp;page=1, We get a list of urls for detail pages like http://www.5metal.com.hk/won...
travc/paper-Predicted-MF-Quarantine-Length-Data-and-Code
code/Batch fetch and process temperatures.ipynb
mit
# boilerplate includes import sys import os import numpy as np import matplotlib as mpl #mpl.use('nbagg') import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import Axes3D #import mpld3 # for outputting interactive html figures import pandas as pd import seaborn as sns import ish_parser import gzip import ft...
kimkipyo/dss_git_kkp
통계, 머신러닝 복습/160627월_21일차_PCA Principal Component Analysis/2.고유분해와 특이값 분해.ipynb
mit
w, V = np.linalg.eig(np.array([[1, -2], [2, -3]])) w V """ Explanation: 고유분해와 특이값 분해 정방 행렬 $A$에 대해 다음 식을 만족하는 단위 벡터 $v$, 스칼라 $\lambda$을 여러 개 찾을 수 있다. $$ Av = \lambda v $$ $ A \in \mathbf{R}^{M \times M} $ 정방행렬 $ \lambda \in \mathbf{R} $ $ v \in \mathbf{R}^{M} $ 이러한 실수 $\lambda$를 고유값(eigenvalue), 단위 벡터 $v$ ...
DKolmas/Python-NeuralNet-SimpleEx
Simple_Neural_Network_example.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...
chagaz/ma2823_2016
lab_notebooks/Lab 2 2016-09-21 Introduction to scikit-learn.ipynb
mit
import numpy as np # Load the gene expression data X = np.loadtxt('data/small_Endometrium_Uterus.csv', delimiter=',', skiprows=1, usecols=range(1, 3001)) # Load the labels (Python ) y = np.loadtxt('data/small_Endometrium_Uterus.csv', delimiter=',', skiprows=1, usecols=[3001], dtype='s...
briennakh/BIOF509
Wk09/Wk09_Dataset-preprocessing.ipynb
mit
import matplotlib.pyplot as plt import numpy as np import pandas as pd %matplotlib inline """ Explanation: Week 9 - Dataset preprocessing Before we utilize machine learning algorithms we must first prepare our dataset. This can often take a significant amount of time and can have a large impact on the performance of ...
UWashington-Astro300/Astro300-A17
Python_Astroplan_Constraints.ipynb
mit
import numpy as np from astropy.table import QTable import astropy.units as u from astropy.time import Time from astropy.coordinates import SkyCoord, EarthLocation import pytz from astroplan import Observer, FixedTarget import warnings warnings.filterwarnings('ignore', category=Warning) """ Explanation: Planning ob...
fujii-team/GPinv
notebooks/Abel_inversion.ipynb
apache-2.0
import numpy as np %matplotlib inline import matplotlib.pyplot as plt import tensorflow as tf import sys # In ../testing/ dir, we prepared a small script for generating the above matrix A sys.path.append('../testing/') import make_LosMatrix # Import GPinv import GPinv """ Explanation: An example of the Nonlinear infe...
statsmodels/statsmodels.github.io
v0.13.2/examples/notebooks/generated/statespace_sarimax_stata.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 from datetime import datetime import requests from io import BytesIO # Register converters to avoid warnings pd.plotting.register_matplotlib_converters() plt.rc("figure", ...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/Statements Assessment Test.ipynb
apache-2.0
st = 'Print only the words that start with s in this sentence' #Code here """ Explanation: Statements Assessment Test Lets test your knowledge! Use for, split(), and if to create a Statement that will print out words that start with 's': End of explanation """ #Code Here """ Explanation: Use range() to print all ...
dereneaton/ipyrad
tests/cookbook-raxml-pedicularis.ipynb
gpl-3.0
## conda install ipyrad -c ipyrad ## conda install toytree -c eaton-lab ## conda install raxml -c bioconda """ Explanation: Cookbook: RAxML analyses in a notebook As part of the ipyrad.analysis toolkit we've created convenience functions for easily running common RAxML commands. This can be useful when you want to run...
CloverHealth/pycon2017
bayesian_analysis/em_upcoding/Pycon 2017 - EM Upcoding.ipynb
bsd-3-clause
import os import sys import numpy as np import pandas as pd import sqlalchemy as sa from random import randint import statsmodels.formula.api as sm %matplotlib inline import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.lines as mlines matplotlib.rcParams['figure...
jorisvandenbossche/DS-python-data-analysis
notebooks/case4_air_quality_processing.ipynb
bsd-3-clause
import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: <p><font size="6"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p> © 2021, Joris Van den Bossche and Stijn Van Hoey (&#106;&#111;&#114;&#105;&#115;&#118;&#97;&#110;&#100;&#101;&#110;&#98;&#111...
ecervera/mindstorms-nb
nxt/motors/index.ipynb
mit
from functions import connect, forward, backward, stop, left, right, disconnect from time import sleep robot = 12 # canvieu pel número del vostre robot connect(robot) # i executeu, polsant Majúscules + Enter """ Explanation: Moviments bàsics del robot <img src="img/lego_motor.jpg" align="right"> El robot té dos...
jason-neal/equanimous-octo-tribble
Notebooks/JobLib/Joblib_for_Daniel.ipynb
mit
import time import tempfile import shutil import os import numpy as np from joblib import Parallel, delayed from joblib import load, dump def griddata(gridpoints, tlayer, teff_logg_feh, method='linear', rescale=True): """ Do what ever it does""" # put a short wait. time.sleep(0.5) return np.sum(tlayer...
mne-tools/mne-tools.github.io
0.23/_downloads/d8a6d02146c5c075611a652218e020ad/30_reading_fnirs_data.ipynb
bsd-3-clause
import numpy as np import pandas as pd import mne """ Explanation: Importing data from fNIRS devices MNE includes various functions and utilities for reading NIRS data and optode locations. fNIRS devices consist of light sources and light detectors. A channel is formed by source-detector pairs. MNE stores the location...
awagner-mainz/notebooks
gallery/TextProcessing_Solorzano.ipynb
mit
# This is the path to our file bigsourcefile = 'Solorzano/Sections_I.1_TA.txt' # We use a variable 'input' for keeping its contents. input = open(bigsourcefile, encoding='utf-8').readlines() # Just for information, let's see the first 10 lines of the file. input[0:10] # actually, since python starts counting with '0...
giacomov/astromodels
examples/Model_tutorial.ipynb
bsd-3-clause
from astromodels import * """ Explanation: Model tutorial In this tutorial we show how to build a simple model with two point sources, how to save it for later use, and re-load it back. We will also plot the spectra of the two point sources, with their components. See the documents about creating and getting informati...
ageron/ml-notebooks
extra_tensorflow_reproducibility.ipynb
apache-2.0
from IPython.display import IFrame IFrame(src="https://www.youtube.com/embed/Ys8ofBeR2kA", width=560, height=315, frameborder="0", allowfullscreen=True) """ Explanation: TensorFlow Reproducibility This notebook explains how to get fully reproducible code with TensorFlow. <table align="left"> <td> <a target="_bla...
microsoft/dowhy
docs/source/example_notebooks/dowhy_multiple_treatments.ipynb
mit
import numpy as np import pandas as pd import logging import dowhy from dowhy import CausalModel import dowhy.datasets import econml import warnings warnings.filterwarnings('ignore') data = dowhy.datasets.linear_dataset(10, num_common_causes=4, num_samples=10000, num_instruments=0...
phanrahan/magmathon
notebooks/tutorial/coreir/Add.ipynb
mit
import ast_tools from ast_tools.transformers.loop_unroller import unroll_for_loops from ast_tools.passes import begin_rewrite, end_rewrite, loop_unroll @m.circuit.combinational def full_adder(A: m.Bit, B: m.Bit, C: m.Bit) -> (m.Bit, m.Bit): return A ^ B ^ C, A & B | B & C | C & A # sum, carry @m.circuit.combinat...
Mayreck/Lawl
Mayreck_style_transfer.ipynb
gpl-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
google/intelligent_annotation_dialogs
exp1_fixed_strategies_IAD_prob.ipynb
apache-2.0
import matplotlib.pyplot as plt import numpy as np from __future__ import division from __future__ import print_function import math import gym from gym import spaces import pandas as pd from sklearn import linear_model, ensemble, neural_network, model_selection, ensemble from sklearn.neural_network import MLPClassif...
phoebe-project/phoebe2-docs
development/examples/mesh_wd.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" """ Explanation: Wilson-Devinney Style Meshing NOTE: Wilson-Devinney Style meshing requires developer mode in PHOEBE and is meant to be used for testing, not used for science. Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if runn...
tjmahr/DeepLearning
FirstSteps.ipynb
gpl-2.0
%load_ext version_information %version_information theano, numpy """ Explanation: First Steps With Theano In which I practice some numpy and learn the boilerplate for writing Theano functions. End of explanation """ import numpy as np my_matrix = np.asarray([[1., 2], [3, 4], [5, 6]]) my_matrix """ Explanation: NumP...
BrainIntensive/OnlineBrainIntensive
resources/nipype/nipype_tutorial/notebooks/basic_import_workflows.ipynb
mit
from nipype.workflows.fmri.fsl.preprocess import create_susan_smooth smoothwf = create_susan_smooth() """ Explanation: Reusable workflows Nipype doesn't just allow you to create your own workflows. It also already comes with predefined workflows, developed by the community, for the community. For a full list of all wo...
dsblank/ProgLangBook
Chapter 05 - Interpreting Scheme in Python.ipynb
gpl-3.0
def tokenizer(string): """ Takes a string and segments it into parts. We break strings up by brackets, and whitespace. Returns a Python list of strings. """ retval = [] current = "" for i in range(len(string)): if string[i] in ["(", "[", ")", "]"]: if current: ...
midnighteuler/projecteuler
src/Prob2.ipynb
gpl-2.0
# The values of a and b: a = (1.0 + sqrt(5.0))/2.0 b = (1.0 - sqrt(5.0))/2.0 print "a =",a, "b =",b, "\n" def fib_ith(i): return (a**i - b**i)/sqrt(5.0) #for i in range(1,10): # print fib_ith(i) def fib_even_sum_brute(N): s = 0 i = 3 i_f = fib_ith(i) while i_f < N: s += i_f #pri...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/production_ml/labs/post_training_quant.ipynb
apache-2.0
# Importing necessary modules import logging logging.getLogger("tensorflow").setLevel(logging.DEBUG) import tensorflow as tf from tensorflow import keras import numpy as np import pathlib """ Explanation: Post-training dynamic range quantization Learning Objectives 1. We will learn how to train a TensorFlow model. ...
GoogleCloudPlatform/asl-ml-immersion
notebooks/building_production_ml_systems/solutions/3_kubeflow_pipelines.ipynb
apache-2.0
!pip3 install --user kfp --upgrade """ Explanation: Kubeflow pipelines Learning Objectives: 1. Learn how to deploy a Kubeflow cluster on GCP 1. Learn how to create a experiment in Kubeflow 1. Learn how to package you code into a Kubeflow pipeline 1. Learn how to run a Kubeflow pipeline in a repeatable and trac...
aemerick/galaxy_analysis
physics_data/UVB/grackle_tables/photo.ipynb
mit
import h5py from matplotlib import pyplot %matplotlib inline import numpy as np LW_model = 'Qin2020' pyplot.rcParams['figure.figsize'] = (10, 6) pyplot.rcParams['font.size'] = 14 from make_table import k31_JW2012, k31_RFT14, k31_Qin2020 def interpvals(xtab, ytab, x, log=True): i = np.digitize(x, xtab) - 1 i...
linglaiyao1314/maths-with-python
07-sympy.ipynb
mit
import sympy sympy.init_printing() """ Explanation: In standard mathematics we routinely write down abstract variables or concepts and manipulate them without ever assigning specific values to them. An example would be the quadratic equation \begin{equation} a x^2 + b x + c = 0 \end{equation} and its roots $x_{\pm}$...
kimkipyo/dss_git_kkp
Python 복습/15일차.목_serialize, SQL실습/15일차_5T_데이터 분석을 위한 SQL 실습 (4) - SQL Advanced.ipynb
mit
import pymysql db = pymysql.connect( "db.fastcamp.us", "root", "dkstncks", "sakila", charset='utf8', ) rental_df = pd.read_sql("SELECT * FROM rental;", db) inventory_df = pd.read_sql("SELECT * FROM inventory;", db) film_df = pd.read_sql("SELECT * FROM film;", db) film_category_df = pd.read_sql("SE...
doingmathwithpython/moremathwithpython
misc/fibonacci_miles_km/Fibonacci Miles and Kilometers.ipynb
mit
def plot_fibo_ratio(series): ratios = [] for i in range(len(series)-1): ratios.append(series[i+1]/series[i]) plt.plot(ratios, 'b*') plt.ylabel('Ratio') plt.xlabel('No.') def plot_km_miles_ratio(kms): miles_km = [1.6094*km/km for km in kms] plt.plot(miles_km, 'ro') num = 100 series...
peterwittek/pelican-ipynb
tests/pelican/content/with-meta-file.ipynb
apache-2.0
a = 1 a b = 'pew' b %matplotlib inline import matplotlib.pyplot as plt from pylab import * x = linspace(0, 5, 10) y = x ** 2 figure() plot(x, y, 'r') xlabel('x') ylabel('y') title('title') show() import numpy as np num_points = 130 y = np.random.random(num_points) plt.plot(y) """ Explanation: Lorem ipsum dol...
mapattacker/cheatsheets
python/network_basics.ipynb
mit
import psycopg2 import pandas as pd import networkx as nx import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline conn = psycopg2.connect(database="postgres", user="postgres", password="***", host="127.0.0.1", port="5432") query = """SELECT fromnode, tonode, distance from edges""" df = pd.read_sql_qu...
superliaoyong/plist-forsource
python 第五课课件.ipynb
apache-2.0
import pandas as pd %matplotlib inline """ Explanation: 人生苦短,我用python 泰坦尼克数据处理与分析 <img src='https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1502440065892&di=51db15bf76374068735a690806ad66a2&imgtype=0&src=http%3A%2F%2Fwww.pp3.cn%2Fuploads%2F201607%2F20160708007.jpg'> End of explanation """ # 如果不...
pyrdr/charlas
intro_text_mining/notebooks/Modelado de Topicos 101.ipynb
mit
from prep import helpers from prep import clustering df = helpers.get_mcc_data() df.head()[['mcc', 'irs_description','desc']] """ Explanation: Minería de Texto: Clustering de Códigos y Tipos de Comercio <br/> <div align='center'> <img src="../images/merchant-category-code-instabill.jpg" width="640px"> </div> Cl...
zommiommy/FourierSeriesApproximation
FourierSeriesApproximation.ipynb
mit
import numpy as np from scipy import linalg """ Explanation: Foruier Series Approximation for discrete time serires Dependancy: End of explanation """ #the function to calculate the coefficent def approx(x, y, n, w): x = np.matrix(x).transpose() y = np.matrix(y).transpose() f, b = x.shape c, d = y.s...
gdsfactory/gdsfactory
docs/notebooks/09_pdk_import.ipynb
mit
import gdsfactory as gf c = gf.components.mzi() c """ Explanation: Import PDK To import a PDK in gdsfactory you need 2 things: GDS file with all the cells that you want to import in the PDK (or separate GDS files, one per cell) Klayout layer properties files, to define the Layers that you can use when creating new c...
nadvamir/deep-learning
autoencoder/Convolutional_Autoencoder.ipynb
mit
%matplotlib inline import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', validation_size=0) img = mnist.train.images[2] plt.imshow(img.reshape((28, 28)), cmap='Greys_r') """ Explanation: C...
zomansud/coursera
ml-regression/week-2/numpy-tutorial.ipynb
mit
import numpy as np # importing this way allows us to refer to numpy as np """ Explanation: Numpy Tutorial Numpy is a computational library for Python that is optimized for operations on multi-dimensional arrays. In this notebook we will use numpy to work with 1-d arrays (often called vectors) and 2-d arrays (often cal...
eramirem/numerical-methods-pdes
reaction-diffusion_demo.ipynb
cc0-1.0
%matplotlib inline import numpy import matplotlib.pyplot as plt import scipy.sparse as sparse import scipy.sparse.linalg as linalg """ Explanation: <table> <tr align=left><td><img align=left src="https://i.creativecommons.org/l/by/4.0/88x31.png"> <td>Text provided under a Creative Commons Attribution license, CC-BY....
kdestasio/online_brain_intensive
nipype_tutorial/notebooks/basic_interfaces_caching.ipynb
gpl-2.0
from nipype.caching import Memory mem = Memory(base_dir='/output/workingdir') """ Explanation: Memory caching In Workflow notebook you learnt about Workflows that specify processing by an execution graph and offer efficient recomputing. However, sometimes you might want to use Interfaces that gives better control of t...
mne-tools/mne-tools.github.io
0.21/_downloads/ab8b138d73a5774a0442141d84ed9689/plot_10_epochs_overview.ipynb
bsd-3-clause
import os import mne """ Explanation: The Epochs data structure: discontinuous data This tutorial covers the basics of creating and working with :term:epoched &lt;epochs&gt; data. It introduces the :class:~mne.Epochs data structure in detail, including how to load, query, subselect, export, and plot data from an :clas...
tensorflow/docs-l10n
site/ja/tutorials/images/data_augmentation.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...
brettavedisian/phys202-2015-work
days/day19/FittingModels.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np from scipy import optimize as opt from IPython.html.widgets import interact """ Explanation: Fitting Models Learning Objectives: learn to fit models to data using linear and non-linear regression. This material is licensed under the MIT license and...
quinngroup/bsec-2015
BSEC2015 Thunder large-scale image SVD demo.ipynb
apache-2.0
# IPython Notebook preliminaries. %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns sns.set_context("notebook") from thunder import Colorize image = Colorize.image """ Explanation: thunder-python for large-scale SVD of images Bioimage analysis is central to researchers in biology and biomedical...
dhimmel/obo
examples/go-obonet.ipynb
cc0-1.0
import networkx import obonet """ Explanation: obonet tutorial: import and analyze the Gene Ontology in Python This tutotial shows: How to read the Gene Ontology OBO export into networkx using the obonet package. Simple tasks you can do with the networkx.MultiDiGraph data structure. End of explanation """ %%time ur...
JKeun/project-02-watcha
01_crawling/01_watcha_api_structure.ipynb
mit
import requests import json import pandas as pd response = requests.get("https://watcha.net/v2/users/jXaIHl0ZtdYZ/movies.json?filter%5Bsorting%5D=time&page=1") watcha_dict = json.loads(response.text) watcha_dict watcha_dict.keys() """ Explanation: 왓챠 json구조 분석 뽑아야 할 feature들 End of explanation """ watcha_list = ...
castelao/CoTeDe
docs/notebooks/profile_CTD.ipynb
bsd-3-clause
from bokeh.io import output_notebook, show from bokeh.layouts import row from bokeh.plotting import figure import numpy as np import cotede from cotede import datasets, qctests output_notebook() """ Explanation: [WIP] Quality Controlling a CTD profile Quality control of a shipboard CTD profile (Temperature & Salinit...
daniestevez/jupyter_notebooks
dslwp/DSLWP-B deorbit.ipynb
gpl-3.0
utc = 0 sma = 1 ecc = 2 inc = 3 raan = 4 aop = 5 ma = 6 ta = 7 """ Explanation: Keys for each of the columns in the orbit (Keplerian state) report. End of explanation """ #fig1 = plt.figure(figsize = [15,8], facecolor='w') fig_peri = plt.figure(figsize = [15,8], facecolor='w') fig_peri_deorbit = plt.figure(figsize =...
GoogleCloudPlatform/training-data-analyst
blogs/babyweight_keras/babyweight.ipynb
apache-2.0
!pip install tensorflow==2.2 """ Explanation: Structured data prediction using Cloud ML Engine This notebook illustrates: Exploring a BigQuery dataset using JupyterLab Creating datasets for Machine Learning using Dataflow Creating a model using the feature columns and Keras API Training on Cloud AI Platform Deploying...
turbomanage/training-data-analyst
courses/fast-and-lean-data-science/02_Dataset_playground.ipynb
apache-2.0
import os, sys, math import numpy as np from matplotlib import pyplot as plt if 'google.colab' in sys.modules: # Colab-only Tensorflow version selector %tensorflow_version 2.x import tensorflow as tf print("Tensorflow version " + tf.__version__) #@title "display utilities [RUN ME]" def display_9_images_from_dataset(...
mcc-petrinets/formulas
spot/tests/python/word.ipynb
mit
aut = spot.translate('!a & G(Fa <-> XXb)'); aut """ Explanation: Let's build a small automaton to use as example. End of explanation """ run = aut.accepting_run(); run """ Explanation: Build an accepting run: End of explanation """ print(spot.bdd_format_formula(aut.get_dict(), run.prefix[0].label)) print(run.cycl...
abhi1509/deep-learning
sentiment-tflearn/Sentiment Analysis with TFLearn.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...
AlCap23/Thesis
Python/FOTD-Design.ipynb
gpl-3.0
# Import the needed packages, SymPy import sympy as sp from sympy import init_printing init_printing() # Define the variables # Complex variable s = sp.symbols('s') # FOTD Coeffficients T1,T2,T3,T4 = sp.symbols('T_1 T_2 T_3 T_4') K1,K2,K3,K4 = sp.symbols('K_1 K_2 K_3 K_4') # Time Delay Coefficients L1,L2,L3,L4 = sp.sy...
d00d/quantNotebooks
Notebooks/quantopian_research_public/notebooks/tutorials/2_pipeline_lesson8/notebook.ipynb
unlicense
from quantopian.pipeline.data import morningstar # Since the underlying data of morningstar.share_class_reference.exchange_id # is of type string, .latest returns a Classifier exchange = morningstar.share_class_reference.exchange_id.latest """ Explanation: Classifiers A classifier is a function from an asset and a mo...
corochann/deep-learning-tutorial-with-chainer
src/01_chainer_intro/chainer_module1.ipynb
mit
# Initial setup following import numpy as np import chainer from chainer import cuda, Function, gradient_check, report, training, utils, Variable from chainer import datasets, iterators, optimizers, serializers from chainer import Link, Chain, ChainList import chainer.functions as F import chainer.links as L from chai...
pbeens/ICS-Computer-Studies
Coursera_Introduction_to_Data_Science_with_Python.ipynb
mit
# Jupyter has magic commands! import numpy as np %timeit a = np.random.randn(100, 100) # magic commands can be assigned to variables foo = %pwd print(f'pwd: {foo}') """ Explanation: <a href="https://colab.research.google.com/github/pbeens/ICS-Computer-Studies/blob/master/Coursera_Introduction_to_Data_Science_with_Pyt...
poppy-project/community-notebooks
tutorials-education/poppy_ergo_jr__decouverte_du_robot/Poppy-Ergo-Jr DECOUVRIR VOTRE ROBOT.ipynb
lgpl-3.0
%pylab inline from __future__ import print_function """ Explanation: Traduction du notebook Discover your Poppy Ergo Jr par Georges Saliba sous licence CC BY SA Découvrir votre Poppy Ergo Jr Ce notebook qui permet à la fois d'insérer du code pour faire fonctionner le robot et de le commenter dans le même temps, va ...
tensorflow/docs
site/en/guide/tensor.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...
liufuyang/deep_learning_tutorial
course-deeplearning.ai/course5-rnn/Week 1/Jazz improvisation with LSTM/Improvise a Jazz Solo with an LSTM Network - v2.ipynb
mit
from __future__ import print_function import IPython import sys from music21 import * import numpy as np from grammar import * from qa import * from preprocess import * from music_utils import * from data_utils import * from keras.models import load_model, Model from keras.layers import Dense, Activation, Dropout, Inp...
meli-lewis/pycaribbean2016
pycaribbean.ipynb
unlicense
import numpy as np import pandas as pd from IPython.display import display, Image, YouTubeVideo %matplotlib inline """ Explanation: Introduction to data cleaning with Jupyter and pandas Meli Lewis, data engineer at Simple melidata.com End of explanation """ ?pd.read_csv """ Explanation: The case for open source d...
dennissergeev/classcode
notebooks/01_MODIS_L1B.ipynb
cc0-1.0
__author__ = 'ATSC-301 UBC' """ Explanation: Objectives The objectives of this notebook is to provide examples about working with AQUA MODIS L1B files, including: Convert HDF4 format data to HDF5 format; Read *.HDF5 data through "h5py" module; Correct the raw data by using scale_factor and offset Reproject sinusoida...
HsKA-ThermalFluiddynamics/NSS-1
NumPyTutorial.ipynb
mit
from __future__ import print_function from numpy import * from matplotlib.pylab import * %pylab --no-import-all inline """ Explanation: NumPy and Matplotlib Tutorial End of explanation """ a1 = array([1.0, 2.0, 3.0]) a2 = arange(1.0, 5.0, 0.5) a3 = linspace(1.0, 10.0, 17) print(a1) print(a2) print(a3) m1 = array([[...
vberlier/nbtlib
docs/Usage.ipynb
mit
import nbtlib nbt_file = nbtlib.load('nbt_files/bigtest.nbt') nbt_file['stringTest'] """ Explanation: Using nbtlib The Named Binary Tag (NBT) file format is a simple structured binary format that is mainly used by the game Minecraft (see the official specification for more details). This short documentation will show...
YaleATLAS/CERNDeepLearningTutorial
deeplearning_intro.ipynb
mit
import numpy as np import matplotlib import matplotlib.pyplot as plt import pandas as pd from sklearn.model_selection import train_test_split %matplotlib inline """ Explanation: <center> <h1>Introduction to Deep Learning with Keras</h1> <h3>Michela Paganini - Yale University</h3> <h4>High Energy Phenomenology, Experim...
Bedrock-py/bedrock-core
examples/RAND2011study/CooperationAnalysis.ipynb
lgpl-3.0
from bedrock.client.client import BedrockAPI """ Explanation: Rand 2011 Cooperation Study This notebook outlines how to recreate the analysis of the Rand et al. 2011 study "Dynamic social networks promote cooperation in experiments with humans" Link to Paper This outlines the steps to re-create the analysis using the ...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/08_lateral_movement/WIN-190815181010.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Remote Service creation Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/08/15 | | modification date | 2020/09/20 | | playbook related | ['WIN-...
quantumlib/Cirq
docs/tutorials/azure-quantum/getting_started_ionq.ipynb
apache-2.0
!pip install azure-quantum[cirq] --quiet """ Explanation: Getting started with IonQ and Cirq on Azure Quantum <table class="tfo-notebook-buttons" align="left"> <td> <a target="_blank" href="https://quantumai.google/cirq/tutorials/azure-quantum/getting_started_ionq"><img src="https://quantumai.google/site-assets/...
brettavedisian/Liquid-Crystals-Summer-2015
Smectic/SmAtoSmC.ipynb
mit
def f1_numpy(r, u, c): return (r*c**2)/2 + (u*c**4)/4 n = 2 T = np.linspace(-n,n,101) """ Explanation: u > 0 End of explanation """ fig1 = plt.figure(figsize=(11,8)) ax1 = fig1.gca() plt.plot(T, f1_numpy(1, 1, T)) plt.xlabel('c', fontsize=14) plt.ylabel('f', rotation='horizontal',verticalalignment='center', f...
CoreSecurity/pysap
docs/fileformats/SAPCAR.ipynb
gpl-2.0
from pysap.SAPCAR import * from IPython.display import display """ Explanation: SAP CAR The following subsections show a graphical representation of the file format portions and how to generate them. First we need to perform some setup to import the packet classes: End of explanation """ with open("some_file", "w") ...
ddtm/dl-course
Seminar4/bonus/Bonus-advanced-theano.ipynb
mit
import numpy as np def sum_squares(N): return <student.Implement_me()> %%time sum_squares(10**8) """ Explanation: Theano, Lasagne and why they matter got no lasagne? Install the bleeding edge version from here: http://lasagne.readthedocs.org/en/latest/user/installation.html Warming up Implement a function that c...
kalfasyan/Data_Science_playground
imdb_best_actordirector.ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') %matplotlib inline """ Explanation: We will discover the best actor/director according to imdb ratings First we import all the necessary libraries to process and plot data. End of explanation """ df = pd.read_csv('movie_m...
intel-analytics/analytics-zoo
pyzoo/zoo/chronos/use-case/network_traffic/network_traffic_autots_forecasting_deprecated.ipynb
apache-2.0
def get_drop_dates_and_len(df, allow_missing_num=3): """ Find missing values and get records to drop """ missing_num = df.total.isnull().astype(int).groupby(df.total.notnull().astype(int).cumsum()).sum() drop_missing_num = missing_num[missing_num > allow_missing_num] drop_datetimes = df.iloc[dro...
drvinceknight/cfm
assets/assessment/mock/main.ipynb
mit
### BEGIN SOLUTION import sympy as sym a, b, c = sym.Symbol("a"), sym.Symbol("b"), sym.Symbol("c") sym.expand((9 * a ** 2 * b * c ** 4) ** (sym.S(1) / 2) / (6 * a * b ** (sym.S(3) / 2) * c)) ### END SOLUTION q1_a_answer = _ feedback_text = """Your output is not a symbolic expression. You are expected to use sympy fo...
AlCap23/Thesis
Python/SOTD-Design.ipynb
gpl-3.0
# Import the needed packages, SymPy import sympy as sp from sympy import init_printing init_printing() # Define the variables # Complex variable s = sp.symbols('s') # FOTD Coeffficients T11,T21,T31,T41 = sp.symbols('T_{11} T_{21} T_{31} T_{41}') T12,T22,T32,T42 = sp.symbols('T_{12} T_{22} T_{32} T_{42}') K1,K2,K3,K4 =...
iancze/Starfish
examples/setup.ipynb
bsd-3-clause
import numpy as np from Starfish.grid_tools import download_PHOENIX_models ranges = [[5700, 8600], [4.0, 6.0], [-0.5, 0.5]] # T, logg, Z download_PHOENIX_models(path="PHOENIX", ranges=ranges) """ Explanation: Setup Here I will go over setting up our interfaces and emulators from a raw spectral library to prepare u...
chbrandt/pynotes
SS82_filtering/SS82_first_observations_filtering.ipynb
gpl-2.0
from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> <form action="javascript:code_toggle()"><input type="submit" value="Click here...
mne-tools/mne-tools.github.io
0.15/_downloads/plot_time_frequency_global_field_power.ipynb
bsd-3-clause
# Authors: Denis A. Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import somato from mne.baseline import rescale from mne.stats import _bootstrap_ci """ Explanation: Explore event-related dynamics for specific frequency...
mne-tools/mne-tools.github.io
0.14/_downloads/plot_epoching_and_averaging.ipynb
bsd-3-clause
import os.path as op import numpy as np import mne """ Explanation: Epoching and averaging (ERP/ERF) End of explanation """ data_path = mne.datasets.sample.data_path() fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif') raw = mne.io.read_raw_fif(fname) raw.set_eeg_reference() # set EEG average ref...
aryarohit07/machine-learning-with-python
linear_regression/linear_regression_gradient_descent_with_one_variable.ipynb
mit
import pandas as pd import matplotlib.pyplot as plt #shape = (97, 2) data = pd.read_csv('ex1data1.txt', header=None) plt.scatter(data[0], data[1]) plt.xlabel('population') plt.ylabel('profit') plt.close() """ Explanation: The first column is the population of a city and the second column is the profit of a food truc...
mne-tools/mne-tools.github.io
0.23/_downloads/1242d47b65d952f9f80cf19fb9e5d76e/35_eeg_no_mri.ipynb
bsd-3-clause
import os.path as op import numpy as np import mne from mne.datasets import eegbci from mne.datasets import fetch_fsaverage # Download fsaverage files fs_dir = fetch_fsaverage(verbose=True) subjects_dir = op.dirname(fs_dir) # The files live in: subject = 'fsaverage' trans = 'fsaverage' # MNE has a built-in fsaverag...
CPernet/LanguageDecision
notebooks/individuals/pilot.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 pilot models pilot_data = hddm.load_csv('/lang_dec/data/pilot_clean.csv') pilot_model...
cliburn/sta-663-2017
exams/Midterm Exams2.ipynb
mit
heart = sm.datasets.heart.load_pandas().data heart.head(n=6) """ Explanation: Q1 (10 points) The heart dataframe contains the survival time after receiving a heart transplant, the age of the patient and whether or not the survival time was censored Number of Observations - 69 Number of Variables - 3 Variable name de...