repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
idc9/law-net
vertex_metrics_experiment/chalboards/data_pipeline_scotus.ipynb
mit
setup_data_dir(data_dir) """ Explanation: set up the data directory End of explanation """ %time download_op_and_cl_files(data_dir, network_name) """ Explanation: data download get opinion and cluster files from CourtListener opinions/cluster files are saved in data_dir/raw/court/ End of explanation """ %time dow...
ecell/ecell4-notebooks
en/tutorials/tutorial10.ipynb
gpl-2.0
%matplotlib inline from ecell4.prelude import * """ Explanation: 10. Spatiocyte Simulations at Single-Molecule Resolution We showed an example of E-Cell4 spatial representation. Next let's simulate the models with more detailed spatial representation called "single molecule resolution". End of explanation """ with s...
tensorflow/docs-l10n
site/ko/lattice/tutorials/shape_constraints_for_ethics.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...
SimplifyData/Codality
2. Arrays/OddOccurances.ipynb
mit
A = [9,3,9,3,9,7,9] print len(A) print sorted(A) """ Explanation: Write a function: def solution(A) that, given an array A consisting of N integers fulfilling the above conditions, returns the value of the unpaired element. For example, given array A such that: A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A...
fluxcapacitor/source.ml
jupyterhub.ml/notebooks/train_deploy/zz_under_construction/tensorflow/optimize/01a_Explore_GPU.ipynb
apache-2.0
%%bash nvidia-smi """ Explanation: Explore GPU Sanity Check #1: Run Standard nvidia-smi Tool End of explanation """ %%bash xla_device_test &> xla_device_test.log tail -3 xla_device_test.log """ Explanation: Sanity Check #2: Run Accelerated Linear Algebra (XLA) Tests End of explanation """ %%bash cat /root/...
google-research/google-research
pairwise_fairness/regression_crime.ipynb
apache-2.0
import matplotlib.pyplot as plt import numpy as np import pandas as pd import random import sys from sklearn import model_selection import tensorflow as tf !pip install git+https://github.com/google-research/tensorflow_constrained_optimization import tensorflow_constrained_optimization as tfco """ Explanation: Copyr...
transcranial/keras-js
notebooks/layers/pooling/AveragePooling2D.ipynb
mit
data_in_shape = (6, 6, 3) L = AveragePooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format='channels_last') layer_0 = Input(shape=data_in_shape) layer_1 = L(layer_0) model = Model(inputs=layer_0, outputs=layer_1) # set weights to random (use seed for reproducibility) np.random.seed(270) data_in = 2 *...
brettavedisian/phys202-2015-work
assignments/assignment12/FittingModelsEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt """ Explanation: Fitting Models Exercise 2 Imports End of explanation """ f = np.load('decay_osc.npz') tdata = np.array(f['tdata']) ydata = np.array(f['ydata']) dy = np.array(f['dy']) plt.figure(figsize=(8,6)) plt.err...
dnstanciu/masters-project
sources/notebooks/plot_MST_measures.ipynb
gpl-3.0
from pprint import pprint import scipy import pandas as pd from pandas.tools.plotting import parallel_coordinates from pandas import concat import matplotlib # Set backend to pgf matplotlib.use('pgf') import matplotlib.pyplot as plt import numpy as np # Some nice default configuration for plots plt.rcParams['figu...
MostafaGazar/gladiator
fellowship_ai_challenge_final.ipynb
apache-2.0
!pip install -U seaborn !pip install xlrd>=0.9.0 !pip install pdpbox !pip install eli5 import os.path import numpy as np import pandas as pd %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns sns.set() """ Explanation: Global Terrorist Attacks Global Terrorism Database (GTD) is an open-source ...
yashdeeph709/Algorithms
PythonBootCamp/Complete-Python-Bootcamp-master/GUI/3 - Widget Events.ipynb
apache-2.0
from __future__ import print_function """ Explanation: Widget Events In this lecture we will discuss widget events, such as button clicks! Special events End of explanation """ import ipywidgets as widgets print(widgets.Button.on_click.__doc__) """ Explanation: The Button is not used to represent a data type. Inste...
cliburn/sta-663-2017
notebook/18B_Spark.ipynb
mit
from pyspark import SparkContext sc = SparkContext(master = 'local[*]') """ Explanation: Using Spark With massive data, we need to load, extract, transform and analyze the data on multiple computers to overcome I/O and processing bottlenecks. However, when working on multiple computers (possibly hundreds to thousands)...
NLeSC/noodles
notebooks/prime_numbers.ipynb
apache-2.0
%load_ext cython import multiprocessing import threading import queue """ Explanation: Real World Tutorial 3: Parallel Number crunching using Cython Python was not designed to be very good at parallel processing. There are two major problems at the core of the language that make it hard to implement parallel algorithm...
cjam/deep-onc
notebooks/tf-mnist-ml-pros.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/data/MNIST/",one_hot=True) sess = tf.InteractiveSession() """ Explanation: MNIST ML Pros tutorial This notebook is based on the tutorial found here This tutorial is very similar to the beginners tutor...
sdpython/code_beatrix
_doc/notebooks/scratch/scratch_dans_un_notebook.ipynb
mit
import code_beatrix.jsscripts.snap %load_ext code_beatrix import os, glob js_path = os.path.dirname(code_beatrix.jsscripts.snap.__file__) files = [ os.path.split(_)[-1] for _ in glob.glob(js_path + "/*.js") ] print(",".join(files)) path = "/static/snap/" js_libs = [path + _ for _ in files ] import notebook print("fic...
bgroveben/python3_machine_learning_projects
NevadaDashboard/pythonic_pandas.ipynb
mit
import pandas as pd pd.__version__ nrg = pd.read_csv('energy_consumption.csv'); nrg.describe(include='all') """ Explanation: Pythonic pandas Using a tutorial about fast flexible pandas. The pandas Python package is an effective way to examine and manipulate data. The source code is available on Github, and be sure t...
tensorflow/docs-l10n
site/ja/tutorials/generative/pix2pix.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...
AllenDowney/ModSimPy
soln/chap10soln.ipynb
mit
# Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignment %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * from pandas import read_html """ Expl...
sserkez/ocelot
test/workshop/1_introduction.ipynb
gpl-3.0
from IPython.display import Image #Image(filename='gui_example.png') """ Explanation: This notebook was created by Sergey Tomin for Workshop: Designing future X-ray FELs. Source and license info is on GitHub. August 2016. An Introduction to Ocelot Ocelot is a multiphysics simulation toolkit designed for studying FEL ...
LSSTC-DSFP/LSSTC-DSFP-Sessions
Sessions/Session01/Day3/IntroToVisualization.ipynb
mit
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: Introduction to Visualization: Density Estimation, Dimensionality Reduction, and Data Exploration Version 0.1 There are many flavors of data analysis that fall under the "visualization" umbrella in astronomy. Today, by way of examp...
Vvkmnn/books
AutomateTheBoringStuffWithPython/lesson29.ipynb
gpl-3.0
# Import Regex Module import re ## Create Phone Regex # Basic Phone Number: 415-555-0000 # Phone Numeber without Area Code: 555-0000 # Phone Number with Parenthesis: (415)-555-5000 # Phone Numbers with Extensions: ext /ext. /x12345 phoneRegex = re.compile( r''' ( # entire number (stored as its o...
QuantScientist/Deep-Learning-Boot-Camp
day03/2.2.2 CNN HandsOn - MNIST & CN Nets.ipynb
mit
#Import the required libraries import numpy as np np.random.seed(1338) from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Conv2D from keras.layers.pooling import MaxPooling2D from keras.utils i...
omoju/hiphopathy
SnaptoPython/SnaptoPython.ipynb
gpl-3.0
import turtle wn = turtle.Screen() # creates a graphics window """ Explanation: A short Besides Blocks <i>Snap!</i> to Python Module Previously in <i>Snap!</i> we have been used to programming with sprites. We will do something similar to help bridge your understanding of how computational thinking can be reali...
noripyt/cours
algorithmique/Cours d’algorithmique.ipynb
mit
une_variable = 5 """ Explanation: Pour compiler ce document en présentation, exécuter : jupyter nbconvert Cours\ d’algorithmique.ipynb --to slides --post serve Bertrand Bordage de NoriPyt Programmeur Python, Django, PostgreSQL Membre de l’équipe de développement du CMS Wagtail Créateur de nombreux projets open source...
parthasen/java-R
DS-ML_Nov_train_test.ipynb
gpl-3.0
import pandas as pd import numpy as np import matplotlib.pylab as plt import csv import glob from statsmodels.tsa.arima_model import ARIMA from statsmodels.tsa.arima_model import ARIMAResults import pickle #from sklearn.cross_validation import train_test_split from sklearn import linear_model from sklearn.svm import ...
Cyb3rWard0g/ThreatHunter-Playbook
docs/notebooks/windows/08_lateral_movement/WIN-201009183000.ipynb
gpl-3.0
from openhunt.mordorutils import * spark = get_spark() """ Explanation: Remote DCOM IErtUtil DLL Hijack Metadata | | | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2020/10/09 | | modification date | 2020/10/09 | | playbook related | ['W...
tensorflow/docs-l10n
site/ko/probability/examples/TensorFlow_Probability_on_JAX.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # 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, sof...
ajrichards/notebook
munging/dealing-with-catagorical-variables.ipynb
bsd-3-clause
import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder,OneHotEncoder, Binarizer """ Explanation: Dealing With Catagorical Features Often features are not given as continuous values, but rather as categorical classes. For example, variables may be defined as ["male", "female"], ["Europe",...
rajeshb/SelfDrivingCar
CarND-LeNet-Lab/LeNet-Lab-Solution.ipynb
mit
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", reshape=False) X_train, y_train = mnist.train.images, mnist.train.labels X_validation, y_validation = mnist.validation.images, mnist.validation.labels X_test, y_test = mnist.test.images, mn...
telescopeuser/workshop_blog
wechat_tool_py3_local/lesson_6_py3_local.ipynb
mit
import IPython.display IPython.display.YouTubeVideo('YSL--3j12VA') """ Explanation: <img src='https://www.iss.nus.edu.sg/Sitefinity/WebsiteTemplates/ISS/App_Themes/ISS/Images/branding-iss.png' width=15% style="float: right;"> <img src='https://www.iss.nus.edu.sg/Sitefinity/WebsiteTemplates/ISS/App_Themes/ISS/Images/br...
the-deep-learners/TensorFlow-LiveLessons
notebooks/dense_sentiment_classifier.ipynb
mit
import keras from keras.datasets import imdb from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from keras.layers import Dense, Flatten, Dropout from keras.layers import Embedding # new! from keras.callbacks import ModelCheckpoint # new! import os # new! from sklearn.metrics im...
rishuatgithub/MLPy
nlp/UPDATED_NLP_COURSE/02-Parts-of-Speech-Tagging/06-POS-Assessment-Solutions.ipynb
apache-2.0
# RUN THIS CELL to perform standard imports: import spacy nlp = spacy.load('en_core_web_sm') from spacy import displacy """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> Parts of Speech Assessment - Solutions For this assessment we'll be using the short story The Tale o...
Lstyle1/Deep_learning_projects
batch-norm/Batch_Normalization_Exercises.ipynb
mit
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True, reshape=False) """ Explanation: Batch Normalization – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a con...
mari-linhares/tensorflow-workshop
code_samples/RNN/sentiment_analysis/BagOfWords.ipynb
apache-2.0
tf.reset_default_graph() """ Explanation: Catigorical Columns Don't just One-Hot, They Count. End of explanation """ strings = np.array([['a','a','','b','c'],['a','c','zz','',''],['b','qq','qq','b','']]) """ Explanation: Here we have 3 examples, each containing 5 strings. Note: empty strings are ignored, and can b...
karthikrangarajan/intro-to-sklearn
01.ML 101 and Intro to scikit-learn.ipynb
bsd-3-clause
# Plot settings for notebook # so that plots show up in notebook %matplotlib inline import matplotlib.pyplot as plt # suppress future warning (some code is borrowed/adapted) import warnings warnings.filterwarnings('ignore') # Import an example plot from the figures directory from fig_code import plot_sgd_separator p...
zhuanxuhit/deep-learning
intro-to-tensorflow/intro_to_tensorflow_solution.ipynb
mit
# Problem 1 - Implement Min-Max scaling for grayscale image data def normalize_grayscale(image_data): """ Normalize the image data with Min-Max scaling to a range of [0.1, 0.9] :param image_data: The image data to be normalized :return: Normalized image data """ a = 0.1 b = 0.9 grayscale...
rcrehuet/Python_for_Scientists_2017
notebooks/Random Numbers in NumPy Campus.ipynb
gpl-3.0
import numpy as np """ Explanation: Random Numbers in NumPy End of explanation """ samples = np.random.normal(size=(4,4)) samples """ Explanation: The numpy.random module adds to the standard built-in Python random functions for generating efficiently whole arrays of sample values with many kinds of probability dis...
AstroHackWeek/AstroHackWeek2014
day1/Version Control.ipynb
bsd-3-clause
ls """ Explanation: Version control for fun and profit: the tool you didn't know you needed. From personal workflows to open collaboration Note: this tutorial was particularly modeled, and therefore owes a lot, to the excellent materials offered in: "Git for Scientists: A Tutorial" by John McDonnell Emanuele Olivett...
ES-DOC/esdoc-jupyterhub
notebooks/cnrm-cerfacs/cmip6/models/sandbox-3/ocean.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-3', 'ocean') """ Explanation: ES-DOC CMIP6 Model Properties - Ocean MIP Era: CMIP6 Institute: CNRM-CERFACS Source ID: SANDBOX-3 Topic: Ocean Sub-Topics: Timestepping Fram...
arnicas/eyeo_nlp
python/Word2Vec_Yelp.ipynb
cc0-1.0
import json import gensim import numpy as np import string import tsne as ts # local copy in the repo %matplotlib inline import matplotlib.pyplot as plt """ Explanation: Word2Vec Whirlwind Tour Using Yelp Review Data Lynn Cherny (@arnicas, arnicas@gmail.com) Note: This repo requires a gzipped file of data to be unzi...
csaladenes/aviation
code/airport_dest_parser2.ipynb
mit
L=json.loads(file('../json/L.json','r').read()) M=json.loads(file('../json/M.json','r').read()) N=json.loads(file('../json/N.json','r').read()) import requests AP={} for c in M: if c not in AP:AP[c]={} for i in range(len(L[c])): AP[c][N[c][i]]=L[c][i] """ Explanation: Load airports of each country En...
cristhro/Machine-Learning
ejercicio 3/titanic.ipynb
gpl-3.0
%matplotlib inline import pandas as pd import numpy as np import random as rnd import seaborn as sns import matplotlib.pyplot as plt """ Explanation: Alumnos: Cristhian Rodriguez y Jesus Perucha Practica 3: Titanic End of explanation """ train_df = pd.read_csv('train.csv') test_df = pd.read_csv('test.csv') """ Exp...
MetricLearning/diplomado_datascience
03_Visualizar_datos/Visualizacion de datos con Python.ipynb
gpl-3.0
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline params = {'legend.fontsize': 'x-large', 'figure.figsize': (10, 7.5), 'axes.labelsize': 'x-large', 'axes.titlesize':'x-large', 'xtick.labelsize':'x-large', 'ytick...
bashtage/statsmodels
examples/notebooks/glm_weights.ipynb
bsd-3-clause
import numpy as np import pandas as pd import statsmodels.formula.api as smf import statsmodels.api as sm """ Explanation: Weighted Generalized Linear Models End of explanation """ print(sm.datasets.fair.NOTE) """ Explanation: Weighted GLM: Poisson response data Load data In this example, we'll use the affair datas...
autism-research-centre/Autism-Gradients
1_SelectFiles.ipynb
gpl-3.0
# imports from __future__ import print_function import numpy as np import os import nibabel as nib from os import listdir from os.path import isfile, join import os.path # little helper function to return the proper filelist with the full path but that skips hidden files def listdir_nohidden(path): for f in os.lis...
ChileanVirtualObservatory/DISPLAY
src/experiments/DISPLAY - 2011.0.00419.S CH3OH7-6.ipynb
gpl-3.0
file_path = '../data/2011.0.00419.S/sg_ouss_id/group_ouss_id/member_ouss_2013-03-06_id/product/IRAS16547-4247_Jet_CH3OH7-6.clean.fits' noise_pixel = (15, 4) train_pixels = [(133, 135),(134, 135),(133, 136),(134, 136)] img = fits.open(file_path) meta = img[0].data hdr = img[0].header # V axis naxisv = hdr['NAXIS3'] ...
averyallen71/dcgan-denosing-autoencoder
dcgan_autoencoder_notebook.ipynb
mit
import sys sys.path.append('..') import os import json from time import time import numpy as np from tqdm import tqdm import theano import theano.tensor as T from theano.sandbox.cuda.dnn import dnn_conv from PIL import Image """ Explanation: Imports End of explanation """ from lib import activations from lib impo...
Danghor/Algorithms
Python/Local-Search-Engine.ipynb
gpl-2.0
import subprocess """ Explanation: Implementing a Local Search Engine This notebook shows one important application of <em style="color:blue;">dictionaries</em> and <em style="color:blue;">sets</em>: It implements a local search engine that can be used to index .pdf documents on the local file system. The index can t...
kit-cel/wt
mloc/ch2_Machine_Learning/Learn_Names_Naive_Bayes.ipynb
gpl-2.0
import numpy as np import string """ Explanation: Name Competition with Naive Bayes Predictor This code is provided as supplementary material of the lecture Machine Learning and Optimization in Communications (MLOC).<br> This code illustrates * Classifying names based on a simple naive Bayesian predictor with conditio...
amitkaps/full-stack-data-science
credit-risk/notebooks/2-Building-an-ML-App.ipynb
mit
%%file sq.py def square(n): return n*n """ Explanation: Building an ML App Now that we have a machine learning model to predict the defaults, let us try to build a web application to lend loans. It'll have two parts: a form to submit the loans admin panel to look at the submitted loans and their probability of...
jtwhite79/pyemu
examples/Schurexample_freyberg.ipynb
bsd-3-clause
%matplotlib inline import os import numpy as np import pandas as pd from matplotlib.patches import Rectangle as rect import matplotlib.pyplot as plt import warnings from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib as mpl newparams = {'legend.fontsize':10, 'axes.labelsize':10, 'xtic...
planetlabs/notebooks
jupyter-notebooks/analytics-snippets/roads_as_vector.ipynb
apache-2.0
import os import fiona import matplotlib.pyplot as plt from planet import api import rasterio from rasterio import features as rfeatures from rasterio.enums import Resampling from rasterio.plot import show import shapely from shapely.geometry import shape as sshape # if your Planet API Key is not set as an environmen...
LukasMosser/Jupetro
notebooks/Simple Decline Curve Analysis in Python.ipynb
gpl-3.0
from scipy.optimize import curve_fit """ Explanation: Simple Decline Curve Analysis in Python Created by Lukas Mosser, 2016 Introduction We will look at how we can use python and related libraries to perform a decline curve analysis on a number of example datasets. The methodology shown here can be readily extended t...
junhwanjang/DataSchool
Lecture/05. 기초 선형 대수 1 - 행렬의 정의와 연산/5) 행렬의 연산과 성질.ipynb
mit
A = (np.arange(9) - 4).reshape((3, 3)) A np.linalg.norm(A) """ Explanation: 행렬의 연산과 성질 행렬에는 곱셈, 전치 이외에도 지수 함수 등의 다양한 연산을 정의할 수 있다. 각각의 정의와 성질을 알아보자. 행렬의 부호 행렬은 복수의 실수 값을 가지고 있으므로 행렬 전체의 부호는 정의할 수 없다. 하지만 행렬에서도 실수의 부호 정의와 유사한 기능을 가지는 정의가 존재한다. 바로 행렬의 양-한정(positive definite) 특성이다. 모든 실수 공간 $\mathbb{R}^n$ 의 0벡터가 아닌 벡터 $...
phungkh/phys202-2015-work
assignments/assignment04/MatplotlibEx02.ipynb
mit
%matplotlib inline import matplotlib.pyplot as plt import numpy as np """ Explanation: Matplotlib Exercise 2 Imports End of explanation """ !head -n 30 open_exoplanet_catalogue.txt """ Explanation: Exoplanet properties Over the past few decades, astronomers have discovered thousands of extrasolar planets. The follo...
VectorBlox/PYNQ
Pynq-Z1/notebooks/examples/asyncio_buttons.ipynb
bsd-3-clause
from pynq import Overlay, PL from pynq.board import LED, Switch, Button Overlay('base.bit').download() buttons = [Button(i) for i in range(4)] leds = [LED(i) for i in range(4)] switches = [Switch(i) for i in range(2)] """ Explanation: Using Interrupts and asyncio for Buttons and Switches This notebook provides a sim...
mssalvador/Fifa2018
Teknisk Tirsdag - Data Cleaning.ipynb
apache-2.0
#PURE PYTHON!!!! from IPython.display import display, Markdown import numpy as np import pandas as pd import os import re # path = %pwd # path += '/fifa-18-demo-player-dataset/CompleteDataset.csv' # Til Windows path = '.\\Downloads\\Fifa2018-master\\Fifa2018-master' path += '\\fifa-18-demo-player-dataset\\CompleteDat...
mayank-johri/LearnSeleniumUsingPython
Section 1 - Core Python/Chapter 09 - Classes & OOPS/OOPs Fundamentals - Inheritance.ipynb
gpl-3.0
class P1(): def __init__(super): print("P-1 init") class P2(): def __init__(super): print("P_2 init") class C1(P1, P2): pass class C2(P2, P1): pass c1 = C1() print("*"*20) c2 = C2() """ Explanation: OOPS Fundamentals What is Inheritance? Inheritance is used to indicate that one cla...
liganega/Gongsu-DataSci
previous/y2017/W10-stats-correlation/.ipynb_checkpoints/GongSu23_Statistics_Correlation-checkpoint.ipynb
gpl-3.0
from GongSu22_Statistics_Population_Variance import * """ Explanation: 자료 안내: 여기서 다루는 내용은 아래 사이트의 내용을 참고하여 생성되었음. https://github.com/rouseguy/intro2stats 상관분석 안내사항 지난 시간에 다룬 21장과 22장 내용을 활용하고자 한다. 따라서 아래와 같이 21장과 22장 내용을 모듈로 담고 있는 파이썬 파일을 임포트 해야 한다. 주의: 아래 두 개의 파일이 동일한 디렉토리에 위치해야 한다. * GongSu21_Statistics_Averages.py ...
tensorflow/agents
docs/tutorials/1_dqn_tutorial.ipynb
apache-2.0
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
ThierryMondeel/FBA_python_tutorial
FBA_tutorials/1_introduction_to_python.ipynb
mit
# ignore the first two lines: they allow you to show multiple outputs per cell from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" import this """ Explanation: A crash course in Python <p>**Authors**: Thierry D.G.A Mondeel, Stefania Astrologo, Ewelina Weglarz-To...
PMBio/mtSet
notebooks/demo_arabidopsis.ipynb
apache-2.0
import ipdb import sys import limix sys.path.append('./..') import mtSet.pycore.modules.splitter as SPLIT import mtSet.pycore.modules.multiTraitSetTest as MTST import mtSet.pycore.modules.chi2mixture as C2M from mtSet.pycore.utils.utils import smartAppend from mtSet.pycore.utils.utils import smartDumpDictHdf5 import ...
ES-DOC/esdoc-jupyterhub
notebooks/ncar/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', 'ncar', 'sandbox-3', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: NCAR Source ID: SANDBOX-3 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Radi...
iurilarosa/thesis
scritti/slides/review code/Review.ipynb
gpl-3.0
binh_df0ORIG=zeros(nbin_d,nbin_f0); % HM matrix container for it = 1:nTimeSteps kf=(peaks(2,ii0:ii(it))-inifr)/ddf; % normalized frequencies w=peaks(5,ii0:ii(it)); % wiener weights t=peaks(1,ii0)*Day_inSeconds; % time conversion days to s tddf=t/ddf; f0_a=kf-deltaf2; for id = 1...
catalystcomputing/DSIoT-Python-sessions
Session201811/code/09 Pandas - Part 2.ipynb
apache-2.0
import pandas as pd df_temp = pd.read_csv('../data/airquality.csv', usecols = ["Ozone", "Solar.R", "Wind", "Temp", "Month", "Day"]) # We exclude the first column (= index) because we don't need it. # To do that, just specify the columns of interest in usecols #Let's add a year column df_temp["Y...
mne-tools/mne-tools.github.io
0.24/_downloads/ead9220acec394667b95e490359e08e7/70_point_spread.ipynb
bsd-3-clause
import os.path as op import numpy as np 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 demonstrate how to put ...
theandygross/TCGA_differential_expression
Notebooks/Global_Parameters.ipynb
mit
GENE_SETS = '/cellar/users/agross/Data/GeneSets/c2.cp.v5.csv' HUGO_TO_REFSEQ = '/cellar/users/agross/Data/GeneSets/hugo_to_refseq.csv' """ Explanation: GLOBAL Parameters These are gene sets from mSigDB, downloading them is free but you need to create a login. Here is the link to the gene sets page, yI am using the ca...
harmsm/pythonic-science
chapters/00_inductive-python/03_conditionals.ipynb
unlicense
x = 5 print(x > 2) x = 5 print(x < 2) """ Explanation: Conditional Execution Conditional execution allows a program to only execute code if some condition is met. Predict what this code will do. End of explanation """ x = 20 print (x > 2) """ Explanation: Summarize What does x &lt; y do? What does it spit out? M...
letsgoexploring/teaching
winter2017/econ129/python/Econ129_Class_12.ipynb
mit
# Create an array with 5 draws from the normal(0,1) distribution and print # Create an array with 5 draws from the normal(0,1) distribution and print """ Explanation: Class 12: Stochastic Time Series Processes Simulating normal random variables with Numpy The numpy.random module has bunch of functions for generatin...
edno/udacity-sandbox
ud170/ipython_notebook_tutorial.ipynb
unlicense
# Hit shift + enter or use the run button to run this cell and see the results print 'hello world' # The last line of every code cell will be displayed by default, # even if you don't print it. Run this cell to see how this works. 2 + 2 # The result of this line will not be displayed 3 + 3 # The result of this line...
Zhenxingzhang/AnalyticsVidhya
Articles/Python_List_Comprehension/List and Dictionary Comprehension-final.ipynb
apache-2.0
[x**2 for x in range(0,10)] [x for x in range(1,20) if x%2==0 ] [x for x in 'MATHEMATICS' if x in ['A','E','I','O','U']] for i in range(1,101): if int(i**0.5)==i**0.5: print i [i for i in range(1,101) if int(i**0.5)==i**0.5] import numpy as np """ Explanation: Python List Comprehension Note: The run t...
eds-uga/csci1360-fa16
assignments/A3/A3_Q3.ipynb
mit
import numpy as np np.random.seed(8948394) list_of_numbers = np.random.randint(10, size = 100000).tolist() index = -1 ### BEGIN SOLUTION ### END SOLUTION """ Explanation: Q3 This question will focusing on indexing lists and dictionaries directly, no loops needed. A Reassign index to be the middle index of the list ...
DOsinga/notebooks
Style_Transfer_Interpolation.ipynb
apache-2.0
from keras.preprocessing.image import load_img, img_to_array from scipy.misc import imsave import numpy as np from scipy.optimize import fmin_l_bfgs_b import time import argparse import os import imageio from IPython.display import Image, display, HTML from keras.applications import vgg16 from keras import backend as ...
pastas/pastas
concepts/handling_timeseries.ipynb
mit
import numpy as np import pandas as pd import matplotlib.pyplot as plt import pastas as ps ps.show_versions() """ Explanation: Time series in Pastas R.A. Collenteur, University of Graz, 2020 Time series are at the heart of time series analysis, and therefore need to be considered carefully when dealing with time seri...
ga7g08/ga7g08.github.io
_notebooks/Harmonically-related-sinusoids.ipynb
mit
def fEven(x, omega, x0, R): return np.sin(omega*x+x0) - R*np.cos(2*(omega*x+x0)) """ Explanation: Two harmonically related sinusoids This notebook looks at properties of two functions which can be described by \begin{equation} f_E(x) = A\sin(x) - B\cos(2 x) \end{equation} \begin{equation} f_O(x) = A\cos(x)...
dolittle007/dolittle007.github.io
notebooks/Model Comparison.ipynb
gpl-3.0
%matplotlib inline import pymc3 as pm import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_context('notebook') """ Explanation: Model comparison To demonstrate the use of model comparison criteria in PyMC3, we implement the 8 schools example from Section 5.5 of Gelman et al (2003), which at...
tritemio/multispot_paper
out_notebooks/usALEX-5samples-E-corrected-all-ph-out-12d.ipynb
mit
ph_sel_name = "None" data_id = "12d" # data_id = "7d" """ Explanation: Executed: Mon Mar 27 11:39:24 2017 Duration: 7 seconds. usALEX-5samples - Template This notebook is executed through 8-spots paper analysis. For a direct execution, uncomment the cell below. End of explanation """ from fretbursts import * ini...
ramseylab/networkscompbio
class05_find_python3_template.ipynb
apache-2.0
import numpy as np import igraph import timeit import itertools import bintrees """ Explanation: CS446/546 Class Session 5 - Adjacency Forests Exploring the running time for testing if there is an edge between a pair of vertices In this exercise, we'll compare the asymptotic computational running time for testing if ...
fluffy-hamster/A-Beginners-Guide-to-Python
A Beginners Guide to Python/15. Indexing & Slicing.ipynb
mit
# flipping signs of numbers... a = 5 b = -5 print(-a, -b) # len function x1 = [] x2 = "12" x3 = [1,2,3] print(len(x1), len(x2), len(x3)) x = [1,2,3] print(x[100]) # <--- IndexError! 100 is waayyy out of bounds """ Explanation: Indexing Okay guys today's lecture is indexing. What is indexing? At heart, indexing i...
abhi1509/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...
mne-tools/mne-tools.github.io
dev/_downloads/b89584de6ec99a847868d7b80a32cf50/80_dics.ipynb
bsd-3-clause
# Author: Marijn van Vliet <w.m.vanvliet@gmail.com> # # License: BSD-3-Clause """ Explanation: DICS for power mapping In this tutorial, we'll simulate two signals originating from two locations on the cortex. These signals will be sinusoids, so we'll be looking at oscillatory activity (as opposed to evoked activity). ...
arcyfelix/Courses
18-11-22-Deep-Learning-with-PyTorch/07-Deploying PyTorch Models/.ipynb_checkpoints/Deploying_PyTorch_models_in_production-checkpoint.ipynb
apache-2.0
torch.__version__ """ Explanation: Requirements End of explanation """ # Let's create an example model using ResNet-18 model = torchvision.models.resnet18() model # Creating a sample of the input # It will be used to pass it to the network to build the dimensions sample = torch.rand(size=(1, 3, 224, 224)) # Creat...
Bio204-class/bio204-notebooks
2016-04-13-association-categorical-variables.ipynb
cc0-1.0
%matplotlib inline import numpy as np import scipy.stats as stats import pandas as pd import matplotlib.pyplot as plt import seaborn as sbn # load the bumpus dat set dataurl = "https://github.com/Bio204-class/bio204-datasets/raw/master/bumpus-data.txt" bumpus = pd.read_table(dataurl) # for clarity of presentation let...
phoebe-project/phoebe2-docs
development/tutorials/ui_jupyter.ipynb
gpl-3.0
#!pip install -I "phoebe>=2.4,<2.5" import phoebe from phoebe import u # units logger = phoebe.logger() b = phoebe.default_binary() """ Explanation: Advanced: Interacting with the UI in Jupyter Setup Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an onlin...
UltronAI/Deep-Learning
CS231n/assignment2/PyTorch.ipynb
mit
import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from torch.utils.data import sampler import torchvision.datasets as dset import torchvision.transforms as T import numpy as np import timeit """ Explanation: Training a ConvNet ...
ml4a/ml4a-guides
examples/dreaming/neural-synth.ipynb
gpl-2.0
#Grab inception model from online and unzip it (you can skip this step if you've already downloaded the model. !wget -P . https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip !unzip inception5h.zip -d inception5h/ !rm inception5h.zip """ Explanation: Neural synthesis, feature visualization, an...
Flaviolib/dx
01_dx_frame.ipynb
agpl-3.0
from dx import * np.set_printoptions(precision=3) """ Explanation: <img src="http://hilpisch.com/tpq_logo.png" alt="The Python Quants" width="45%" align="right" border="4"> Framework Classes and Functions This section explains the usage of some basic framework classes and functions of DX Analytics. Mainly some helper...
AlJohri/DAT-DC-12
notebooks/intro-pandas.ipynb
mit
%matplotlib inline import pandas as pd import numpy as np import matplotlib.pyplot as plt """ Explanation: Introduction to Pandas Forked from 10 Minutes to pandas End of explanation """ s = pd.Series([1,3,5,np.nan,6,8]) s """ Explanation: Object Creation http://pandas.pydata.org/pandas-docs/stable/10min.html#objec...
pagutierrez/tutorial-sklearn
notebooks-spanish/17-modelos_lineales.ipynb
cc0-1.0
from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split X, y, true_coefficient = make_regression(n_samples=200, n_features=30, n_informative=10, noise=100, coef=True, random_state=5) X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=5, train_size=60, test_...
jtempkin/enhanced-sampling-toolkit
docs/data/NEUS-basic-usage.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from neus import pyramid from neus import partition """ Explanation: The NEUS application toolkit provides three modules: A Window object A partition object An Entry Point collection The Window object represents the data strutures and routin...
googleinterns/bizview-semi-supervised-learning
Supervised_learning/resnet_test_create_dataset.ipynb
apache-2.0
from keras.utils import np_utils from keras.datasets import cifar10 import numpy as np from resnet_lib import create_dataset, create_model, test_callback, tune_model, visualize_model # Global constants NUM_CLASSES = 10 IMAGE_SIZE = 32 BATCH_SIZE = 64 EPOCHS = 10 # Directories INPUT_TF_TRAIN = '../Mixmatch/ML_DATA/cif...
srnas/barnaba
manuscript_figures/02_figure.ipynb
gpl-3.0
import pickle import numpy as np # read ermsd from pickle fname = "ermsd.p" print "# reading pickle %s" % fname, ermsd = pickle.load(open(fname, "r")) print " shape ", ermsd.shape print "####" # define thresholds for folded and unfolded states, in eRMSD values. thr_u = 1.9 thr_f = 0.6 ll = ermsd.shape[0] # make assi...
phoebe-project/phoebe2-docs
2.2/examples/diher_misaligned.ipynb
gpl-3.0
!pip install -I "phoebe>=2.2,<2.3" """ Explanation: DI Her: Misaligned Binary In this example, we'll reproduce Figure 8 in the misalignment release paper (Horvat et al. 2018). <img src="horvat+18_fig8.png" alt="Figure 8" width="400px"/> Setup Let's first make sure we have the latest version of PHOEBE 2.2 installed. (Y...
ctroupin/OceanData_NoteBooks
PythonNotebooks/PlatformPlots/Read_drifter_data_1.ipynb
gpl-3.0
%matplotlib inline import netCDF4 import numpy as np import matplotlib.pyplot as plt from matplotlib import colors """ Explanation: In this application we will read a netCDF file containing a surface drifter trajectory. 1. Reading the data We use the netCDF4 module. End of explanation """ drifterfile = "/data_loca...
caseresearch/code-review
tutorials/jupyter_notebook_emcee/.ipynb_checkpoints/emcee_notebook-checkpoint.ipynb
mit
%matplotlib inline """ Explanation: The rad-ness of notebooks I use notebooks more often than I use an executable .py script. This is partially because notebooks were my first major introduction to python, but my continued use relates back to the fact that it allows me to break up problems I'm solving into different b...
slundberg/shap
notebooks/tabular_examples/tree_based_models/Force Plot Colors.ipynb
mit
import xgboost import shap # load JS visualization code to notebook shap.initjs() # train XGBoost model X,y = shap.datasets.boston() bst = xgboost.train({"learning_rate": 0.01}, xgboost.DMatrix(X, label=y), 100) # explain the model's predictions using SHAP values explainer = shap.TreeExplainer(bst) shap_values = ex...
janpipek/physt
doc/tutorial.ipynb
mit
# Necessary import evil from physt import binnings, h1, h2, h3 import numpy as np import matplotlib.pyplot as plt np.random.seed(1337) # Have always the same data """ Explanation: Get started with physt This tutorial describes some of the basic features of physt. End of explanation """ # Basic dataset heights =...
volgy/notebook
PSD.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from scipy import signal # constants FS = 1e4 # sampling rate (Hz) SIG_F = 1e3 # signal frequency (Hz) SIG_DB = 0 # signal amplitude (dB) NOISE_DB = -15 # noise amplitude (dB) T = 1 # signal length (s) dT = 1 / FS t = np....
ChristinaB/Observatory
tutorials/Observatory_usecase7_xmapLandlab.ipynb
mit
#!conda install -c conda-forge ogh libgdal gdal pygraphviz ncurses matplotlib=2.2.3 --yes # silencing warning import warnings warnings.filterwarnings("ignore") # data processing import os import pandas as pd, numpy as np, dask # data migration library import ogh import ogh_xarray_landlab as oxl from utilities import...
RomanSC/algorithms
chapter-2/.ipynb_checkpoints/Chapter-2-Analysis-checkpoint.ipynb
gpl-3.0
# Importing some things import matplotlib.patches as patches from matplotlib import pyplot from time import time import math from executiontime import execution_time from issubstring import * from random_string import * """ Explanation: <h1>Chapter 2: Analysis</h1> <span> My first jupyter notebook, demonstrating some...