repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
ecell/ecell4-notebooks | docs/tutorials/tutorial04.ipynb | gpl-2.0 | from ecell4_base.core import *
"""
Explanation: 4. How to Run a Simulation
In sections 2 and 3, we explained the way to build a model and to setup the intial state. Now, it is the time to run a simulation. Corresponding to World classes, six Simulator classes are there: spatiocyte.SpatiocyteSimulator, egfrd.EGFRDSimul... |
zauonlok/cs231n | assignment2/FullyConnectedNets.ipynb | mit | # As usual, a bit of setup
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.solver import Solver
%matplotlib inline
... |
jorisvandenbossche/2015-EuroScipy-pandas-tutorial | solved - 04b - Advanced groupby operations.ipynb | bsd-2-clause | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
try:
import seaborn
except ImportError:
pass
pd.options.display.max_rows = 10
"""
Explanation: Groupby operations
Some imports:
End of explanation
"""
df = pd.DataFrame({'key':['A','B','C','A','B','C','A','B','C'],
... |
catalyst-cooperative/pudl | devtools/eia-etl-debug.ipynb | mit | %load_ext autoreload
%autoreload 2
import pudl
import logging
import sys
from pathlib import Path
import pandas as pd
pd.options.display.max_columns = None
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(stream=sys.stdout)
formatter = logging.Formatter('%(message)s')
handler.... |
predictscan3/scan3 | analysis_nbs/Normalise Hormones by Gestational Age.ipynb | mit | from os.path import join
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data_fname = r"../data_staging/all_by_baby_enriched_v3.csv"
df = pd.read_csv(data_fname)
"""
Explanation: Explore the data first
End of explanation
"""
all = pd.concat([df.t1_ga_weeks, df.t2_ga_weeks, df.t3_ga_weeks])
al... |
mdpiper/topoflow-notebooks | EvapEnergyBalance-Meteorology-SnowDegreeDay.ipynb | mit | from cmt.components import EvapEnergyBalance, Meteorology, SnowDegreeDay
evp, met, sno = EvapEnergyBalance(), Meteorology(), SnowDegreeDay()
"""
Explanation: EvapEnergyBalance-Meteorology-SnowDegreeDay coupling
Goal: Try to successfully run a coupled EvapEnergyBalance-Meteorology-SnowDegreeDay simulation, with EvapEne... |
ES-DOC/esdoc-jupyterhub | notebooks/test-institute-3/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', 'test-institute-3', 'sandbox-3', 'atmoschem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Atmoschem
MIP Era: CMIP6
Institute: TEST-INSTITUTE-3
Source ID: SANDBOX-3
Topic: Atmoschem
Sub-Topic... |
phoebe-project/phoebe2-docs | 2.3/examples/extinction_eclipse_depth_v_teff.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Extinction: Eclipse Depth Difference as Function of Temperature
In this example, we'll reproduce Figure 3 in the extinction release paper (Jones et al. 2020).
NOTE: this script takes a long time to run.
<img src="jones+20_fig3.png" alt="Figure 3" width="800px"/>
Set... |
crcresearch/GOS | examples/multiscale-migration/GOS+Multiscale+Migration+Model.ipynb | apache-2.0 | import os
import sys
import subprocess
working_directory = os.path.abspath('')
sys.path.append(os.path.normpath(os.path.join(working_directory, "..", "..")))
# These libraries are used later to supply mathematical calculations.
import numpy as np
import pandas as pd
from math import e
from haversine import haversine
i... |
dataDogma/Computer-Science | Courses/DAT-208x/DAT208x - Week 3 - Section 1 - Functions.ipynb | gpl-3.0 | # use python help() on max()
help(max)
# use help() on round()
help(round)
# example on max
height = [ 4.5, 5.2, 6.7, 4.8, 5.6 ]
print("The tallest one is : " + str( max( height ) ) + " feets" )
# exmple on round
some_number = 5.63
# round() with two arguments, "number" and "decimal place significance"
print("The ... |
AtmaMani/pyChakras | udemy_ml_bootcamp/Machine Learning Sections/Logistic-Regression/Logistic Regression Project - Solutions.ipynb | mit | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
"""
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Logistic Regression Project - Solutions
In this project we will be working with a fake advertising data set,... |
ceos-seo/Data_Cube_v2 | agdc-v2/contrib/notebooks/zonal-stats-example.ipynb | apache-2.0 | dc = datacube.api.API()
"""
Explanation: Query the datacube
End of explanation
"""
vfname = '/g/data2/v10/public/water-example/sample-water-bodies.shp'
src = fiona.open(vfname, 'r')
xidx = (src.bounds[0], src.bounds[2])
yidx = (src.bounds[-1], src.bounds[1])
gdf = geopandas.read_file(vfname)
gdf.plot()
"""
Explanat... |
jamesjia94/BIDMach | tutorials/NVIDIA/BIDMach_basic_classification.ipynb | bsd-3-clause | import BIDMat.{CMat,CSMat,DMat,Dict,IDict,FMat,FND,GDMat,GMat,GIMat,GSDMat,GSMat,HMat,Image,IMat,Mat,SMat,SBMat,SDMat}
import BIDMat.MatFunctions._
import BIDMat.SciFunctions._
import BIDMat.Solvers._
import BIDMat.JPlotting._
import BIDMach.Learner
import BIDMach.models.{FM,GLM,KMeans,KMeansw,ICA,LDA,LDAgibbs,NMF,Rand... |
davidsanfal/iPython-Notebook | intro_to_py3/Python3.ipynb | mit | print("hello world")
"""
Explanation: <p style="text-align: center; font-size: 200%"><a href="http://davidsanfal.github.io/">David Sánchez Falero</a></p>
<p style="text-align: center; font-size: 200%">david.sanchez.falero@gmail.com</p>
<p style="text-align: center; font-size: 200%">@David_SanFal</p>
Introducción a ... |
jonathanmorgan/msu_phd_work | methods/reliability/prelim_month-reliability.ipynb | lgpl-3.0 | import datetime
import six
print( "packages imported at " + str( datetime.datetime.now() ) )
"""
Explanation: prelim_month - reliability
original title: 2017.10.25 - work log - prelim_month - Reliability_Names reliability
original file name: 2017.10.25-work_log-prelim_month-Reliability_Names_reliability.ipynb
Run t... |
sgrindy/Bayesian-estimation-of-relaxation-spectra | Double_Maxwell_Uniform_prior.ipynb | mit | def H(tau):
g1 = 1; tau1 = 0.03; sd1 = 0.5;
g2 = 7; tau2 = 10; sd2 = 0.5;
term1 = g1/np.sqrt(2*sd1**2*np.pi) * np.exp(-(np.log10(tau/tau1)**2)/(2*sd1**2))
term2 = g2/np.sqrt(2*sd2**2*np.pi) * np.exp(-(np.log10(tau/tau2)**2)/(2*sd2**2))
return term1 + term2
Nfreq = 50
Nmodes = 30
w = np.logspace(-4,... |
hvillanua/deep-learning | tensorboard/Anna_KaRNNa_Summaries.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... |
tensorflow/docs-l10n | site/ko/tutorials/structured_data/imbalanced_data.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
mediagit2016/workcamp-maschinelles-lernen-grundlagen | 17-12-11-workcamp-ml/2017-12-11-arbeiten-mit-listen-10.ipynb | gpl-3.0 | x = [4,2,6,3] #Erzeugt eine Liste mit Werten
x1 = [4,2,6,3] #Erzeugt eine Liste mit den gleichen Werten
y = list() # Erzeugt eine leere Liste
y = [] #Erzeugt eine leere Liste
z = ["11","22","33","a","b","c","d"] #erzeugt eine Liste mit strg Werten
print(x)
print(id(x))
print(x1)
print(id(x1))
print(y)
print(id(y))
prin... |
net-titech/CREST-Deep-M | notebooks/00-classification.ipynb | mit | # set up Python environment: numpy for numerical routines, and matplotlib for plotting
import numpy as np
import matplotlib.pyplot as plt
# display plots in this notebook
%matplotlib inline
# set display defaults
plt.rcParams['figure.figsize'] = (10, 10) # large images
plt.rcParams['image.interpolation'] = 'nea... |
xaratustrah/iq_suite | doc/quick_introduction_iqtools.ipynb | gpl-2.0 | # In your new notebook, first import the library, this automaticall imports IQBase as well
from iqtools import *
%matplotlib inline
"""
Explanation: Quick introduction to iqtools
General information
iqtools is a collection consisting of a library, command line tools. The best way to use the library is inside a jupyter... |
liganega/Gongsu-DataSci | previous/notes2017/W04/GongSu09_Dictionary.ipynb | gpl-3.0 | record_f = open("Sample_Data/Swim_Records/record_list.txt")
record = record_f.read().decode('utf-8').split('\n')
record_f.close()
for line in record:
print(line)
"""
Explanation: 사전 활용
주요 내용
파이썬에 내장되어 있는 컬렉션 자료형 중 사전에 대해 알아 본다.
사전(dictionaries): 키(keys)와 값(values)으로 이루어진 쌍(pairs)들의 집합
사용 형태: 집합기호 사용
eng_math = ... |
jlaura/camera_model | python/notebooks/Image2Ground Testing.ipynb | unlicense | # 512, 512 are the focal width/height in pixels divided by 2
def create_intrinsic_matrix(focal_length, image_width, sensor_width=14.4, skew=0, pixel_aspect=1):
focal_pixels = (focal_length / sensor_width) * image_width # From the IK - how do we get 14.4 automatically
print( 'These should be equal.', focal_pixe... |
sympy/scipy-2017-codegen-tutorial | notebooks/_35-chemical-kinetics-lambdify-deserialize.ipynb | bsd-3-clause | reactions = [
('k1', {'A': 1}, {'B': 1, 'A': -1}),
('k2', {'B': 1, 'C': 1}, {'A': 1, 'B': -1}),
('k3', {'B': 2}, {'B': -1, 'C': 1})
]
names, params = 'A B C'.split(), 'k1 k2 k3'.split()
tex_names = ['[%s]' % n for n in names]
"""
Explanation: Generating symbolic expressions
For larger reaction systems it i... |
bryanfry/nyc-schools | nyc-schools_C.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
import os
bp_data = '/Users/bryanfry/projects/proj_nyc-schools/data_files'
n_tracts = 10 # Average ACS variable from 20 closest tracts to each school.
"""
Explanation: nyc-schools_C
This script averages the ACS variables for the N census tracts closest to each school, and combi... |
ESGF/esgf-pyclient | notebooks/examples/search.ipynb | bsd-3-clause | from pyesgf.search import SearchConnection
conn = SearchConnection('http://esgf-index1.ceda.ac.uk/esg-search',
distrib=True)
"""
Explanation: Examples of pyesgf.search usage
Prelude:
End of explanation
"""
facets='project,experiment_family'
"""
Explanation: Warning: don't use default search... |
ES-DOC/esdoc-jupyterhub | notebooks/cmcc/cmip6/models/cmcc-esm2-hr5/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cmcc', 'cmcc-esm2-hr5', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: CMCC
Source ID: CMCC-ESM2-HR5
Topic: Ocnbgchem
Sub-Topics: Tracers.
Pro... |
mne-tools/mne-tools.github.io | 0.24/_downloads/299b3deaa8eb66e88d34f06090d06628/evoked_ers_source_power.ipynb | bsd-3-clause | # Authors: Luke Bloy <luke.bloy@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
import mne
from mne.cov import compute_covariance
from mne.datasets import somato
from mne.time_frequency import csd_morlet
from mne.beamformer import (make_dic... |
jimregan/tesseract-gle-uncial | Update_gle_uncial_traineddata_for_Tesseract_4.ipynb | apache-2.0 | !wget https://github.com/jimregan/tesseract-gle-uncial/releases/download/v0.1beta2/gle_uncial.traineddata
"""
Explanation: <a href="https://colab.research.google.com/github/jimregan/tesseract-gle-uncial/blob/master/Update_gle_uncial_traineddata_for_Tesseract_4.ipynb" target="_parent"><img src="https://colab.research.g... |
DallasTrinkle/Onsager | examples/GF-RBC.ipynb | mit | import sys
sys.path.extend(['.','./Vacancy'])
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
%matplotlib inline
import scipy.sparse
import itertools
from numba import jit, njit, prange, guvectorize # faster runtime with update routines
from scipy.misc import comb
# from sympy imp... |
Leguark/pynoddy | docs/notebooks/.ipynb_checkpoints/2-Adjust-input-checkpoint.ipynb | gpl-2.0 | from IPython.core.display import HTML
css_file = 'pynoddy.css'
HTML(open(css_file, "r").read())
cd ../docs/notebooks/
%matplotlib inline
import sys, os
import matplotlib.pyplot as plt
import numpy as np
# adjust some settings for matplotlib
from matplotlib import rcParams
# print rcParams
rcParams['font.size'] = 15
... |
transcranial/keras-js | notebooks/layers/embeddings/Embedding.ipynb | mit | input_dim = 5
output_dim = 3
input_length = 7
data_in_shape = (input_length,)
emb = Embedding(input_dim, output_dim, input_length=input_length, mask_zero=False)
layer_0 = Input(shape=data_in_shape)
layer_1 = emb(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set weights to random (use seed for reproducibil... |
quantumlib/Cirq | docs/protocols.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... |
scotthuang1989/Python-3-Module-of-the-Week | algorithm/functools.ipynb | apache-2.0 | import functools
def myfunc(a, b=2):
"Docstring for myfunc()."
print(' called myfunc with:', (a, b))
def show_details(name, f, is_partial=False):
"Show details of a callable object."
print('{}:'.format(name))
print(' object:', f)
if not is_partial:
print(' __name__:', f.__name__)
... |
CopernicusMarineInsitu/INSTACTraining | PythonNotebooks/indexFileNavigation/index_file_download.ipynb | mit | user = '' #type CMEMS user name
password = '' #type CMEMS password
product_name = 'INSITU_BAL_NRT_OBSERVATIONS_013_032' #type aimed CMEMS in situ product
distribution_unit = 'cmems.smhi.se' #type aimed hosting institution
"""
Explanation: <h3> ABSTRACT </h3>
All CMEMS in situ data products can be found and downloade... |
intel-analytics/BigDL | apps/image-augmentation/image-augmentation.ipynb | apache-2.0 | from bigdl.dllib.nncontext import init_nncontext
from bigdl.dllib.feature.image import *
import cv2
import numpy as np
from IPython.display import Image, display
sc = init_nncontext("Image Augmentation Example")
"""
Explanation: Image Augmentation
Image Augmentation augments datasets (especially small datasets) to tra... |
UChicagoPhysics/SampleExercises | exercises/electricityAndMagnetism/Electric Field of a Moving Charge.ipynb | gpl-2.0 | import numpy as np
import matplotlib.pylab as plt
#Import 3-dimensional plotting package.
from mpl_toolkits.mplot3d import axes3d
"""
Explanation: Electric Field of a Moving Charge
PROGRAM: Electric field of a moving charge
CREATED: 5/30/2018
In this problem, I plot the electric field of a moving charge for differen... |
joshnsolomon/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... |
JackDi/phys202-2015-work | assignments/assignment03/NumpyEx03.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import antipackage
import github.ellisonbg.misc.vizarray as va
"""
Explanation: Numpy Exercise 3
Imports
End of explanation
"""
def brownian(maxt, n):
"""Return one realization of a Brownian (Wiener) process with n steps... |
datapolitan/lede_algorithms | class5_2/kmeans.ipynb | gpl-2.0 | !curl -O http://www.cs.cornell.edu/home/llee/data/convote/convote_v1.1.tar.gz
!tar -zxvf convote_v1.1.tar.gz
paths = glob.glob("convote_v1.1/data_stage_one/development_set/*")
speeches = []
for path in paths:
speech = {}
filename = path[-26:]
speech['filename'] = filename
speech['bill_no'] = filename[... |
phoebe-project/phoebe2-docs | 2.3/examples/contact_spots.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.3,<2.4"
"""
Explanation: Contact Binary with Spots
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
"""
import phoebe
from phoebe import u # units
logger = phoeb... |
mdeff/ntds_2016 | toolkit/02_sol_exploitation.ipynb | mit | import pandas as pd
import numpy as np
from IPython.display import display
import os.path
folder = os.path.join('..', 'data', 'social_media')
fb = pd.read_sql('facebook', 'sqlite:///' + os.path.join(folder, 'facebook.sqlite'), index_col='index')
tw = pd.read_sql('twitter', 'sqlite:///' + os.path.join(folder, 'twitter... |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_decoding_unsupervised_spatial_filter.ipynb | bsd-3-clause | # Authors: Jean-Remi King <jeanremi.king@gmail.com>
# Asish Panda <asishrocks95@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample
from mne.decoding import UnsupervisedSpatialFilter
from sklearn.decomposition import PCA, FastI... |
ozorich/phys202-2015-work | assignments/assignment05/MatplotlibEx03.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
"""
Explanation: Matplotlib Exercise 3
Imports
End of explanation
"""
def well2d(x, y, nx, ny, L=1.0):
"""Compute the 2d quantum well wave function."""
scalarfield=(2/L*np.sin(nx*np.pi*x/L)*np.sin(ny*np.pi*y/L))
well=scalarfield
re... |
RTHMaK/RPGOne | scipy-2017-sklearn-master/notebooks/11 Text Feature Extraction.ipynb | apache-2.0 | X = ["Some say the world will end in fire,",
"Some say in ice."]
len(X)
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer()
vectorizer.fit(X)
vectorizer.vocabulary_
X_bag_of_words = vectorizer.transform(X)
X_bag_of_words.shape
X_bag_of_words
X_bag_of_words.toarray()
... |
mne-tools/mne-tools.github.io | 0.20/_downloads/4a39dd4a31cad8a0e098b02526b9c3d3/plot_covariance_whitening_dspm.ipynb | bsd-3-clause | # Author: Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import spm_face
from mne.minimum_norm import apply_inverse, make_inverse_operator
from mne.cov import compute_covariance
print(__doc__)... |
RyanAlberts/Springbaord-Capstone-Project | Statistics_Exercises/Mini_Project_Naive_Bayes.ipynb | mit | %matplotlib inline
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from six.moves import range
# Setup Pandas
pd.set_option('display.width', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('... |
kscottz/PythonFromSpace | OpenStreetMapsExample.ipynb | bsd-3-clause | # See requirements.txt to set up your dev environment.
import os
import sys
import utm
import json
import scipy
import overpy
import urllib
import datetime
import urllib3
import rasterio
import subprocess
import numpy as np
import pandas as pd
import seaborn as sns
from osgeo import gdal
from planet import api
from pl... |
Bedrock-py/bedrock-core | examples/RAND2011study/RewireAnalysis.ipynb | lgpl-3.0 | from bedrock.client.client import BedrockAPI
import requests
import pandas
import pprint
SERVER = "http://localhost:81/"
api = BedrockAPI(SERVER)
"""
Explanation: Rand 2011 Cooperation Study
This notebook outlines how to recreate the analysis of the Rand et al. 2011 study "Dynamic social networks promote cooperation i... |
tensorflow/docs-l10n | site/ko/hub/tutorials/image_feature_vector.ipynb | apache-2.0 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
cathalmccabe/PYNQ | boards/Pynq-Z1/base/notebooks/pmod/pmod_grove_tmp.ipynb | bsd-3-clause | from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
"""
Explanation: Grove Temperature Sensor 1.2
This example shows how to use the Grove Temperature Sensor v1.2. You will also see how to plot a graph using matplotlib. The Grove Temperature sensor produces an analog signal, and requires an ADC.
... |
texib/deeplearning_homework | Keras_LSTM2.ipynb | mit | sql = """
SELECT
date,count(distinct cookie_pta) as uv
from
TABLE_DATE_RANGE(pixinsight.article_visitor_log_1_100_, TIMESTAMP('2017-01-01'), CURRENT_TIMESTAMP())
where venue = 'pixnet'
group by date
order by date
"""
from os import environ
# load and plot dataset
import pandas as pd
from pandas import read_csv
from p... |
QuantScientist/Deep-Learning-Boot-Camp | day03/Advanced_Keras_Tutorial/5.0 Custom Layers.ipynb | mit | from keras.models import Sequential
from keras.layers import Dense, Dropout, Layer, Activation
from keras.datasets import mnist
from keras import backend as K
from keras.utils import np_utils
"""
Explanation: Custom Keras Layer
Idea:
We build a custom activation layer called Antirectifier,
which modifies the shape of ... |
molgor/spystats | notebooks/.ipynb_checkpoints/Analysis of spatial models using systematic and random samples-checkpoint.ipynb | bsd-2-clause | new_data = prepareDataFrame("/RawDataCSV/idiv_share/plotsClimateData_11092017.csv")
## En Hec
#new_data = prepareDataFrame("/home/hpc/28/escamill/csv_data/idiv/plotsClimateData_11092017.csv")
"""
Explanation: new_data['residuals1'] = results.resid
End of explanation
"""
def systSelection(dataframe,k):
n = len(da... |
dereneaton/ipyrad | tests/cookbook-structure-pedicularis.ipynb | gpl-3.0 | ## conda install ipyrad -c ipyrad
## conda install structure -c ipyrad
## conda install clumpp -c ipyrad
## conda install toytree -c eaton-lab
"""
Explanation: Cookbook: Parallelized STRUCTURE analyses on unlinked SNPs
As part of the ipyrad.analysis toolkit we've created convenience functions for easily distributing S... |
kazukiotsuka/mongobase | tutorial/MongoBase_starting_guide.ipynb | mit | %load_ext autoreload
%autoreload 2
%matplotlib inline
import sys
import time
import threading
import multiprocessing
import datetime as dt
from mongobase.mongobase import MongoBase, db_context
from bson import ObjectId
"""
Explanation: MongoBase starting guide
End of explanation
"""
x = ObjectId()
time.sleep(1)
y = ... |
pligor/predicting-future-product-prices | 02_preprocessing/exploration08-price_history_gaussian_process_regressor_memory_errors.ipynb | agpl-3.0 | from __future__ import division
import numpy as np
import pandas as pd
import sys
import math
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
import re
import os
import csv
from helpers.outliers import MyOutliers
from skroutz_mobile import SkroutzMobile
from sklearn.ensemble import IsolationForest
import ... |
NYUDataBootcamp/Materials | Code/notebooks/bootcamp_adv_scraping.ipynb | mit | import pandas as pd # data package
import matplotlib.pyplot as plt # graphics
import datetime as dt # date tools, used to note current date
%matplotlib inline
"""
Explanation: Web scraping
Date: 28 March 2017
@author: Daniel Csaba
Preliminaries
Import usual packages.
End of explanation
"""
... |
statkraft/shyft-doc | notebooks/api/api-intro.ipynb | lgpl-3.0 | %pylab inline
import os
import sys
import datetime as dt
import numpy as np
from matplotlib import pyplot as plt
from netCDF4 import Dataset
# try to auto-configure the path. This will work in the case
# that you have checked out the doc and data repositories
# at same level. Make sure this is done **before** importin... |
AllenDowney/ThinkStats2 | examples/central_limit_theorem.ipynb | gpl-3.0 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def decorate(**options):
"""Decorate the current axes.
Call decorate with keyword arguments like
decorate(title='Title',
xlabel='x',
ylabel='y')
The keyword arguments can be any of the ax... |
tclaudioe/Scientific-Computing | SC1/03_floating_point_arithmetic.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: <center>
<h1> INF-285 - Computación Científica / ILI-285 - Computación Científica I</h1>
<h2> Floating Point Arithmetic </h2>
<h2> <a href="#acknowledgements"> [S]cientific [C]omputing [T]eam </a> </h2>
<h2> Version:... |
gfeiden/Notebook | Projects/ngc2516_spots/.ipynb_checkpoints/bolometric_corrections-checkpoint.ipynb | mit | # change directory
%cd ../../../Projects/starspot/starspot/
from color import bolcor as bc
"""
Explanation: Bolometric Corrections
Details about the bolometric correction package can be found in the GitHub repository starspot.
End of explanation
"""
bc.utils.log_init('table_limits.log') # initialize bolometric cor... |
kitefu/Testing | data_statistic.ipynb | mit | data_rang = 9
pr_type = ['a', 'b', 'c', 'd']
p_type = [ np.random.choice(pr_type) for i in range(data_rang) ]
data = {'product_name' : ['x0', 'x1', 'x3', 'x2', 'x4', 'x5', 'x6', 'x7', 'x8'],
'T1': np.random.randint(100, size = [data_rang]),
'T2': np.random.randint(100, size = [data_rang]),
'T3': np... |
WMD-group/MacroDensity | tutorials/Slab/SlabCalculation.ipynb | mit | %matplotlib inline
import sys
import macrodensity as md
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
"""
Explanation: Ionisation potential of a bulk material
In this example we use MacroDensity with VASP to align the energy levels of a simple bulk material.
The proc... |
BinRoot/TensorFlow-Book | ch06_hmm/Concept02_hmm.ipynb | mit | import numpy as np
import tensorflow as tf
"""
Explanation: Ch 06: Concept 02
Viterbi parse of a Hidden Markov model
Import TensorFlow and Numpy
End of explanation
"""
# initial parameters can be learned on training data
# theory reference https://web.stanford.edu/~jurafsky/slp3/8.pdf
# code reference https://phvu.n... |
mne-tools/mne-tools.github.io | stable/_downloads/b99fcf919e5d2f612fcfee22adcfc330/40_autogenerate_metadata.ipynb | bsd-3-clause | from pathlib import Path
import matplotlib.pyplot as plt
import mne
data_dir = Path(mne.datasets.erp_core.data_path())
infile = data_dir / 'ERP-CORE_Subject-001_Task-Flankers_eeg.fif'
raw = mne.io.read_raw(infile, preload=True)
raw.filter(l_freq=0.1, h_freq=40)
raw.plot(start=60)
# extract events
all_events, all_ev... |
jaduimstra/nilmtk | docs/manual/user_guide/disaggregation_and_metrics.ipynb | apache-2.0 | import time
from matplotlib import rcParams
import matplotlib.pyplot as plt
%matplotlib inline
rcParams['figure.figsize'] = (13, 6)
plt.style.use('ggplot')
from nilmtk import DataSet, TimeFrame, MeterGroup, HDFDataStore
from nilmtk.disaggregate import CombinatorialOptimisation
"""
Explanation: Disaggregation and Metr... |
pablosv/dynamic_multifarious | analysis.ipynb | gpl-3.0 | # General libraries
import os
import pickle
import numpy as np
# Plot, in nb, only when .show() is called
import matplotlib.pyplot as plt
%matplotlib notebook
plt.ioff()
# Personal libraries
import tools.evaluation as ev
import tools.plot as pt
"""
Explanation: Script that analyzes the results from multifarious ass... |
gchrupala/reimaginet | notes.ipynb | mit | %pylab inline
from ggplot import *
import pandas as pd
data = pd.DataFrame(
dict(epoch=range(1,11)+range(1,11)+range(1,11)+range(1,8)+range(1,11)+range(1,11),
model=hstack([repeat("char-3-grow", 10),
repeat("char-1", 10),
repeat("char-3", 10),
... |
kubeflow/pipelines | components/gcp/ml_engine/batch_predict/sample.ipynb | apache-2.0 | %%capture --no-stderr
!pip3 install kfp --upgrade
"""
Explanation: Name
Batch prediction using Cloud Machine Learning Engine
Label
Cloud Storage, Cloud ML Engine, Kubeflow, Pipeline, Component
Summary
A Kubeflow Pipeline component to submit a batch prediction job against a deployed model on Cloud ML Engine.
Details
I... |
setiQuest/ML4SETI | tutorials/Removing_noise_from_a_spectrogram.ipynb | apache-2.0 | import requests
import ibmseti
import os
import zipfile
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Create team folder (please replace my_team_name_data_folder with your team name)
mydatafolder = os.environ['PWD'] + '/' + 'my_team_name_data_folder'
if os.path.exists(mydatafolder) is False:
... |
paultheastronomer/OAD-Data-Science-Toolkit | Teaching Materials/Machine Learning/ml-quickstart/tutorial.ipynb | gpl-3.0 | from __future__ import division, print_function
from sklearn.datasets import make_circles
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_curve, roc_auc_score
from sklearn.svm... |
slowvak/MachineLearningForMedicalImages | notebooks/Module 3.ipynb | mit | %matplotlib inline
import warnings
warnings.filterwarnings('ignore')
import os
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
import pandas as pd
from matplotlib.colors import ListedColormap
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.model_selection import GridSe... |
ssamot/ce888 | labs/lab3/facebook_classification.ipynb | gpl-3.0 | df = pd.read_csv("./dataset_Facebook.csv", delimiter = ";")
features = ["Category",
"Page total likes",
"Type",
"Post Month",
"Post Hour",
"Post Weekday",
"Paid"]
df[features].head()
outcomes= ["Lifetime Post Total Reach",
"Lifetim... |
bhermanmit/openmc | docs/source/examples/mdgxs-part-ii.ipynb | mit | import math
import pickle
from IPython.display import Image
import matplotlib.pyplot as plt
import numpy as np
import openmc
import openmc.mgxs
%matplotlib inline
"""
Explanation: This IPython Notebook illustrates the use of the openmc.mgxs.Library class. The Library class is designed to automate the calculation of... |
xpharry/Udacity-DLFoudation | tutorials/sentiment_network/.ipynb_checkpoints/Sentiment Classification - How to Best Frame a Problem for a Neural Network (Project 4)-checkpoint.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
franzpl/StableGrid | jupyter_notebooks/computation_schmitt_trigger.ipynb | mit | from IPython.display import Image
Image(filename='circuit.png')
# %matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from IPython.display import HTML, display
# For tables
def tableit(data):
display(HTML(
'<table><tr>{}</tr></table>'.format(
... |
seg/2016-ml-contest | Facies_classification.ipynb | apache-2.0 | %matplotlib inline
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from pandas import set_option
set_option("display.max_rows", 10)
pd.options.mode.chained_assignment = None
filen... |
dtamayo/reboundx | ipython_examples/YarkovskyEffect.ipynb | gpl-3.0 | import rebound
import reboundx
import numpy as np
import astropy.units as u
import astropy.constants as constants
import matplotlib.pyplot as plt
%matplotlib inline
#Simulation begins here
sim = rebound.Simulation()
sim.units = ('yr', 'AU', 'Msun') #changes simulation and G to units of solar masses, years, and AU
s... |
AssembleSoftware/IoTPy | examples/ExamplesOfMulticore.ipynb | bsd-3-clause | import sys
import time
import threading
sys.path.append("../")
from IoTPy.core.stream import Stream, StreamArray, run
from IoTPy.agent_types.op import map_element, map_list, map_window
from IoTPy.helper_functions.recent_values import recent_values
from IoTPy.helper_functions.print_stream import print_stream
from IoTP... |
KronosKoderS/sie552 | venus_example.ipynb | mit | class PlanetaryObject():
"""
A simple class used to store pertinant information about the plantary object
"""
def __init__(self, date, L, e, SMA, i, peri, asc, r, v, anom, fp, mu):
self.date = date # Event Date
self.L = L # Longitude
self.e = e # Eccentricity
... |
ES-DOC/esdoc-jupyterhub | notebooks/ncc/cmip6/models/noresm2-mh/landice.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'ncc', 'noresm2-mh', 'landice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Landice
MIP Era: CMIP6
Institute: NCC
Source ID: NORESM2-MH
Topic: Landice
Sub-Topics: Glaciers, Ice.
Properties:... |
amueller/scipy-2017-sklearn | notebooks/08.Unsupervised_Learning-Clustering.ipynb | cc0-1.0 | from sklearn.datasets import make_blobs
X, y = make_blobs(random_state=42)
X.shape
plt.scatter(X[:, 0], X[:, 1]);
"""
Explanation: Unsupervised Learning Part 2 -- Clustering
Clustering is the task of gathering samples into groups of similar
samples according to some predefined similarity or distance (dissimilarity)
... |
sdpython/ensae_teaching_cs | _doc/notebooks/td1a_algo/td1a_sobel.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 1A.algo - filtre de Sobel
Le filtre de Sobel est utilisé pour calculer des gradients dans une image. L'image ainsi filtrée révèle les forts contrastes.
End of explanation
"""
from pyquickhelper.loghelper import noLOG
from pyensae.dataso... |
vinitsamel/udacitydeeplearning | embeddings/Skip-Grams-Solution.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
msanterre/deep_learning | embeddings/Skip-Gram_word2vec.ipynb | mit | import time
import numpy as np
import tensorflow as tf
import utils
"""
Explanation: Skip-gram word2vec
In this notebook, I'll lead you through using TensorFlow to implement the word2vec algorithm using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language p... |
sheikhomar/ml | tensor-flow-basics.ipynb | mit | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
tf.__version__
"""
Explanation: TensorFlow Basics
End of explanation
"""
h = tf.constant('Hello World')
h
h.graph is tf.get_default_graph()
x = tf.constant(100)
x
# Create Session object in which we can run operatio... |
bourneli/deep-learning-notes | DAT236x Deep Learning Explained/Lab5_RecurrentNetwork.ipynb | mit | from matplotlib import pyplot as plt
import math
import numpy as np
import os
import pandas as pd
import random
import time
import cntk as C
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
%matplotlib inline
# to make things reproduceable, seed random
np.random... |
tensorflow/docs-l10n | site/ko/guide/ragged_tensor.ipynb | apache-2.0 | #@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
saturn77/CythonBootstrap | CythonBootstrap.ipynb | gpl-2.0 | %%file ./src/helloCython.pyx
import cython
import sys
def message():
print(" Hello World ....\n")
print(" Hello Central Ohio Python User Group ...\n")
print(" The 614 > 650::True")
print(" Another line ")
print(" The Python version is %s" % sys.version)
print(" The Cython version is %s" % cyt... |
mkcor/advanced-pandas | notebooks/05_sql.ipynb | cc0-1.0 | import pandas as pd
"""
Explanation: SQL-type operations
If you know something about relational databases and SQL, you may have heard of JOIN and GROUP BY.
End of explanation
"""
mlo, gl = pd.read_csv('../data/co2-mm-mlo.csv', na_values=-99.99, index_col='Date', parse_dates=True), \
pd.read_csv('../data/co2-mm-g... |
ES-DOC/esdoc-jupyterhub | notebooks/mri/cmip6/models/mri-esm2-0/land.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'mri', 'mri-esm2-0', 'land')
"""
Explanation: ES-DOC CMIP6 Model Properties - Land
MIP Era: CMIP6
Institute: MRI
Source ID: MRI-ESM2-0
Topic: Land
Sub-Topics: Soil, Snow, Vegetation, Energy Balan... |
dsacademybr/PythonFundamentos | Cap04/Notebooks/DSA-Python-Cap04-10-Enumerate.ipynb | gpl-3.0 | # Versão da Linguagem Python
from platform import python_version
print('Versão da Linguagem Python Usada Neste Jupyter Notebook:', python_version())
"""
Explanation: <font color='blue'>Data Science Academy - Python Fundamentos - Capítulo 4</font>
Download: http://github.com/dsacademybr
End of explanation
"""
# Crian... |
jmhsi/justin_tinker | data_science/courses/temp/courses/dl1/lesson1_dessert_classifier.ipynb | apache-2.0 | # Put these at the top of every notebook, to get automatic reloading and inline plotting
%reload_ext autoreload
%autoreload 2
%matplotlib inline
"""
Explanation: Image classification with Convolutional Neural Networks
Welcome to the first week of the second deep learning certificate! We're going to use convolutional n... |
alekz112/Test | Interview+questions.ipynb | mit | def this_and_prev(iterable):
iterator = iter(iterable)
prev_item = None
curr_item = next(iterator)
for next_item in iterator:
yield (prev_item, curr_item)
prev_item = curr_item
curr_item = next_item
yield (prev_item, curr_item)
for i,j in this_and_prev( range(5) ): print i,j... |
tensorflow/docs-l10n | site/zh-cn/guide/upgrade.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... |
xpharry/Udacity-DLFoudation | tutorials/sentiment_network/Sentiment Classification - Project 1 Solution.ipynb | mit | def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
g = open('reviews.txt','r') # What we know!
reviews = list(map(lambda x:x[:-1],g.readlines()))
g.close()
g = open('labels.txt','r') # What we WANT to know!
labels = list(map(lambda x:x[:-1].upper(),g.readlines()))
g.close()... |
simulkade/peteng | python/test averaging methods.ipynb | mit | from fipy import Grid2D, CellVariable, FaceVariable
import numpy as np
def upwindValues(mesh, field, velocity):
"""Calculate the upwind face values for a field variable
Note that the mesh.faceNormals point from `id1` to `id2` so if velocity is in the same
direction as the `faceNormal`s then we take the v... |
tpin3694/tpin3694.github.io | regex/match_exact_text.ipynb | mit | # Load regex package
import re
"""
Explanation: Title: Match Exact Text
Slug: match_exact_text
Summary: Match Exact Text
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
... |
colour-science/colour-hdri | colour_hdri/examples/examples_merge_from_raw_files.ipynb | bsd-3-clause | import logging
import matplotlib.pyplot as plt
import numpy as np
import os
import colour
from colour_hdri import (
EXAMPLES_RESOURCES_DIRECTORY,
Image,
ImageStack,
camera_space_to_sRGB,
convert_dng_files_to_intermediate_files,
convert_raw_files_to_dng_files,
filter_files,
read_exif_ta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.