repo_name
stringlengths
6
77
path
stringlengths
8
215
license
stringclasses
15 values
content
stringlengths
335
154k
google/starthinker
colabs/dv360_api_insert_from_bigquery.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: 1. Install Dependencies First install the libraries needed to execute recipes, this only needs to be done once, then click play. End of explanation """ CLOUD_PROJECT = 'PASTE PROJECT ID HERE' print("Cloud Project Set To: %s" % CLOUD_PROJECT) ...
tensorflow/docs-l10n
site/en-snapshot/io/tutorials/colorspace.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...
google/starthinker
colabs/iam.ipynb
apache-2.0
!pip install git+https://github.com/google/starthinker """ Explanation: Project IAM Sets project permissions for an email. License Copyright 2020 Google LLC, 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 Li...
chetan51/nupic.research
projects/dynamic_sparse/notebooks/ExperimentAnalysis-Neurips-debug-hebbianANDmagnitude-opposite.ipynb
gpl-3.0
%load_ext autoreload %autoreload 2 import sys sys.path.append("../../") from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import tabulate import pprint import click import numpy as np import pandas as pd from ray.tune.commands import * ...
choderalab/MSMs
initial_ipynbs/Abl_longsim_initial_MSM.ipynb
gpl-2.0
#Import libraries import matplotlib.pyplot as plt import mdtraj as md import glob import numpy as np from msmbuilder.dataset import dataset %pylab inline #Import longest trajectory. t = md.load("run0-clone35.h5") """ Explanation: Analysis of large set of Abl simulations on Folding@home (project 10468), one starting...
SteveDiamond/cvxpy
examples/notebooks/WWW/sparse_solution.ipynb
gpl-3.0
import cvxpy as cp import numpy as np # Fix random number generator so we can repeat the experiment. np.random.seed(1) # The threshold value below which we consider an element to be zero. delta = 1e-8 # Problem dimensions (m inequalities in n-dimensional space). m = 100 n = 50 # Construct a feasible set of inequali...
tedunderwood/fiction
bert/logistic_regression_baselines.ipynb
mit
# Things that will come in handy import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_score, f1_score from collections import Counter from scipy.stats import pearsonr import random, glob, csv ""...
samgoodgame/sf_crime
iterations/Error Analysis/W207_Final_Project_errorAnalysis_updated_08_21_1930.ipynb
mit
# Additional Libraries %matplotlib inline import matplotlib.pyplot as plt # Import relevant libraries: import time import numpy as np import pandas as pd from sklearn.neighbors import KNeighborsClassifier from sklearn import preprocessing from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import...
kaushikpavani/neural_networks_in_python
src/linear_regression/linear_regression.ipynb
mit
def generate_random_points_along_a_line (slope, intercept, num_points, abs_value, abs_noise): # randomly select x x = np.random.uniform(-abs_value, abs_value, num_points) # y = mx + b + noise y = slope*x + intercept + np.random.uniform(-abs_noise, abs_noise, num_points) return x, y def plot_points(...
adamamiller/NUREU17
LSST/VariableStarClassification/First_Sources.ipynb
mit
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from astropy.table import Table as tab """ Explanation: Inital Sources Using the sources at 007.20321 +14.87119 and RA = 20:50:00.91, dec = -00:42:23.8 taken from the NASA/IPAC Infrared Science Archieve on 6/22/17. End of explanation """ source_1 ...
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies
ex34-Correlations between SOI and SLP, Temperature and Precipitation.ipynb
mit
%matplotlib inline import numpy as np import xarray as xr import pandas as pd from numba import jit from functools import partial from scipy.stats import pearsonr import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') # Set som...
projectmesa/mesa-examples
examples/ForestFire/Forest Fire Model.ipynb
apache-2.0
import random import numpy as np import matplotlib.pyplot as plt %matplotlib inline from mesa import Model, Agent from mesa.time import RandomActivation from mesa.space import Grid from mesa.datacollection import DataCollector from mesa.batchrunner import BatchRunner """ Explanation: The Forest Fire Model A rapid i...
amueller/scipy-2017-sklearn
notebooks/15.Pipelining_Estimators.ipynb
cc0-1.0
import os with open(os.path.join("datasets", "smsspam", "SMSSpamCollection")) as f: lines = [line.strip().split("\t") for line in f.readlines()] text = [x[1] for x in lines] y = [x[0] == "ham" for x in lines] from sklearn.model_selection import train_test_split text_train, text_test, y_train, y_test = train_test...
philippbayer/cats_dogs_redux
Statefarm.ipynb
mit
%%bash cut -f 1 -d ',' driver_imgs_list.csv | grep -v subject | uniq -c lines=$(expr `wc -l driver_imgs_list.csv | cut -f 1 -d ' '` - 1) echo "Got ${lines} pics" """ Explanation: First, make the validation set with different drivers End of explanation """ import csv import os to_get = set(['p081','p075', 'p072', 'p0...
drvinceknight/gt
assets/assessment/2021-2022/ind/assignment.ipynb
mit
import nashpy as nash import numpy as np np.random.seed(0) repetitions = 2000 ### BEGIN SOLUTION ### END SOLUTION """ Explanation: Game Theory - 2021-2022 individual coursework Important Do not delete the cells containing: ``` BEGIN SOLUTION END SOLUTION ``` write your solution attempts in those cells. To submit t...
PythonFreeCourse/Notebooks
week06/2_Functional_Behavior.ipynb
mit
def square(x): return x ** 2 """ Explanation: <img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית."> <span st...
mne-tools/mne-tools.github.io
dev/_downloads/a96f6d7ea0f7ccafcacc578a25e1f8c5/ica_comparison.ipynb
bsd-3-clause
# Authors: Pierre Ablin <pierreablin@gmail.com> # # License: BSD-3-Clause from time import time import mne from mne.preprocessing import ICA from mne.datasets import sample print(__doc__) """ Explanation: Compare the different ICA algorithms in MNE Different ICA algorithms are fit to raw MEG data, and the correspo...
theideasmith/theideasmith.github.io
_notebooks/.ipynb_checkpoints/ODE N-Dimensional Test 1-checkpoint.ipynb
mit
import numpy as np import numpy.ma as ma from scipy.integrate import odeint mag = lambda r: np.sqrt(np.sum(np.power(r, 2))) def g(y, t, q, m, n,d, k): """ n: the number of particles d: the number of dimensions (for fun's sake I want this to work for k-dimensional systems) y: an (n*2,d) di...
pycam/python-basic
python_basic_2_2.ipynb
unlicense
codeList = ['NA06984', 'NA06985', 'NA06986', 'NA06989', 'NA06991'] for code in codeList: print(code) """ Explanation: An introduction to solving biological problems with Python Session 2.2: Loops The <tt>for</tt> loop Exercises 2.2.1 The <tt>while</tt> loop Exercises 2.2.2 Skipping and breaking loops More loopin...
VVard0g/ThreatHunter-Playbook
docs/notebooks/windows/07_discovery/WIN-190625024610.ipynb
mit
from openhunt.mordorutils import * spark = get_spark() """ Explanation: SysKey Registry Keys Access Metadata | Metadata | Value | |:------------------|:---| | collaborators | ['@Cyb3rWard0g', '@Cyb3rPandaH'] | | creation date | 2019/06/25 | | modification date | 2020/09/20 | | playbook related | []...
PythonSanSebastian/ep-tools
notebooks/programme_grid.ipynb
mit
%%javascript IPython.OutputArea.auto_scroll_threshold = 99999; //increase max size of output area import json import datetime as dt from random import choice, randrange, shuffle from copy import deepcopy from collections import OrderedDict, defaultdict from itertools import product from functools import partial from ...
ES-DOC/esdoc-jupyterhub
notebooks/bcc/cmip6/models/sandbox-3/landice.ipynb
gpl-3.0
# DO NOT EDIT ! from pyesdoc.ipython.model_topic import NotebookOutput # DO NOT EDIT ! DOC = NotebookOutput('cmip6', 'bcc', 'sandbox-3', 'landice') """ Explanation: ES-DOC CMIP6 Model Properties - Landice MIP Era: CMIP6 Institute: BCC Source ID: SANDBOX-3 Topic: Landice Sub-Topics: Glaciers, Ice. Properties: 3...
scottquiring/Udacity_Deeplearning
intro-to-tflearn/TFLearn_Digit_Recognition.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...
DS-100/sp17-materials
sp17/hw/hw4/hw4.ipynb
gpl-3.0
import numpy as np import pandas as pd %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import sqlalchemy !pip install -U okpy from client.api.notebook import Notebook ok = Notebook('hw4.ok') """ Explanation: Homework 4: SQL, FEC Data, and Small Donors Due: 11:59pm Tuesday, March 14 Note: The ...
conversationai/unintended-ml-bias-analysis
archive/unintended_ml_bias/fat-star-bias-measurement-tutorial.ipynb
apache-2.0
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import pandas as pd import numpy as np import pkg_resources import matplotlib.pyplot as plt import seaborn as sns import time import scipy.stats as stats from sklearn import metrics from keras.prepr...
johnbachman/indra
models/indra_statements_demo.ipynb
bsd-2-clause
%pylab inline import json from indra.sources import trips from indra.statements import draw_stmt_graph, stmts_to_json """ Explanation: Inspecting INDRA Statements and assembled models In this example we look at how intermediate results of the assembly process from word models to executable models can be inspected. We ...
stuser/temp
pneumoniamnist_CNN.ipynb
mit
# import package import matplotlib.pyplot as plt import numpy as np import os import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras.datasets import cifar10 from tensorflow.keras.models import Sequential, Model from tensorflow.keras.layers import (Input, Dense, Dropout, Activation, GlobalAverag...
c-north/hdbscan
notebooks/Benchmarking scalability of clustering implementations.ipynb
bsd-3-clause
import hdbscan import debacl import fastcluster import sklearn.cluster import scipy.cluster import sklearn.datasets import numpy as np import pandas as pd import time import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set_context('poster') sns.set_palette('Paired', 10) sns.set_color_codes() "...
xgrg/alfa
notebooks/Ages distributions.ipynb
mit
%matplotlib inline import pandas as pd from scipy import stats from matplotlib import pyplot as plt data = pd.read_excel('/home/grg/spm/data/covariates.xls') for i in xrange(5): x = data[data['apo'] == i]['age'].values plt.hist(x, bins=20) print i, 'W:%.4f p:%.4f -'%stats.shapiro(x), len(x), 'subjects bet...
newlawrence/poliastro
docs/source/examples/Analyzing the Parker Solar Probe flybys.ipynb
mit
from astropy import units as u T_ref = 150 * u.day T_ref from poliastro.bodies import Earth, Sun, Venus k = Sun.k k import numpy as np """ Explanation: Analyzing the Parker Solar Probe flybys 1. Modulus of the exit velocity, some features of Orbit #2 First, using the data available in the reports, we try to comput...
fastai/course-v3
nbs/dl1/lesson4-collab.ipynb
apache-2.0
user,item,title = 'userId','movieId','title' path = untar_data(URLs.ML_SAMPLE) path ratings = pd.read_csv(path/'ratings.csv') ratings.head() """ Explanation: Collaborative filtering example collab models use data in a DataFrame of user, items, and ratings. End of explanation """ data = CollabDataBunch.from_df(rati...
julienchastang/unidata-python-workshop
notebooks/Primer/Numpy and Matplotlib Basics.ipynb
mit
# Convention for import to get shortened namespace import numpy as np # Create a simple array from a list of integers a = np.array([1, 2, 3]) a # See how many dimensions the array has a.ndim # Print out the shape attribute a.shape # Print out the data type attribute a.dtype # This time use a nested list of floats ...
radhikapc/foundation-homework
homework11/Homework11-Radhika.ipynb
mit
import dateutils import dateutil.parser import pandas as pd parking_df = pd.read_csv("small-violations.csv") parking_df parking_df.dtypes import datetime parking_df.head()['Issue Date'].astype(datetime.datetime) import pandas as pd parking_df = pd.read_csv("small-violations.csv") parking_df """ Explanation: I w...
ziweiwu/ziweiwu.github.io
notebook/Titanic_Investigation.ipynb
mit
#load the libraries that I might need to use %matplotlib inline import pandas as pd import numpy as np import csv import matplotlib import matplotlib.pyplot as plt import seaborn as sns #read the csv file into a pandas dataframe titanic_original = pd.DataFrame.from_csv('titanic-data.csv', index_col=None) titanic_orig...
jgarciab/wwd2017
class8/class8_impute.ipynb
gpl-3.0
##Some code to run at the beginning of the file, to be able to show images in the notebook ##Don't worry about this cell #Print the plots in this screen %matplotlib inline #Be able to plot images saved in the hard drive from IPython.display import Image #Make the notebook wider from IPython.core.display import dis...
transcranial/keras-js
notebooks/layers/pooling/GlobalAveragePooling3D.ipynb
mit
data_in_shape = (6, 6, 3, 4) L = GlobalAveragePooling3D(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 * np.random.random(data_in_shape) - 1 res...
CAChemE/stochastic-optimization
PSO/1D/1D-Python-PSO-algorithm-viz.ipynb
bsd-3-clause
import numpy as np import matplotlib.pyplot as plt # import scipy as sp # import time %matplotlib inline plt.style.use('bmh') """ Explanation: Particle Swarm Optimization Algorithm (in Python!) [SPOILER] We will be using the Particle Swarm Optimization algorithm to obtain the minumum of a customed objective function...
goerlitz/ds-notebooks
jupyter/kaggle_sf-crime/SF Crime - Convert To DataFrame.ipynb
apache-2.0
import csv import pyspark from pyspark.sql import SQLContext from pyspark.sql.types import * from StringIO import StringIO from datetime import * from dateutil.parser import parse """ Explanation: San Francisco Crime Dataset Conversion Challenge Spark does not support out-of-the box data frame creation from CSV files...
tensorflow/docs-l10n
site/zh-cn/hub/tutorials/cropnet_cassava.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import tensorflow_datasets as tfds import tensorflow_hub as hub #@title Helper function for displaying examples def plot(examples, predictions=None): # Get the images, labels, and optionally predictions images = examples['image'] labels ...
dolittle007/dolittle007.github.io
notebooks/GLM-robust-with-outlier-detection.ipynb
gpl-3.0
%matplotlib inline import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy import optimize import pymc3 as pm import theano as thno import theano.tensor as T # configure some basic options sns.set(style="darkgrid", pa...
renecnielsen/twitter-diy
ipynb/02 Parse Twitter Data.ipynb
mit
from IPython.core.display import HTML styles = open("../css/custom.css", "r").read() HTML(styles) """ Explanation: Parse Twitter Data Import retrieved tweets (from JSON file, pickle or similar) Read in individual tweets Create TSV file (and drop unwanted data) Jupyter Notebook Style Let's make this thing look nice. ...
uwkejia/Clean-Energy-Outlook
examples/Demo.ipynb
mit
from ceo import data_cleaning from ceo import missing_data from ceo import svr_prediction from ceo import ridge_prediction """ Explanation: Examples Importing libraries End of explanation """ data_cleaning.clean_all_data() """ Explanation: datacleaning The datacleaning module is used to clean and organize the data...
vierth/chinese_stylometry
Stanford DH Asia Stylometry.ipynb
gpl-3.0
%pylab inline pylab.rcParams['figure.figsize']=(12,8) """ Explanation: Digital Humanities Asia Workshop Stylometerics and Genre Research in Imperial Chinese Studies Coding for Stylometric Analysis Paul Vierthaler, Boston College @pvierth, vierthal@bc.edu Texts encodings It is important to know the encodings of the fil...
gon1213/SDC
find_lane_lines/CarND_LaneLines_P1/P1.ipynb
gpl-3.0
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 %matplotlib inline #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg') #printing out some stats and plotting print('This image is:', type(image), 'with dimesions:', im...
lukasmerten/CRPropa3
doc/pages/example_notebooks/galactic_lensing/lensing_cr.v4.ipynb
gpl-3.0
import crpropa import numpy as np # read data from CRPropa output into container. # The data is weighted with the source energy ~E**-1 M = crpropa.ParticleMapsContainer() crdata = np.genfromtxt("crpropa_output.txt") Id = np.array([int(x) for x in crdata[:,0]]) E = crdata[:,3] * crpropa.EeV E0 = crdata[:,4] * crpropa.E...
phoebe-project/phoebe2-docs
2.1/examples/detached_rotstar.ipynb
gpl-3.0
!pip install -I "phoebe>=2.1,<2.2" %matplotlib inline """ Explanation: Detached Binary: Roche vs Rotstar Setup Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release). End of expl...
PMEAL/OpenPNM-Examples
Tutorials/intermediate_usage.ipynb
mit
import openpnm as op import scipy as sp """ Explanation: Tutorial 2 of 3: Digging Deeper into OpenPNM This tutorial will follow the same outline as Getting Started, but will dig a little bit deeper at each step to reveal the important features of OpenPNM that were glossed over previously. Learning Objectives Explore ...
marburg-open-courseware/gmoc
docs/mpg-if_error_continue/worksheets/w-02-2_conditionals.ipynb
mit
import pandas as pd url = "http://www.cpc.ncep.noaa.gov/data/indices/oni.ascii.txt" # help(pd.read_fwf) oni = pd.read_fwf(url, widths = [5, 5, 7, 7]) oni.head() ## Your solution goes here: """ Explanation: W02-2.1: Count the number of occurrences of each warm ENSO category Using the ONI data set from the previous w...
lisitsyn/shogun
doc/ipython-notebooks/ica/ecg_sep.ipynb
bsd-3-clause
# change to the shogun-data directory import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') os.chdir(os.path.join(SHOGUN_DATA_DIR, 'ica')) import numpy as np # load data # Data originally from: # http://perso.telecom-paristech.fr/~cardoso/icacentral/base_single.html data = np.loadtxt('foetal_ecg.dat...
xmnlab/pywim
notebooks/StorageRawData.ipynb
mit
from IPython.display import display from datetime import datetime from matplotlib import pyplot as plt from scipy import misc import h5py import json import numpy as np import os import pandas as pd import sys """ Explanation: Table of Contents <p><div class="lev1 toc-item"><a href="#1.-Weigh-in-Motion-Storage-Raw-Da...
KshitijT/fundamentals_of_interferometry
6_Deconvolution/6_1_sky_models.ipynb
gpl-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline from IPython.display import HTML HTML('../style/course.css') #apply general CSS """ Explanation: Outline Glossary 6. Deconvolution in Imaging Previous: 6. Introduction Next: 6.2 Interative Deconvolution with Point Sources (CLEAN) Import sta...
bosscha/alma-calibrator
notebooks/selecting_source/alma_database_selection11.ipynb
gpl-2.0
from collections import Counter filename = "report_8_nonALMACAL_priority.txt" with open(filename, 'r') as ifile: wordcount = Counter(ifile.read().split()) """ Explanation: find a word and count them End of explanation """ current = ['3c454.3', 'J0006-0623', 'J0137+3309', 'J0211+1051', 'J0237+2848', 'J0241-0...
EvanBianco/Practical_Programming_for_Geoscientists
Part2b__Synthetic_seismogram.ipynb
apache-2.0
import numpy as np import matplotlib.pyplot as plt %matplotlib inline """ Explanation: EXERCISE — Simple synthetic This notebook looks at the convolutional model of a seismic trace. For a fuller example, see Bianco, E (2004) in The Leading Edge. First, the usual preliminaries. End of explanation """ from welly impor...
adamamiller/PS1_star_galaxy
gaia/pmStarsForZTFdatabase.ipynb
mit
gaia_dir = "/Users/adamamiller/Desktop/PS1_fits/gaia_stars/" gaia_df = pd.read_hdf(gaia_dir + "parallax_ps1_gaia_mag_pm_plx.h5") pxl_not_pm = np.where((gaia_df["parallax_over_error"] >= 8) & (gaia_df["pm_over_error"] < 7.5)) gaia_df.iloc[pxl_not_pm] """ Explanation: First - test to see if there...
vadim-ivlev/STUDY
handson-data-science-python/DataScience-Python3/MultivariateRegression.ipynb
mit
import pandas as pd df = pd.read_excel('http://cdn.sundog-soft.com/Udemy/DataScience/cars.xls') df.head() """ Explanation: Multivariate Regression Let's grab a small little data set of Blue Book car values: End of explanation """ import statsmodels.api as sm from sklearn.preprocessing import StandardScaler scale ...
atavory/ibex
examples/digits_confidence_intervals.ipynb
bsd-3-clause
import multiprocessing import pandas as pd import numpy as np from sklearn import datasets import seaborn as sns sns.set_style('whitegrid') from sklearn.externals import joblib from ibex.sklearn import decomposition as pd_decomposition from ibex.sklearn import linear_model as pd_linear_model from ibex.sklearn import...
Dioptas/pymatgen
examples/Plotting a Pourbaix Diagram.ipynb
mit
from pymatgen.matproj.rest import MPRester from pymatgen.core.ion import Ion from pymatgen import Element from pymatgen.phasediagram.pdmaker import PhaseDiagram from pymatgen.analysis.pourbaix.entry import PourbaixEntry, IonEntry from pymatgen.analysis.pourbaix.maker import PourbaixDiagram from pymatgen.analysis.pourb...
KiranArun/A-Level_Maths
Matrices/Matrices.ipynb
mit
# we will be using numpy to create the arrays # the code isn't so important in this notebook, just the arrays are import numpy as np """ Explanation: A-Level: Matrices End of explanation """ # array conaining 12 consecutive values in shape 3 by 4 a = np.arange(12).reshape([3,4]) print(a) """ Explanation: Matrices a...
Aniruddha-Tapas/Applied-Machine-Learning
Classification/Classifiying Ionosphere structure using K nearest neigbours algorithm.ipynb
mit
import csv import numpy as np # Size taken from the dataset and is known X = np.zeros((351, 34), dtype='float') y = np.zeros((351,), dtype='bool') with open("data/Ionosphere/ionosphere.data", 'r') as input_file: reader = csv.reader(input_file) for i, row in enumerate(reader): # Get the data, convertin...
mne-tools/mne-tools.github.io
0.23/_downloads/b36af73820a7a52a4df3c42b66aef8a5/source_power_spectrum_opm.ipynb
bsd-3-clause
# Authors: Denis Engemann <denis.engemann@gmail.com> # Luke Bloy <luke.bloy@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os.path as op from mne.filter import next_fast_len import mne print(__doc__) data_path = mne.datasets.opm.data_path() subject = 'OPM_s...
chi-hung/SementicProj
webCrawler/amzProd.ipynb
mit
%watermark """ Explanation: This notebook is written by Yishin and Chi-Hung. End of explanation """ def getVacuumTypeUrl(vacuumType,pageNum=1): vcleaners={"central":11333709011,"canister":510108,"handheld":510114,"robotic":3743561,"stick":510112,"upright":510110,"wetdry":553022} url_type_base="https://www.am...
cfjhallgren/shogun
doc/ipython-notebooks/statistical_testing/mmd_two_sample_testing.ipynb
gpl-3.0
%pylab inline %matplotlib inline import os SHOGUN_DATA_DIR=os.getenv('SHOGUN_DATA_DIR', '../../../data') import shogun as sg import numpy as np """ Explanation: Kernel hypothesis testing in Shogun Heiko Strathmann - heiko.strathmann@gmail.com - http://github.com/karlnapf - http://herrstrathmann.de Soumyajit De - soumy...
phaustin/pyman
Book/chap4/chap4_io.ipynb
cc0-1.0
strname = input("prompt to user ") """ Explanation: Input and Output A good relationship depends on good communication. In this chapter you learn how to communicate with Python. Of course, communicating is a two-way street: input and output. Generally, when you have Python perform some task, you need to feed it inform...
feffenberger/StatisticalMethods
examples/SDSScatalog/GalaxySizes.ipynb
gpl-2.0
%load_ext autoreload %autoreload 2 from __future__ import print_function import numpy as np import SDSS import pandas as pd import matplotlib %matplotlib inline galaxies = "SELECT top 1000 \ petroR50_i AS size, \ petroR50Err_i AS err \ FROM PhotoObjAll \ WHERE \ (type = '3' AND petroR50Err_i > 0)" print (galaxies) #...
UltronAI/Deep-Learning
CS231n/assignment2/Dropout.ipynb
mit
# 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...
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/08_image/labs/flowers_fromscratch.ipynb
apache-2.0
!sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst import os PROJECT = "cloud-training-demos" # REPLACE WITH YOUR PROJECT ID BUCKET = "cloud-training-demos-ml" # REPLACE WITH YOUR BUCKET NAME REGION = "us-central1" # REPLACE WITH YOUR BUCKET REGION e.g. us-central1 # do not change these os.environ["PR...
alexandrnikitin/algorithm-sandbox
courses/DAT256x/Module02/02 - 02 - Limits.ipynb
mit
%matplotlib inline # Here's the function def f(x): return x**2 + x from matplotlib import pyplot as plt # Create an array of x values from 0 to 10 to plot x = list(range(0, 11)) # Get the corresponding y values from the function y = [f(i) for i in x] # Set up the graph plt.xlabel('x') plt.ylabel('f(x)') plt.g...
arcyfelix/Courses
17-09-17-Python-for-Financial-Analysis-and-Algorithmic-Trading/02-NumPy/.ipynb_checkpoints/Numpy Exercises-checkpoint.ipynb
apache-2.0
# CODE HERE """ Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> <center>Copyright Pierian Data 2017</center> <center>For more information, visit us at www.pieriandata.com</center> NumPy Exercises Now that we've learned about NumPy let's test your knowledge. We'll start of...
ALEXKIRNAS/DataScience
CS231n/assignment2/BatchNormalization.ipynb
mit
# 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...
UltronAI/Deep-Learning
CS231n/assignment2/.ipynb_checkpoints/PyTorch-checkpoint.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 ...
diego0020/va_course_2015
text_analysis/Text_Analysis_Tutorial.ipynb
mit
%cd C:/temp/ import pandas as pd train = pd.read_csv("labeledTrainData.tsv", header=0, delimiter="\t", quoting=3) """ Explanation: Bag-of-Words The bag-of-words model is a simplifying representation used in natural language processing and information retrieval (IR). In this model, a text (such as a sentence or...
ES-DOC/esdoc-jupyterhub
notebooks/cccma/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', 'cccma', 'sandbox-3', 'seaice') """ Explanation: ES-DOC CMIP6 Model Properties - Seaice MIP Era: CMIP6 Institute: CCCMA Source ID: SANDBOX-3 Topic: Seaice Sub-Topics: Dynamics, Thermodynamics, Ra...
atlury/deep-opencl
DL0110EN/3.3.1_softmax_in_one_dimension_v2.ipynb
lgpl-3.0
# Import the libraries we need for this lab import torch.nn as nn import torch import matplotlib.pyplot as plt import numpy as np from torch.utils.data import Dataset, DataLoader """ Explanation: <a href="http://cocl.us/pytorch_link_top"> <img src="https://cocl.us/Pytorch_top" width="750" alt="IBM 10TB Storage" ...
Kaggle/learntools
notebooks/data_viz_to_coder/raw/ex4.ipynb
apache-2.0
import pandas as pd pd.plotting.register_matplotlib_converters() import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns print("Setup Complete") """ Explanation: In this exercise, you will use your new knowledge to propose a solution to a real-world scenario. To succeed, you will need to import data ...
PrincetonACM/princetonacm.github.io
events/code-at-night/archive/python_talk/intro_to_python.ipynb
mit
# When a line begins with a '#' character, it designates a comment. This means that it's not actually a line of code # Can you print 'hello world', as is customary for those new to a language? # Can you make Python print the staircase below: # # ======== # | | # ...
Nixonite/Handwritten-Digit-Classification-Using-SVD
SVD Classification of Handwritten Digits.ipynb
gpl-2.0
import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline data = pd.read_csv("train.csv") data.head() """ Explanation: For this project, I will attempt to classify handwritten digits using SVD's left-singular vectors as fundamental subspaces for each digit. The approach will be to gene...
noppanit/machine-learning
parking-signs-nyc/.ipynb_checkpoints/Parking Signs-checkpoint.ipynb
mit
row = 'NO PARKING (SANITATION BROOM SYMBOL) 7AM-7:30AM EXCEPT SUNDAY' assert from_time(row) == '07:00AM' assert to_time(row) == '07:30AM' special_case1 = 'NO PARKING (SANITATION BROOM SYMBOL) 11:30AM TO 1PM THURS' assert from_time(special_case1) == '11:30AM' assert to_time(special_case1) == '01:00PM' special_case2 = ...
nafitzgerald/allennlp
tutorials/notebooks/data_pipeline.ipynb
apache-2.0
# This cell just makes sure the library paths are correct. # You need to run this cell before you run the rest of this # tutorial, but you can ignore the contents! import os import sys module_path = os.path.abspath(os.path.join('../..')) if module_path not in sys.path: sys.path.append(module_path) """ Explanation...
tata-antares/jet_tagging_LHCb
jet-tagging-stacking.ipynb
apache-2.0
treename = 'tag' data_b = pandas.DataFrame(root_numpy.root2array('datasets/type=5.root', treename=treename)).dropna() data_b = data_b[::40] data_c = pandas.DataFrame(root_numpy.root2array('datasets/type=4.root', treename=treename)).dropna() data_light = pandas.DataFrame(root_numpy.root2array('datasets/type=0.root', tr...
googlecodelabs/odml-pathways
object-detection/codelab2/python/Train_a_salad_detector_with_TFLite_Model_Maker.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...
psi4/DatenQM
docs/qcfractal/source/quickstart.ipynb
bsd-3-clause
from qcfractal import FractalSnowflakeHandler import qcfractal.interface as ptl """ Explanation: Example This tutorial will go over general QCFractal usage to give a feel for the ecosystem. In this tutorial, we employ Snowflake, a simple QCFractal stack which runs on a local machine for demonstration and exploration...
IST256/learn-python
content/lessons/05-Functions/SmallGroup-Functions.ipynb
mit
#ORIGINAL CODE import random choices = ['rock', 'paper', 'scissors'] wins = 0 losses = 0 ties = 0 computer = random.choice(choices) you = 'rock' #Always rock strategy if (you == 'rock' and computer == 'scissors'): outcome = "win" elif (you == 'scissors' and computer =='rock'): outcome = "lose" elif (you == ...
anandha2017/udacity
nd101 Deep Learning Nanodegree Foundation/DockerImages/projects/03-tv-script-generation/notebooks/dlnd_tv_script_generation.ipynb
mit
""" DON'T MODIFY ANYTHING IN THIS CELL """ import helper data_dir = './data/simpsons/moes_tavern_lines.txt' text = helper.load_data(data_dir) # Ignore notice, since we don't use it for analysing the data text = text[81:] """ Explanation: TV Script Generation In this project, you'll generate your own Simpsons TV scri...
isendel/machine-learning
ml-regression/week3-4/.ipynb_checkpoints/week-4-ridge-regression-assignment-1-checkpoint.ipynb
apache-2.0
import pandas as pd import numpy as np from sklearn import linear_model dtype_dict = {'bathrooms':float, 'waterfront':int, 'sqft_above':int, 'sqft_living15':float, 'grade':int, 'yr_renovated':int, 'price':float, 'bedrooms':float, 'zipcode':str, 'long':float, 'sqft_lot15':float, 'sqft_living':float, 'floors':float, 'co...
freedomtan/tensorflow
tensorflow/lite/examples/experimental_new_converter/Keras_LSTM_fusion_Codelab.ipynb
apache-2.0
!pip install tf-nightly """ Explanation: Overview This CodeLab demonstrates how to build a fused TFLite LSTM model for MNIST recognition using Keras, and how to convert it to TensorFlow Lite. The CodeLab is very similar to the Keras LSTM CodeLab. However, we're creating fused LSTM ops rather than the unfused versoin. ...
QuantStack/quantstack-talks
2018-11-14-PyParis-widgets/notebooks/1.ipywidgets.ipynb
bsd-3-clause
from ipywidgets import IntSlider slider = IntSlider() slider slider.value slider.value = 20 slider """ Explanation: <center><img src="src/ipywidgets.svg" width="50%"></center> Repository: https://github.com/jupyter-widgets/ipywidgets Installation: conda install -c conda-forge ipywidgets Simple slider for driving ...
thehackerwithin/berkeley
code_examples/python_mayavi/mayavi_basic.ipynb
bsd-3-clause
# try one example, figure is created by default mlab.test_molecule() """ Explanation: Overview Mayavi is a high level plotting library built on tvtk. Mayavi has a uses mlab for it's higher level plotting functions. The list of plotting functions can be found here. Functions exist for ploting lines, surfaces, 3d contou...
geoffbacon/semrep
semrep/evaluate/koehn/koehn.ipynb
mit
%matplotlib inline import os import csv import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set() from sklearn.linear_model import LogisticRegression, LogisticRegressionCV from sklearn.model_selection import train_test_split, StratifiedKFold from sklearn.metrics import roc_c...
dipanjank/ml
data_analysis/digit_recognition/feature_extractor.ipynb
gpl-3.0
%pylab inline pylab.style.use('ggplot') import numpy as np import pandas as pd import cv2 import os image_dir = os.path.join(os.getcwd(), 'font_images') if not os.path.isdir(image_dir) or len(os.listdir(image_dir)) == 0: print('no images found in {}'.format(image_dir)) """ Explanation: In this notebook, we loa...
h2oai/h2o-3
h2o-py/demos/uplift_drf_demo.ipynb
apache-2.0
import h2o from h2o.estimators.uplift_random_forest import H2OUpliftRandomForestEstimator import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.style as style import pandas as pd h2o.init(strict_version_check=False) # max_mem_size=10 """ Explanation: H2O Uplift Distributed Random Forest Author:...
DOV-Vlaanderen/pydov
docs/notebooks/search_grondwatermonsters.ipynb
mit
%matplotlib inline import inspect, sys # check pydov path import pydov """ Explanation: Example of DOV search methods for groundwater samples (grondwatermonsters) Use cases: Get groundwater samples in a bounding box Get groundwater samples with specific properties Get the coordinates of all groundwater samples in G...
Quantiacs/quantiacs-python
sampleSystems/svm_momentum_tutorial.ipynb
mit
import quantiacsToolbox import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn import svm %matplotlib inline %%html <style> table {float:left} </style> """ Explanation: Quantiacs Toolbox Sample: Support Vector Machine(Momentum) This tutorial will show you how to use svm and momentum to pr...
liganega/Gongsu-DataSci
notebooks/GongSu11_List_Comprehension.ipynb
gpl-3.0
odd_20 = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19] """ Explanation: 리스트 조건제시법(List Comprehension) 주요 내용 주어진 리스트를 이용하여 특정 성질을 만족하는 새로운 리스트를 생성하고자 할 때 리스트 조건제시법을 활용하면 매우 효율적인 코딩을 할 수 있다. 리스트 조건제시법은 집합을 정의할 때 사용하는 조건제시법과 매우 유사하다. 예를 들어,0부터 1억 사이에 있는 홀수들을 원소로 갖는 집합을 정의하려면 두 가지 방법을 활용할 수 있다. 원소나열법 {1, 3, 5, 7, 9, 11, ..., ...
akritichadda/K-AND
daniel/.ipynb_checkpoints/DB_project_oculomotor_v2-checkpoint.ipynb
mit
fid_VIS_SCm, fpd_VIS_SCm=get_connectivity('VIS','SCm') fid_SCm_PRNc, fpd_SCm_PRNc=get_connectivity('SCm','PRNc') fid_SCm_PRNr, fpd_SCm_PRNr=get_connectivity('SCm','PRNr') fid_PRNc_III, fpd_PRNc_III=get_connectivity('PRNc','III') fid_PRNc_VI, fpd_PRNc_VI=get_connectivity('PRNc','VI') fid_PRNr_VI, fpd_PRNr_VI=get_co...
ajgpitch/qutip-notebooks
examples/qip-noisy-device-simulator.ipynb
lgpl-3.0
import copy import numpy as np import matplotlib.pyplot as plt pi = np.pi from qutip.qip.device import Processor from qutip.operators import sigmaz, sigmay, sigmax, destroy from qutip.states import basis from qutip.metrics import fidelity from qutip.qip.operations import rx, ry, rz, hadamard_transform """ Explanation...
ozorich/phys202-2015-work
assignments/assignment05/InteractEx02.ipynb
mit
%matplotlib inline from matplotlib import pyplot as plt import numpy as np from IPython.html.widgets import interact, interactive, fixed from IPython.display import display """ Explanation: Interact Exercise 2 Imports End of explanation """ def plot_sine1(a,b): x=np.linspace(0,4*np.pi,100) y=np.sin(a*x+b) ...
mangeshjoshi819/ml-learn-python3
BasicString _and_Csv.ipynb
mit
print(3+"mangesh") print(str(3)+"mangesh") record={"name":"mangeesh","price":34,"country":"Brazil"} """ Explanation: Basic Python Strings Python3 has representation of String using unicode.Unicode is by default in python. Python has dynamic typing e.g. print(3+"mangesh") will not work need to convert 3 to str(3) En...
mne-tools/mne-tools.github.io
0.12/_downloads/plot_read_evoked.ipynb
bsd-3-clause
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) from mne import read_evokeds from mne.datasets import sample print(__doc__) data_path = sample.data_path() fname = data_path + '/MEG/sample/sample_audvis-ave.fif' # Reading condition = 'Left Auditory' evoked = read_e...
googleinterns/multimodal-long-transformer-2021
preprocessing/create_fashion_gen_metadata.ipynb
apache-2.0
import pandas as pd import tensorflow as tf # i2t: image-to-text. i2t_path = '/bigstore/mmt/raw_data/fashion_gen/fashion_gen_i2t_test_pairs.csv' # t2i: text-to-image. t2i_path = '/bigstore/mmt/raw_data/fashion_gen/fashion_gen_t2i_test_pairs.csv' t2i_output_path = '/bigstore/mmt/fashion_gen/metadata/fashion_bert_t2i_t...
poppy-project/community-notebooks
debug/poppy-torso_poppy-humanoid_poppy-ergo__motor_scan.ipynb
lgpl-3.0
import pypot.dynamixel ports = pypot.dynamixel.get_available_ports() if not ports: raise IOError('no port found!') print 'ports found', ports """ Explanation: Motors scan Scan all ports to find the connected Dynamixel motors End of explanation """ using_XL320 = False my_baudrate = 1000000 """ Explanation: Prot...