repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
beyondvalence/biof509_wtl | Wk05-OOP2/Wk05-OOP-Public-interface_wl.ipynb | mit | class Item(object):
def __init__(self, name, description, location):
self.name = name
self.description = description
self.location = location
def update_location(self, new_location):
pass
class Equipment(Item):
pass
class Consumable(Item):
... |
StingraySoftware/notebooks | Transfer Functions/TransferFunction Tutorial.ipynb | mit | import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
"""
Explanation: Contents
This notebook covers the basics of creating TransferFunction object, obtaining time and energy resolved responses, plotting them and using IO methods available. Finally, artificial responses are introduced which provid... |
tpin3694/tpin3694.github.io | regex/match_a_symbol.ipynb | mit | # Load regex package
import re
"""
Explanation: Title: Match A Symbol
Slug: match_a_symbol
Summary: Match A Symbol
Date: 2016-05-01 12:00
Category: Regex
Tags: Basics
Authors: Chris Albon
Based on: Regular Expressions Cookbook
Preliminaries
End of explanation
"""
# Create a variable containing a text string
text =... |
h-mayorquin/time_series_basic | presentations/2016-03-01(Visualizing Data Clusters Nexa Wall Street Columns).ipynb | bsd-3-clause | import h5py
import matplotlib.pyplot as plt
import sys
sys.path.append("../")
%matplotlib inline
from visualization.data_clustering import visualize_data_cluster_text_to_image_columns
"""
Explanation: We visualize here the data cluster for the Wall Street Data presented in the columns version
End of explanation
"""
... |
fonnesbeck/ngcm_pandas_2016 | notebooks/2.1 - High-level Plotting with pandas and Seaborn.ipynb | cc0-1.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
normals = pd.Series(np.random.normal(size=10))
normals.plot()
"""
Explanation: High-level Plotting with Pandas and Seaborn
In 2016, there are more options for generating plots in Python than ever before:
matplotlib
Pandas
Seabo... |
kubeflow/kfp-tekton-backend | samples/tutorials/mnist/00_Kubeflow_Cluster_Setup.ipynb | apache-2.0 | work_directory_name = 'kubeflow'
! mkdir -p $work_directory_name
%cd $work_directory_name
"""
Explanation: Deploying a Kubeflow Cluster on Google Cloud Platform (GCP)
This notebook provides instructions for setting up a Kubeflow cluster on GCP using the command-line interface (CLI). For additional help, see the guid... |
ValueFromData/reasoning-under-uncertainty | 1-invitation-to-probability.ipynb | cc0-1.0 | %matplotlib inline
import numpy as np
import scipy.stats as stats
import matplotlib.pylab as pylab
from matplotlib import pyplot as plt
"""
Explanation: Reasoning Under Uncertainty Workshop
PyCon 2015
Part 1 : An invitation to probability
Author : Ronojoy Adhikari
Email : rjoy@imsc.res.in | Web : www.imsc.res.in... |
ES-DOC/esdoc-jupyterhub | notebooks/nerc/cmip6/models/sandbox-3/atmoschem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'nerc', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: NERC
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Topics: Transport, Emissions ... |
mjones01/NEON-Data-Skills | tutorials-in-development/DI-remote-sensing-python/Day2_LiDAR/Day2_Lesson1_Intro_NEON_AOP_LiDAR_Rasters_GDAL/notebook/2018.2.1_GDAL_Read_Classify_LiDAR_Rasters.ipynb | agpl-3.0 | import numpy as np
import gdal, copy
import matplotlib.pyplot as plt
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
"""
Explanation: Classify a Raster Using Threshold Values
In this tutorial, we will work with the NEON AOP L3 LiDAR ecoysystem structure (Canopy Height Model) data product. Refer to... |
sauloal/ipython | probes/gff_reader.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#import matplotlib as plt
#plt.use('TkAgg')
import operator
import pylab
pylab.show()
%pylab inline
"""
Explanation: GFF plotter
Helping hands
http://nbviewer.ipython.org/github/herrfz/dataanalysis/blob/master/week2/getting_data.ipynb
http://n... |
robertoalotufo/ia898 | 2S2018/Seminarios/Dithering.ipynb | mit | import numpy as np
from PIL import Image
%matplotlib inline
import matplotlib.pyplot as plt
img = Image.open('../seminario/imagens/man_r2.tif')
img_quant = img.quantize(2,1)
"""
Explanation: Dithering
Dithering é um processo de redução da quantização de uma imagem que cria a ilusão de que não foi perdida muita infor... |
Naereen/notebooks | NetHack's functions Rne, Rn2 and Rnz in Python 3.ipynb | mit | %load_ext watermark
%watermark -v -m -p numpy,matplotlib
import random
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: Table of Contents
<p><div class="lev1 toc-item"><a href="#NetHack's-functions-Rne,-Rn2-and-Rnz-in-Python-3" data-toc-modified-id="NetHack's-functions-Rne,-Rn2-and-Rnz-in-Python-3-... |
jstac/yale_class_2016 | equilibrium_2.ipynb | bsd-3-clause | import numpy as np
from scipy.optimize import bisect
"""
Explanation: Equilibrium Price, Take 2
Jan 2016
First we import some functionality from the scientific libraries
End of explanation
"""
def supply(price, b):
return np.exp(b * price) - 1
def demand(price, a, epsilon):
return a * price**(-epsilon)
"""... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/nicam16-9s/toplevel.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-9s', 'toplevel')
"""
Explanation: ES-DOC CMIP6 Model Properties - Toplevel
MIP Era: CMIP6
Institute: MIROC
Source ID: NICAM16-9S
Sub-Topics: Radiative Forcings.
Properties: 85 ... |
unpingco/Python-for-Probability-Statistics-and-Machine-Learning | chapters/machine_learning/notebooks/pca.ipynb | mit | from IPython.display import Image
Image('../../../python_for_probability_statistics_and_machine_learning.jpg')
"""
Explanation: Principal Component Analysis
End of explanation
"""
from sklearn import decomposition
import numpy as np
pca = decomposition.PCA()
"""
Explanation: The features from a particular dataset ... |
SlipknotTN/udacity-deeplearning-nanodegree | intro-to-rnns/Anna_KaRNNa.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is base... |
carthach/essentia | src/examples/tutorial/example_clickdetector.ipynb | agpl-3.0 | import essentia.standard as es
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import Audio
from essentia import array as esarr
plt.rcParams["figure.figsize"] =(12,9)
def compute(x, frame_size=1024, hop_size=512, **kwargs):
clickDetector = es.ClickDetector(frameSize=frame_size,
... |
tpin3694/tpin3694.github.io | machine-learning/one-hot_encode_features_with_multiple_labels.ipynb | mit | # Load libraries
from sklearn.preprocessing import MultiLabelBinarizer
import numpy as np
"""
Explanation: Title: One-Hot Encode Features With Multiple Labels
Slug: one-hot_encode_features_with_multiple_labels
Summary: How to one-hot encode nominal categorical features with multiple labels per observation for mach... |
google/earthengine-api | python/examples/ipynb/authorize_notebook_server.ipynb | apache-2.0 | import ee
"""
Explanation: Overview
This notebook guides you through process of testing if the Jupyter Notebook server is authorized to access the Earth Engine servers, and provides a way to authorize the server, if needed.
Testing if the Jupyter Notebook server is authorized to access Earth Engine
To begin, first ver... |
arviz-devs/arviz | doc/source/getting_started/XarrayforArviZ.ipynb | apache-2.0 | # Load the centered eight schools model
import arviz as az
data = az.load_arviz_data("centered_eight")
data
"""
Explanation: (xarray_for_arviz)=
Introduction to xarray, InferenceData, and netCDF for ArviZ
While ArviZ supports plotting from familiar data types, such as dictionaries and NumPy arrays, there are a couple... |
InsightLab/data-science-cookbook | 2019/09-clustering/Notebook_KMeans_Answer.ipynb | mit | # import libraries
# linear algebra
import numpy as np
# data processing
import pandas as pd
# data visualization
from matplotlib import pyplot as plt
# load the data with pandas
dataset = pd.read_csv('dataset.csv', header=None)
dataset = np.array(dataset)
plt.scatter(dataset[:,0], dataset[:,1], s=10)
plt.show()
... |
fonnesbeck/baseball | notebooks/Pitch Classification.ipynb | mit | from pybaseball import statcast
pitch_data = statcast(start_dt='2017-04-01', end_dt='2017-04-30')
pitch_data.shape
pitch_data.pitch_type.value_counts()
pitch_type = pitch_data.pop('pitch_type')
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
... |
CalPolyPat/phys202-2015-work | assignments/assignment07/AlgorithmsEx01.ipynb | mit | %matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
import re
"""
Explanation: Algorithms Exercise 1
Imports
End of explanation
"""
def tokenize(s, stop_words=None, punctuation='`~!@#$%^&*()_-+={[}]|\:;"<,>.?/}\t'):
"""Split a string into a list of words, removing punctuation and stop word... |
PMEAL/OpenPNM | examples/reference/uncategorized/overview_of_domain_syntax.ipynb | mit | import numpy as np
import openpnm as op
pn = op.network.Cubic([2, 4, 1])
print(pn)
"""
Explanation: OpenPNM Version 3: The new @domain syntax
The latest version of OpenPNM includes a new syntax feature with several uses. This notebooks outlines benefits of this new feature, starting with the superficial or immediatel... |
mne-tools/mne-tools.github.io | 0.20/_downloads/2567f25ca4c6b483c12d38184d7fe9d7/plot_decoding_xdawn_eeg.ipynb | bsd-3-clause | # Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import c... |
ledeprogram/algorithms | class6/donow/m0nica_Class6_DoNow.ipynb | gpl-3.0 | import pandas as pd
import matplotlib.pyplot as plt
#DISPLAY MOTPLOTLIB INLINE WITH THE NOTEBOOK AS OPPOSED TO POP UP WINDOW
%matplotlib inline
import statsmodels.formula.api as smf # package we'll be using for linear regression
"""
Explanation: 1. Import the necessary packages to read in the data, plot, and create a ... |
AC209ConsumerConfidence/AC209ConsumerConfidence.github.io | NYTimes_API_Final.ipynb | gpl-3.0 | from nytimesarticle import articleAPI
api = articleAPI('ca372b5c9318406780fe9ebef28e96a1')
"""
Explanation: <hr width=80%>
<center>Obtaining the Data</center>
<hr width=80%>
Consumer Confidence Index
New York Times Articles
Article Search API
Peculiarities of the API
Downloading the Data
Working with the Files
... |
autism-research-centre/Autism-Gradients | .ipynb_checkpoints/Gradients-checkpoint.ipynb | gpl-3.0 | ## lets start with some actual script
# import useful things
import numpy as np
import os
import nibabel as nib
from sklearn.metrics import pairwise_distances
# get a list of inputs
from os import listdir
from os.path import isfile, join
import os.path
# little helper function to return the proper filelist with the f... |
phoebe-project/phoebe2-docs | development/examples/minimal_synthetic.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Minimal Example to Produce a Synthetic Light Curve
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
from phoebe import ... |
tpin3694/tpin3694.github.io | statistics/pearsons_correlation_coefficient.ipynb | mit | import statistics as stats
"""
Explanation: Title: Pearson's Correlation Coefficient
Slug: pearsons_correlation_coefficient
Summary: Pearson's Correlation Coefficient in Python.
Date: 2016-02-08 12:00
Category: Statistics
Tags: Basics
Authors: Chris Albon
Based on this StackOverflow answer by cbare.
Preliminarie... |
jepegit/cellpy | dev_utils/tab_completion.ipynb | mit | df1 = pd.DataFrame(data=np.random.rand(5, 3), columns=["a b c".split()])
df2 = pd.DataFrame(
data=np.random.rand(5, 3), columns=["current voltage capacity".split()]
)
df3 = pd.DataFrame(data=np.random.rand(5, 3), columns=["d e f".split()])
df_dict = {"first": df1, "second": df2, "third": df3}
"""
Explanation: C... |
impactlab/eemeter | docs/datastore_basic_usage.ipynb | mit | # library imports
import pandas as pd
import requests
import pytz
"""
Explanation: Datastore basic usage
The datastore is a tool for using the eemeter which automates
and helps to scales some of the most frequent tasks accomplished by the
eemeter. These tasks include data loading and storage, meter
running, and result... |
CRPropa/CRPropa3 | doc/pages/example_notebooks/advanced/CustomObserver.v4.ipynb | gpl-3.0 | import crpropa
class ObserverPlane(crpropa.ObserverFeature):
"""
Detects all particles after crossing the plane. Defined by position (any
point in the plane) and vectors v1 and v2.
"""
def __init__(self, position, v1, v2):
crpropa.ObserverFeature.__init__(self)
# calculate three po... |
mne-tools/mne-tools.github.io | 0.20/_downloads/2369809188e1e28fb4d0ad564cdfa36d/plot_source_space_time_frequency.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, source_band_induced_power
print(__doc__)
"""
Explanation: Compute induced power in... |
ruxi/tools | docs/notebooks/1_Notebook_DevNotes_XyDB.ipynb | mit | %ls dist
"""
Explanation: update changes to pypi
```bash
update pypi
rm -r dist # remove old source files
python setup.py sdist # make source distribution
python setup.py bdist_wheel # make build distribution with .whl file
twine upload dist/ # pip install twine
```
End of explanation
"""
... |
tensorflow/docs-l10n | site/zh-cn/lite/performance/post_training_integer_quant.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... |
AGrosserHH/GAN | DCGAN/DCGAN.ipynb | apache-2.0 | import numpy as np
from keras.datasets import mnist
import keras
from keras.layers import Input, UpSampling2D, Conv2DTranspose, Conv2D, LeakyReLU
from keras.layers.core import Reshape,Dense,Dropout,Activation,Flatten
from keras.models import Sequential
from keras.optimizers import RMSprop, Adam
from tensorflow.example... |
jegibbs/phys202-2015-work | assignments/assignment02/ProjectEuler6.ipynb | mit | sum_of_squares = sum([i ** 2 for i in range(1,101)])
"""
Explanation: Project Euler: Problem 6
https://projecteuler.net/problem=6
The sum of the squares of the first ten natural numbers is,
$$1^2 + 2^2 + ... + 10^2 = 385$$
The square of the sum of the first ten natural numbers is,
$$(1 + 2 + ... + 10)^2 = 55^2 = 3025$... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_background_filtering.ipynb | bsd-3-clause | import numpy as np
from scipy import signal, fftpack
import matplotlib.pyplot as plt
from mne.time_frequency.tfr import morlet
from mne.viz import plot_filter, plot_ideal_filter
import mne
sfreq = 1000.
f_p = 40.
flim = (1., sfreq / 2.) # limits for plotting
"""
Explanation: Background information on filtering
Her... |
trsherborne/learn-python | giag.ipynb | mit | # -*- coding: utf-8 -*-
%matplotlib inline
import numpy as np
import pandas as pd
from pandas_datareader import data as web
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.finance as mpf
# Choose a stock
ticker = 'GOOG'
# Choose a start date in US format MM/DD/YYYY
stock_start = '10/2/2014'... |
rashikaranpuria/Machine-Learning-Specialization | Clustering_&_Retrieval/Week4/Assignment2/4_em-with-text-data_blank.ipynb | mit | import graphlab
"""
Explanation: Fitting a diagonal covariance Gaussian mixture model to text data
In a previous assignment, we explored k-means clustering for a high-dimensional Wikipedia dataset. We can also model this data with a mixture of Gaussians, though with increasing dimension we run into two important issue... |
nvergos/DAT-ATX-1_Project | Notebooks/3. Dimensionality Reduction.ipynb | mit | import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from scipy import stats
import seaborn as sns
sns.set(rc={"axes.labelsize": 15});
# Some nice default configuration for plots
plt.rcParams['figure.figsize'] = 10, 7.5;
plt.rcPa... |
re-mint/eotarchive-quantitative | Check Database Tables.ipynb | gpl-3.0 | import requests
import io
import pandas
from itertools import chain
def makeurl(tablename,start,end):
return "https://iaspub.epa.gov/enviro/efservice/{tablename}/JSON/rows/{start}:{end}".format_map(locals())
def table_count(tablename):
url= "https://iaspub.epa.gov/enviro/efservice/{tablename}/COUNT/JSON".form... |
tschinz/iPython_Workspace | 02_WP/General/ETH_DDR_Calculations.ipynb | gpl-2.0 | import numpy as np
resolutions = [360, 600, 1200, 2400, 4800] # dpi
inch2mm = 25.4 # mm/inch
framelength_bytes = 8192
pixel_bitnb = 4
physical_frame_length = np.empty(shape=[len(resolutions)], dtype=np.float64) # mm
for i in range(len(resolutions)):
physical_frame_length[i] = (inch2mm / resolut... |
pastas/pastas | concepts/hantush_response.ipynb | mit | import numpy as np
import pandas as pd
import pastas as ps
ps.show_versions()
"""
Explanation: Hantush response functions
This notebook compares the two Hantush response function implementations in Pastas.
Developed by D.A. Brakenhoff (Artesia, 2021)
Contents
Hantush versus HantushWellModel
Which Hantush should I us... |
ES-DOC/esdoc-jupyterhub | notebooks/miroc/cmip6/models/nicam16-9s/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'miroc', 'nicam16-9s', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MIROC
Source ID: NICAM16-9S
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy B... |
phoebe-project/phoebe2-docs | development/examples/eccentric_ellipsoidal.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
"""
Explanation: Eccentric Ellipsoidal (Heartbeat)
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
import numpy as np
b = phoebe.defau... |
CondensedOtters/PHYSIX_Utils | Projects/Moog_2016-2019/CO2/CO2_NN/forces.ipynb | gpl-3.0 | import sys
sys.path.append("/Users/mathieumoog/Documents/LibAtomicSim/Python/")
"""
Explanation: Matching Atomic Forces using Neural Nets and Gaussians Overlaps
Loading Tech Stuff
First we load the python path to LibAtomicSim, which will give us some useful functions
End of explanation
"""
# NN
import keras
# Descri... |
letsgoexploring/economicData | business-cycle-data/python/.ipynb_checkpoints/business_cycle_data-checkpoint.ipynb | mit | import pandas as pd
import numpy as np
import fredpy as fp
import matplotlib.pyplot as plt
plt.style.use('classic')
%matplotlib inline
# Export path: Set to empty string '' if you want to export data to current directory
export_path = '../Csv/'
# Load FRED API key
fp.api_key = fp.load_api_key('fred_api_key.txt')
""... |
susantabiswas/Natural-Language-Processing | Notebooks/Word_Prediction_Quadgram_In_Constant_Time.ipynb | mit | from nltk.util import ngrams
from collections import defaultdict
from collections import OrderedDict
import string
import time
import gc
start_time = time.time()
"""
Explanation: Word prediction using Quadgram
This program reads the corpus line by line.This reads the corpus one line at a time loads it into the memory... |
LargePanda/GEAR_Network | notebooks/.ipynb_checkpoints/pipeline-checkpoint.ipynb | gpl-3.0 | import json
from data_collection_util import *
# load original profile
with open("../profile/profile.json") as f:
orig_profile = json.load(f)
import codecs
with codec.open("../profile/profile2.json", "w") as f:
json.dump(f)
# load original profile
with open("../profile/profile.json") as f:
orig_profile =... |
royalosyin/Python-Practical-Application-on-Climate-Variability-Studies | ex02-Read SST data, create and save nino3 time series.ipynb | mit | %matplotlib inline
import numpy as np
from numpy import nonzero
import matplotlib.pyplot as plt # to generate plots
from mpl_toolkits.basemap import Basemap # plot on map projections
import matplotlib.dates as mdates
import datetime
from netCDF4 import Dataset # http://unidata.github.io/netcdf4-p... |
JasonSanchez/w261 | week5/HW5-Phase2_update_10121400.ipynb | mit | !ls | grep "mo"
"""
Explanation: MIDS - w261 Machine Learning At Scale
Course Lead: Dr James G. Shanahan (email Jimi via James.Shanahan AT gmail.com)
Assignment - HW5 - Phase 2
Group Members:
Jim Chen, Memphis, TN, jim.chen@ischool.berkeley.edu
Manuel Moreno, Salt Lake City, UT, momoreno@ischool.berkeley.edu
Rahul R... |
gkc1000/pyscf | pyscf/nao/notebook/AWS/example-ase-siesta-pyscf-ch4-dens-change-gpu.ipynb | apache-2.0 | # import libraries and set up the molecule geometry
from ase.units import Ry, eV, Ha
from ase.calculators.siesta import Siesta
from ase import Atoms
import numpy as np
import matplotlib.pyplot as plt
from timeit import default_timer as timer
from ase.build import molecule
CH4 = molecule("CH4")
# visualization of t... |
regata/dbda2e_py | chapters/2.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
faces = np.arange(1,5)
faces
"""
Explanation: Introduction: Credibility, Models, and Parameters
Exercise 2.1
Exercise 2.2
Additional Exercise 1
Exercise 2.1
Purpose: To get you actively manipulating mathematical models of... |
authman/DAT210x | Module4/Module4 - Lab4.ipynb | mit | import math, random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import scipy.io
from mpl_toolkits.mplot3d import Axes3D
# Look pretty...
# matplotlib.style.use('ggplot')
# plt.style.use('ggplot')
"""
Explanation: DAT210x - Programming with Python for DS
Module4- Lab4
End... |
root-mirror/training | SummerStudentCourse/2019/Exercises/WorkingWithFiles/WritingOnFilesExercise.ipynb | gpl-2.0 | import ROOT
"""
Explanation: Writing on files
This is a Python notebook in which you will practice the concepts learned during the lectures.
Startup ROOT
Import the ROOT module: this will activate the integration layer with the notebook automatically
End of explanation
"""
rndm = ROOT.TRandom3(1)
filename = "histos... |
dereneaton/ipyrad | newdocs/API-analysis/cookbook-digest_genomes.ipynb | gpl-3.0 | # conda install ipyrad -c bioconda
import ipyrad.analysis as ipa
"""
Explanation: <span style="color:gray">ipyrad-analysis toolkit: </span> digest genomes
The purpose of this tool is to digest a genome file in silico using the same restriction enzymes that were used for an empirical data set to attempt to extract hom... |
keras-team/keras-io | examples/vision/ipynb/reptile.ipynb | apache-2.0 | import matplotlib.pyplot as plt
import numpy as np
import random
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import tensorflow_datasets as tfds
"""
Explanation: Few-Shot learning with Reptile
Author: ADMoreau<br>
Date created: 2020/05/21<br>
Last modified: 2020/05/30<br>
D... |
ioos/system-test | content/downloads/notebooks/2015-10-12-fetching_data.ipynb | unlicense | from datetime import datetime, timedelta
event_date = datetime(2015, 8, 15)
start = event_date - timedelta(days=4)
stop = event_date + timedelta(days=4)
"""
Explanation: This notebook shows a typical workflow to query a Catalog Service for the Web (CSW) and creates a request for data endpoints that are suitable for... |
kimegitee/deep-learning | image-classification/dlnd_image_classification.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
import problem_unittests as tests
import tarfile
cifar10_dataset_folder_path = 'cifar-10-batches-py'
class DLProgress(tqdm):
last_block = 0
def hoo... |
mcamack/Jupyter-Notebooks | tensorflow/tensorflow-Regression-Regularization.ipynb | apache-2.0 | %matplotlib inline
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
learning_rate = 0.01 # Hyperparameters
training_epochs = 100
x_train = np.linspace(-1, 1, 101) # Dataset
y_train = 2 * x_train + np.random.randn(*x_train.shape) * 0.33
X = ... |
FireCARES/data | analysis/validated-boundaries-vs-government-unit-density.ipynb | mit | import psycopg2
from psycopg2.extras import RealDictCursor
import pandas as pd
# import geopandas as gpd
# from shapely import wkb
# from shapely.geometry import mapping as to_geojson
# import folium
pd.options.display.max_columns = None
pd.options.display.max_rows = None
#pd.set_option('display.float_format', lambda ... |
domino14/macondo | notebooks/win_pct/calculate_win_percentages.ipynb | gpl-3.0 | max_spread = 300
counter_dict_by_spread_and_tiles_remaining = {x:{
spread:0 for spread in range(max_spread,-max_spread-1,-1)} for x in range(0,94)}
win_counter_dict_by_spread_and_tiles_remaining = deepcopy(counter_dict_by_spread_and_tiles_remaining)
t0=time.time()
print('There are {} games'.format(len(win_dict)))
... |
CELMA-project/CELMA | MES/singleOperators/properZFailConvergence.ipynb | lgpl-3.0 | %matplotlib notebook
from IPython.display import display
from sympy import init_printing
from sympy import S, Eq, Limit
from sympy import sin, cos, tanh, pi
from sympy import symbols
from boutdata.mms import x, z
init_printing()
"""
Explanation: Why the proper Z function fails to show convergence
We will here inv... |
dxl0632/deeplearning_nd_udacity | intro-to-rnns/Anna_KaRNNa_Exercises.ipynb | mit | import time
from collections import namedtuple
import numpy as np
import tensorflow as tf
"""
Explanation: Anna KaRNNa
In this notebook, we'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book.
This network is bas... |
tpin3694/tpin3694.github.io | machine-learning/nested_cross_validation.ipynb | mit | # Load required packages
from sklearn import datasets
from sklearn.model_selection import GridSearchCV, cross_val_score
from sklearn.preprocessing import StandardScaler
import numpy as np
from sklearn.svm import SVC
"""
Explanation: Title: Nested Cross Validation
Slug: nested_cross_validation
Summary: Nested Cross Val... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_artifacts_detection.ipynb | bsd-3-clause | import numpy as np
import mne
from mne.datasets import sample
from mne.preprocessing import create_ecg_epochs, create_eog_epochs
# getting some data ready
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(raw_fname, preload=True)
"""
Explanation: In... |
gcgruen/homework | foundations-homework/05/.ipynb_checkpoints/homework-05-gruen-spotify-checkpoint.ipynb | mit | import requests
lil_response = requests.get ('https://api.spotify.com/v1/search?query=Lil&type=artist&country=US&limit=50')
lil_data = lil_response.json()
print(type(lil_data))
lil_data.keys()
lil_data['artists'].keys()
lil_artists = lil_data['artists']['items']
#check on what elements are in that list:
#print (lil_... |
kmsmoo/Webnovel | Recommand System.ipynb | mit | episode_comment = pd.read_csv("data/webnovel/episode_comments.csv", index_col=0, encoding="cp949")
episode_comment["ID"] = episode_comment["object_id"].apply(lambda x: x.split("-")[0])
episode_comment["volume"] = episode_comment["object_id"].apply(lambda x: x.split("-")[1]).astype("int")
episode_comment["writer_nickna... |
fonnesbeck/HealthPolicyPython | Introduction to Python.ipynb | cc0-1.0 | import numpy
"""
Explanation: Introduction to Python
(via xkcd)
What is Python?
Python is a modern, open source, object-oriented programming language, created by a Dutch programmer, Guido van Rossum. Officially, it is an interpreted scripting language (meaning that it is not compiled until it is run) for the C progra... |
statsmodels/statsmodels.github.io | v0.12.2/examples/notebooks/generated/interactions_anova.ipynb | bsd-3-clause | %matplotlib inline
from urllib.request import urlopen
import numpy as np
np.set_printoptions(precision=4, suppress=True)
import pandas as pd
pd.set_option("display.width", 100)
import matplotlib.pyplot as plt
from statsmodels.formula.api import ols
from statsmodels.graphics.api import interaction_plot, abline_plot
fr... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/solutions/4b_keras_dnn_babyweight.ipynb | apache-2.0 | import datetime
import os
import shutil
import matplotlib.pyplot as plt
import tensorflow as tf
print(tf.__version__)
"""
Explanation: LAB 4b: Create Keras DNN model.
Learning Objectives
Set CSV Columns, label column, and column defaults
Make dataset of features and label from CSV files
Create input layers for raw... |
thempel/adaptivemd | examples/rp/test_worker.ipynb | lgpl-2.1 | import sys, os, time
"""
Explanation: AdaptiveMD
Example 1 - Setup
0. Imports
End of explanation
"""
# verbose = os.environ.get('RADICAL_PILOT_VERBOSE', 'REPORT')
os.environ['RADICAL_PILOT_VERBOSE'] = 'ERROR'
"""
Explanation: We want to stop RP from reporting all sorts of stuff for this example so we set a specific... |
WNoxchi/Kaukasos | pytorch/PyTorch60MinBlitz.ipynb | mit | import torch
"""
Explanation: PyTorch 60 Minute Blitz
Wnixalo
2018/2/18
I. What is PyTorch
It's a Python based scientific computing package targeted at two sets of audiences:
A replacement for NumPy to use the power of GPUs
A Deep Learning research platform that provides maximum flexibility and speed.
1. Getting St... |
SSQ/Coursera-UW-Machine-Learning-Classification | Week 6 PA 1/module-9-precision-recall-assignment-blank.ipynb | mit | import graphlab
from __future__ import division
import numpy as np
graphlab.canvas.set_target('ipynb')
"""
Explanation: Exploring precision and recall
The goal of this second notebook is to understand precision-recall in the context of classifiers.
Use Amazon review data in its entirety.
Train a logistic regression m... |
LEX2016WoKaGru/pyClamster | examples/example_notebook.ipynb | gpl-3.0 | %matplotlib inline
import os
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import logging
import pyclamster
import pickle
import scipy
import scipy.misc
from skimage.feature import match_template
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logging.debug("test")
"""
Explanation:... |
cyucheng/skimr | jupyter/2b_Fix_FullText_Cleanup.ipynb | bsd-3-clause | import os, time, re, pickle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from datetime import timedelta, date
import urllib
import html5lib
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup, SoupStrainer
"""
Explanation: Fix FullText... |
phoebe-project/phoebe2-docs | 2.1/tutorials/spots.ipynb | gpl-3.0 | !pip install -I "phoebe>=2.1,<2.2"
"""
Explanation: Binary with Spots
Setup
IMPORTANT NOTE: if using spots on contact systems or single stars, make sure to use 2.1.15 or later as the 2.1.15 release fixed a bug affecting spots in these systems.
Let's first make sure we have the latest version of PHOEBE 2.1 installed. (... |
BibMartin/folium | examples/CRS comparison.ipynb | mit | import json
import sys
sys.path.insert(0,'..')
import folium
print (folium.__file__)
print (folium.__version__)
"""
Explanation: Illustration of CRS effect
Leaflet is able to handle several CRS (coordinate reference systems). It means that depending on the data you have, you may need to use the one or the other.
Don't... |
QCaudron/Python-Workshop | 1.BasicPython.ipynb | mit | print("He said, 'what ?'")
"""
Explanation: Introductory Python
Quentin CAUDRON <br /> <br /> Ecology and Evolutionary Biology <br /> <br /> qcaudron@princeton.edu <br /> <br /> @QuentinCAUDRON
This section moves quickly. I'm assuming that everyone speaks at least one programming language well, and / or has introd... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/cmip6/models/inm-cm5-0/seaice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'inm', 'inm-cm5-0', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: INM
Source ID: INM-CM5-0
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
AllenDowney/ThinkBayes2 | examples/lions_soln.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 numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# import classes from thinkbayes... |
adam2392/paremap | paremap_nih_rotation/notebooks/exploratory analysis_old/Robust Spectrotemporal Decomposition.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import scipy as sp
%matplotlib inline
"""
Explanation: Robust Spectrotemporal Decomposition by Iteratively Reweighted Least Squares
Contributed by: Armen Gharibans
Reference: Ba, D., Babadi, B., Purdon, P. L., & Brown, E. N. (2014). Robu... |
oroszl/szamprob | notebooks/Package10/mintapelda10.ipynb | gpl-3.0 | # a szokásos rutinok betöltése
%pylab inline
from scipy.integrate import * # az integráló rutinok betöltése
"""
Explanation: Még több scipy ...
Az alábbi notebookban megismerkedünk két témával, melyek annak ellenére, hogy magukban is fontos jelentőséggel bírnak, kulcsfontosságú szerepet töltenek be más problémák numer... |
indranilsinharoy/PyZDDE | Examples/IPNotebooks/03 Generation of Speckle using Zemax Grid Sag Surface.ipynb | mit | from __future__ import division, print_function
import os as os
import collections as co
import numpy as np
import math as math
import scipy.stats as sps
import scipy.optimize as opt
import matplotlib.pyplot as plt
from IPython.display import Image as ipImage
import pyzdde.zdde as pyz
import pyzdde.zfileutils as zfu
# ... |
roebius/deeplearning_keras2 | nbs2/taxi_data_prep_and_mlp.ipynb | apache-2.0 | data_path = "data/taxi/"
"""
Explanation: Below path is a shared directory, swap to own
End of explanation
"""
meta = pd.read_csv(data_path+'metaData_taxistandsID_name_GPSlocation.csv', header=0)
meta.head()
train = pd.read_csv(data_path+'train/train.csv', header=0)
train.head()
train['ORIGIN_CALL'] = pd.Series(... |
quiltdata/quilt | docs/walkthrough/editing-a-package.ipynb | apache-2.0 | import quilt3
p = quilt3.Package()
"""
Explanation: Data in Quilt is organized in terms of data packages. A data package is a logical group of files, directories, and metadata.
Initializing a package
To edit a new empty package, use the package constructor:
End of explanation
"""
quilt3.Package.install(
"example... |
cdawei/digbeta | dchen/tour/cv_protocol.ipynb | gpl-3.0 | % matplotlib inline
import os, sys, time
import math, random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from joblib import Parallel, delayed
"""
Explanation: Trajectory Recommendation - Test Evaluation Protocol
End of explanation
"""
%run 'ssvm.ipynb'
check_proto... |
scikit-optimize/scikit-optimize.github.io | dev/notebooks/auto_examples/sampler/sampling_comparison.ipynb | bsd-3-clause | print(__doc__)
import numpy as np
np.random.seed(123)
import matplotlib.pyplot as plt
"""
Explanation: Comparing initial point generation methods
Holger Nahrstaedt 2020
.. currentmodule:: skopt
Bayesian optimization or sequential model-based optimization uses a surrogate
model to model the expensive to evaluate functi... |
tarashor/vibrations | py/notebooks/draft/All geometries.ipynb | mit | from sympy import *
from sympy.vector import CoordSys3D
N = CoordSys3D('N')
x1, x2, x3 = symbols("x_1 x_2 x_3")
alpha1, alpha2, alpha3 = symbols("alpha_1 alpha_2 alpha_3")
R, L, ga, gv = symbols("R L g_a g_v")
init_printing()
"""
Explanation: Shells
Init symbols for sympy
End of explanation
"""
a1 = pi / 2 + (L / 2 ... |
cdawei/digbeta | dchen/music/MLC_baseline.ipynb | gpl-3.0 | %matplotlib inline
%load_ext autoreload
%autoreload 2
import os, sys, time
import pickle as pkl
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
from sklearn.pipeline import make_pipelin... |
catalystcomputing/DSIoT-Python-sessions | Session201811/code/11 Supervised Machine Learning - scikit learn.ipynb | apache-2.0 | import numpy as np
import matplotlib as mp
from sklearn import datasets
from sklearn import metrics
from sklearn.linear_model import LogisticRegression
# Load the sample data set from the datasets module
dataset = datasets.load_iris()
# Display the data in the test dataset
dataset
# Species of Iris in the dataset
da... |
tensorflow/docs-l10n | site/en-snapshot/tensorboard/tensorboard_in_notebooks.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... |
kraemerd17/kraemerd17.github.io | courses/python/material/ipynbs/Acquiring and wrangling with data.ipynb | mit | from __future__ import division
from numpy.random import randn
import numpy as np
import os
import matplotlib.pyplot as plt
np.random.seed(12345)
plt.rc('figure', figsize=(10, 6))
from pandas import Series, DataFrame
import pandas as pd
np.set_printoptions(precision=4)
"""
Explanation: In previous sessions, we've talk... |
danielhanchen/sciblox | sciblox (v1)/sciblox v0.01.ipynb | mit | from sciblox import *
%matplotlib inline
maxrows(5)
from jupyterthemes import jtplot
jtplot.style()
x = read("train.csv")
read("train.csv")
"""
Explanation: SciBlox v0.01 Example Code - Titanic Dataset
1. Data Analysis
Opening files - currently CSV is only supported
Use the import * method for easier calling. (So... |
AnimeshShaw/MyJupyterNotebooks | notebooks/natural-language-processing/A Gentle Introduction to TextBlob.ipynb | lgpl-3.0 | # We import the most important class TextBlob
from textblob import TextBlob
"""
Explanation: A Gentle Introduction to TextBlob
TextBlob is a Python (2 and 3) library for processing textual data. It provides a consistent API for diving into common natural language processing (NLP) tasks such as part-of-speech tagging,... |
NAU-CFL/Python_Learning_Source | reference_notebooks/Notes-01.ipynb | mit | type("Hello World!")
type(2)
"""
Explanation: Variables, Expressions and Statements
Values and Types
A value is one of the basic things a program works with, like a letter or a number.
"Hello World", and 2 are values with different types:
We can check their types using type() function in Python.
End of explanation
""... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/06_structured/3_keras_dnn.ipynb | apache-2.0 | # Ensure the right version of Tensorflow is installed.
!pip freeze | grep tensorflow==2.1
# change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-east1' #'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.environ['PROJECT'] = PROJECT
os.environ['R... |
rvperry/phys202-2015-work | assignments/assignment12/FittingModelsEx01.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as opt
"""
Explanation: Fitting Models Exercise 1
Imports
End of explanation
"""
a_true = 0.5
b_true = 2.0
c_true = -4.0
"""
Explanation: Fitting a quadratic curve
For this problem we are going to work with the following mod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.