repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
TeamLab/Gachon_CS50_OR_KMOOC | assignment/ps0/nb_arithmetic_functions.ipynb | mit | import gachon_autograder_client as g_autograder
EMAIL = "#YOUR_EMAIL"
PASSWORD = "#YOUR_PASSWORD"
ASSIGNMENT_NAME = "nb_test"
g_autograder.get_assignment(EMAIL, PASSWORD, ASSIGNMENT_NAME)
"""
Explanation: Lab #0 - jupyter notebook autograder test
Copyright 2016 © document created by TeamLab.Gachon@gmail.com
Introduc... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/introduction_to_tensorflow/solutions/custom_layers_and_models.ipynb | apache-2.0 | # Import necessary libraries
import tensorflow as tf
from tensorflow import keras
"""
Explanation: Making New Layers and Models via Subclassing
Learning Objectives
Use Layer class as the combination of state (weights) and computation.
Defer weight creation until the shape of the inputs is known.
Build recursively com... |
infilect/ml-course1 | keras-notebooks/advanced/8.4-generating-images-with-vaes.ipynb | mit | # Encode the input into a mean and variance parameter
z_mean, z_log_variance = encoder(input_img)
# Draw a latent point using a small random epsilon
z = z_mean + exp(z_log_variance) * epsilon
# Then decode z back to an image
reconstructed_img = decoder(z)
# Instantiate a model
model = Model(input_img, reconstructed_... |
Boialex/MIPT-ML | hw7/captioning.ipynb | gpl-3.0 | %%time
# Read Dataset
import numpy as np
import pickle
img_codes = np.load("data/image_codes.npy")
captions = pickle.load(open('data/caption_tokens.pcl', 'rb'))
print "each image code is a 1000-unit vector:", img_codes.shape
print img_codes[0,:10]
print '\n\n'
print "for each image there are 5-7 descriptions, e.g.:\n... |
jskDr/keraspp | old/8-1_10 CNN1D-GAN for Prob.ipynb | mit | %matplotlib inline
%load_ext autoreload
%autoreload 2
from importlib import reload
import numpy as np
import matplotlib.pyplot as plt
from keras import models, layers, optimizers
from keras.layers import Dense, Input, Conv1D, Reshape, Flatten
from keras.models import Model
from keras.optimizers import Adam
"""
Expla... |
folivetti/PIPYTHON | ListaEX_02.ipynb | mit |
print (Triangulo(5,5,5)) # equilatero
print (Triangulo(5,5,7)) # isóceles
print (Triangulo(3,4,5)) # escaleno
print (Triangulo(5,5,11)) # não é triângulo
"""
Explanation: Exercício 1: Crie três funções:
1) Uma função chamada VerificaTriangulo() que recebe como parâmetro o comprimento dos três lados de um ... |
aasensio/elecciones2015 | Sondeos Elecciones 2015.ipynb | mit | book = xlrd.open_workbook("sondeos.xlsx")
sh = book.sheet_by_index(0)
PP = []
PSOE = []
IU = []
UPyD = []
Podemos = []
Ciudadanos = []
fecha = []
mesEsp = ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic']
mesEng = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct'... |
CELMA-project/CELMA | derivations/boundaries/ghostPointExtrapolation/4thOrderDirichletGhostPointPolynomial.ipynb | lgpl-3.0 | from IPython.display import display
from dividedDifferences import get_coeff, get_polynomial
from sympy import init_printing
from sympy import symbols, simplify
from sympy import Eq, S, Function
init_printing()
# The values in the points we use for the extrapolation
f0, f1, f2, f3 = symbols('f_0, f_1, f_2, f_3', real... |
mohsinhaider/pythonbootcampacm | Built-In Functions/map().ipynb | mit | # Function to apply
def days(hour):
return hour/24
# Sequence to transform
hour_list = [4.0, 24.0, 47, 72.0]
# Map
days_list = list(map(days, hour_list))
print(days_list)
"""
Explanation: Map
The map function applies a supplied function to the elements in a sequence. The syntax is as follows:
map(functi... |
jmankoff/data | Assignments/jmankoff-explore/explore.ipynb | gpl-3.0 | # Import libraries.
import csv
import httplib2
from apiclient.discovery import build
import urllib
import json
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Byte 2 Google Data Labs Notebook
This is an example notebook that illustr... |
yashdeeph709/Algorithms | PythonBootCamp/Complete-Python-Bootcamp-master/.ipynb_checkpoints/Milestone Project 1- Complete Walkthrough Solution-checkpoint.ipynb | apache-2.0 | # For using the same code in either Python 2 or 3
from __future__ import print_function
## Note: Python 2 users, use raw_input() to get player input. Python 3 users, use input()
"""
Explanation: Milestone Project 1: Full Walkthrough Code Solution
Below is the filled in code that goes along with the complete walkthro... |
mbway/Bayesian-Optimisation | demos/2D-Demo-1.ipynb | gpl-3.0 | %load_ext autoreload
%autoreload 2
%matplotlib inline
#%config InlineBackend.figure_format = 'svg'
import matplotlib.pyplot as plt
import seaborn as sns; sns.set() # prettify matplotlib
import numpy as np
import sklearn.gaussian_process as gp
# local modules
import turbo as tb
import turbo.modules as tm
import turbo... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a/td2a_cenonce_session_2E.ipynb | mit | from jyquickhelper import add_notebook_menu
add_notebook_menu()
"""
Explanation: 2A.i - Sérialisation
Charger un dataframe depuis un fichier texte prend du temps car il faut convertir le texte en nombre. La sérialisation permet de copier le contenu depuis la mémoire vers le disque. A la prochaine utilisation, Python a... |
GoogleCloudPlatform/mlops-on-gcp | immersion/kubeflow_pipelines/pipelines/solutions/lab-02_vertex.ipynb | apache-2.0 | from google.cloud import aiplatform
REGION = 'us-central1'
PROJECT_ID = !(gcloud config get-value project)
PROJECT_ID = PROJECT_ID[0]
# Set `PATH` to include the directory containing KFP CLI
PATH=%env PATH
%env PATH=/home/jupyter/.local/bin:{PATH}
"""
Explanation: Continuous Training with Kubeflow Pipeline and Verte... |
khalido/nd101 | nd101_wk1.ipynb | gpl-3.0 | #read data
df = pd.read_fwf('linear_regression_demo/brain_body.txt')
x_values = df[['Brain']]
y_values = df[['Body']]
#train model on data
body_reg = linear_model.LinearRegression()
body_reg.fit(x_values, y_values)
#visualize results
plt.scatter(x_values, y_values)
plt.plot(x_values, body_reg.predict(x_values))
plt.s... |
matthijsvk/multimodalSR | code/Experiments/Tutorials/EbenOlsen_TheanoLasagne/1 - Theano Basics/Exercises.ipynb | mit | # %load ./spoilers/logistic.py
x = T.vector()
s = 1/(1+T.exp(-x))
ds = T.grad(T.sum(s), x) # Need sum to make s scalar
import matplotlib.pyplot as plt
%matplotlib inline
x0 = np.arange(-3, 3, 0.01).astype('float32')
plt.plot(x0, s.eval({x:x0}))
plt.plot(x0, ds.eval({x:x0}))
np.allclose(ds.eval({x:x0}), s.eval({x:x0}... |
ceos-seo/data_cube_notebooks | notebooks/land_change/SAR/ALOS_Land_Change.ipynb | apache-2.0 | import sys
import os
sys.path.append(os.environ.get('NOTEBOOK_ROOT'))
import datacube
import numpy as np
import pandas as pd
import xarray as xr
import matplotlib.pyplot as plt
from datacube.utils.aws import configure_s3_access
configure_s3_access(requester_pays=True)
dc = datacube.Datacube()
"""
Explanation: <a id... |
gojomo/gensim | docs/src/auto_examples/tutorials/run_lda.ipynb | lgpl-2.1 | import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
"""
Explanation: LDA Model
Introduces Gensim's LDA model and demonstrates its use on the NIPS corpus.
End of explanation
"""
import io
import os.path
import re
import tarfile
import smart_open
def extract_doc... |
mne-tools/mne-tools.github.io | 0.15/_downloads/plot_roi_erpimage_by_rt.ipynb | bsd-3-clause | # Authors: Jona Sassenhagen <jona.sassenhagen@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.datasets import testing
from mne import Epochs, io, pick_types
from mne.event import define_target_events
print(__doc__)
"""
Explanation: ===========================================================
Plot single tr... |
molgor/spystats | notebooks/Sandboxes/model_fitting_spatialautocorr_using_GLS.ipynb | bsd-2-clause | # Load Biospytial modules and etc.
%matplotlib inline
import sys
sys.path.append('/apps')
import django
django.setup()
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
## Use the ggplot style
plt.style.use('ggplot')
## check the matern
import scipy.special as special
#def MaternVariogram(h,range_a... |
mtasende/Machine-Learning-Nanodegree-Capstone | notebooks/prod/.ipynb_checkpoints/n08_simple_q_learner_100_epochs-checkpoint.ipynb | mit | # Basic imports
import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import scipy.optimize as spo
import sys
from time import time
from sklearn.metrics import r2_score, median_absolute_error
from multiprocessing import Pool
%matplotlib inline
%pylab inline
pylab.rcPar... |
borja876/Thinkful-DataScience-Borja | TalkingData User Demographcs Final Capstone.ipynb | mit | #Uplaod the data into the notbook and select the rows that will be used after previous visual inspection of the datasets
datadir = 'D:/Users/Borja.gonzalez/Desktop/Thinkful-DataScience-Borja'
gatrain = pd.read_csv('gender_age_train.csv',usecols=['device_id','gender','age','group'] )
gatest = pd.read_csv('gender_age_tes... |
dinrker/Algorithms_DataStructures | 03_BinaryTree_DivideConquer.ipynb | mit | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def preorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/02_tensorflow/f_ai_platform.ipynb | apache-2.0 | # Uncomment and run if you need to update your Google SDK
# !sudo apt-get update && sudo apt-get --only-upgrade install google-cloud-sdk
"""
Explanation: Introducing AI Platform Training Service
Learning Objectives:
- Learn how to make code compatible with AI Platform Training Service
- Train your model using clou... |
pysg/pyther | Modelo de impregnacion/modelo1/Activité 4 (1) repetido.ipynb | mit | import numpy as np
import pandas as pd
import math
import cmath
from scipy.optimize import root
import matplotlib.pyplot as plt
%matplotlib inline
"""
Explanation: Modélisation du modèle
Sommaire
1 - Introduction
2 - Polymère
3 - Calcul de la concentration
4 - Table des valeurs
5 - Calcul de c2
6 - Graphiques
Intro... |
metpy/MetPy | v0.12/_downloads/5e50ab42ac6ec7bf58df35e403f36520/Angle_to_Direction.ipynb | bsd-3-clause | import metpy.calc as mpcalc
from metpy.units import units
"""
Explanation: Angle to Direction
Demonstrate how to convert angles to direction strings.
The code below shows how to convert angles into directional text.
It also demonstrates the function's flexibility.
End of explanation
"""
angle_deg = 70 * units('degr... |
jgomezc1/medios | NOTEBOOKS/PROBLEMA_4_16.ipynb | mit | import numpy as np
from sympy import *
from IPython.display import Image,Latex
"""
Explanation: Problema 4.16
End of explanation
"""
Image(filename='FIGURES/Sorigen.png',width=500)
Image(filename='FIGURES/fig2_NB5.png',width=600)
"""
Explanation: En la figura $1$ se muestra las soluciones para una masa de suelo s... |
jorisvandenbossche/DS-python-data-analysis | _solved/case4_air_quality_analysis.ipynb | bsd-3-clause | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
"""
Explanation: <p><font size="6"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>
© 2021, Joris Van den Bossche and Stijn Van Hoey (jorisvandenbo... |
csc-training/python-introduction | notebooks/answers/5 - Modules.ipynb | mit | import sys
sys.path.append('../exercises')
import sample_module
sample_module.sample_function()
"""
Explanation: Modules
import
Let's start by using a module.
There is a module called sample_module in the same directory as this notebook. Inside it there is a function called sample_function.
Import the function and ca... |
mrcslws/nupic.research | projects/archive/dynamic_sparse/notebooks/ExperimentAnalysis-GSCSparser-SparseLinearOnly.ipynb | agpl-3.0 | %load_ext autoreload
%autoreload 2
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 *
from nupic.research.frameworks.dynamic... |
oditorium/blog | iPython/Directory-TreeWalking.ipynb | agpl-3.0 | import os
def dir_structure (path=None, decorated=False):
""" read out the full recursive directory structure of `path` and return it as a tuple
path - the path where to start the walk (default: `.`)
decorated - if True, the actual directory is returned as well as the index
RETURNS
(d... |
luofan18/deep-learning | dcgan-svhn/DCGAN.ipynb | mit | %matplotlib inline
import pickle as pkl
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
import tensorflow as tf
!mkdir data
"""
Explanation: Deep Convolutional GANs
In this notebook, you'll build a GAN using convolutional layers in the generator and discriminator. This is called a De... |
ramseylab/networkscompbio | class26_bayesnet_python3_template.ipynb | apache-2.0 | import pandas
g_discret_data = pandas.read_csv("shared/sachs_data_discretized.txt",
sep="\t")
g_discret_data.head(n=6)
"""
Explanation: Class 26: Bayesian Networks
Infer a Bayesian network from a matrix of discretized phospho-flow cytometry data.
Based on supplementary data from the 2... |
ES-DOC/esdoc-jupyterhub | notebooks/inm/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', 'inm', 'sandbox-3', 'seaice')
"""
Explanation: ES-DOC CMIP6 Model Properties - Seaice
MIP Era: CMIP6
Institute: INM
Source ID: SANDBOX-3
Topic: Seaice
Sub-Topics: Dynamics, Thermodynamics, Radiat... |
jonathf/chaospy | docs/user_guide/quick_tutorial.ipynb | mit | import numpy
import chaospy
"""
Explanation: Quick tutorial
chaospy is created to work well inside numerical Python ecosystem through numpy.
It is therefore often necessary to import and use numpy along side chaospy when working on problems the latter is meant to solve:
End of explanation
"""
coordinates = numpy.lin... |
sajalsubodh22/PySyft | notebooks/Syft - Paillier Homomorphic Encryption Example.ipynb | apache-2.0 | from syft.he.paillier import KeyPair, PaillierTensor
from syft import TensorBase
import numpy as np
"""
Explanation: Paillier Homomorphic Encryption Example
DISCLAIMER: This is a proof-of-concept implementation. It does not represent a remotely product ready implementation or follow proper conventions for security, co... |
stijnvanhoey/phd_ipynb_respiro_showcases | thesis_decubber/parallel_fitting_respiropeaks.ipynb | bsd-2-clause | from __future__ import division
from IPython.parallel import Client
c = Client()
c.ids
"""
Explanation: Op voorhand heb ik 10 cores gevraagd en met volgende commando haal ik de cores op:
End of explanation
"""
%%px --local
# Execute on all cores but also for serial calculations
i... |
4dsolutions/Python5 | HARVESTING_DATA_PYT_DS_SAISOFT.ipynb | mit | import pandas as pd
import numpy as np
"""
Created on Thu Jun 29 10:17:02 2017
Rewritten for get_data package on Oct 25, 2017
@author: Kirby Urner
Decorated generator used IN PLACE OF:
class Url:
def __init__(self, the_url):
self.url = the_url
def __enter__(self):
self.rq =... |
JustinNoel1/ML-Course | exercise-sessions/Session-12/Session-12.ipynb | apache-2.0 | import numpy as np
import pandas as pd
import keras
from keras.datasets import mnist
"""
Explanation: Problem Set 12
First the exercises:
* Let $\mu=\frac{1}{|S|}\sum_{x_i\in S} x_i$ let us expand
\begin{align}
\sum_{x_i\in S} ||x_i-\mu||^2 &=\sum_{x_i\in S}(x_i-\mu)^T(x_i-\mu)\
&= |S|\mu^T\mu+\sum_{x_i\in S}\lef... |
planet-os/notebooks | api-examples/El_Nino_animations.ipynb | mit | import os
from dh_py_access import package_api
import dh_py_access.lib.datahub as datahub
import xarray as xr
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
import imageio
import shutil
import datetime
import matplotlib as mpl
mpl.rcParams['font.family'] = 'Avenir Lt Std'
mp... |
tjwei/HackNTU_Data_2017 | Week05/spynner 8comic.ipynb | mit | import spynner
import os, sys
from IPython.display import display, Image
# 用 spynner 打開瀏覽器
browser = spynner.Browser(debug_level=spynner.ERROR, debug_stream=sys.stderr)
browser.show() # 告訴 browser,要它之後不要隱身
# 在 ?????? 填入適當網址
base_url = 'http://v.??????.com/online/comic-7340.html?ch='
book_no = 54
browser.load( base_... |
wangyarui/deep-learning | rnn/RNNLM.ipynb | unlicense | import csv
import itertools
import operator
import numpy as np
import nltk
import sys
from datetime import datetime
from utils import *
import matplotlib.pyplot as plt
%matplotlib inline
# Download NLTK model data (you need to do this once)
nltk.download("book")
"""
Explanation: Recurrent Neural Networks Tutorial, P... |
JamesSample/icpw | toc_report_feb_2019_part1.ipynb | mit | ## Switch TOC/DOC pre-March 1995 to method with correction factor of 1.28
#with eng.begin() as conn:
# sql = ("UPDATE resa2.water_chemistry_values2 "
# "SET method_id = 10823 "
# "WHERE sample_id IN ( "
# " SELECT water_sample_id "
# " FROM resa2.water_samples "
# ... |
tuanavu/coursera-university-of-washington | machine_learning/4_clustering_and_retrieval/assigment/week4/4_em-with-text-data_graphlab.ipynb | mit | import graphlab
'''Check GraphLab Create version'''
from distutils.version import StrictVersion
assert (StrictVersion(graphlab.version) >= StrictVersion('1.8.5')), 'GraphLab Create must be version 1.8.5 or later.'
"""
Explanation: Fitting a diagonal covariance Gaussian mixture model to text data
In a previous assignm... |
nholtz/structural-analysis | Devel/Old/frame2d-v03/example-frame-1.ipynb | cc0-1.0 | from __future__ import division, print_function
from IPython import display
import salib.nbloader # so that we can directly import other notebooks
import Frame2D_v03 as f2d
"""
Explanation: Matrix Methods Example - Frame 1
This is the same frame as solved using the method of slope-deflection
here. All of the data... |
userzimmermann/python-modeled | README.ipynb | gpl-3.0 | import modeled
print(modeled.__version__)
print(modeled.__description__)
"""
Explanation: python-modeled
End of explanation
"""
modeled.__requires__
"""
Explanation: Create classes
with typed data members in pythonic style.
Use typed containers.
Map modeled classes and their instances
to any kind of data stor... |
iurilarosa/thesis | codici/Archiviati/Plots/.ipynb_checkpoints/plot funzioni-checkpoint.ipynb | gpl-3.0 | t = numpy.linspace(1,24,100000)
ampiezza = 1e-19
sd = 1e-9
freqIniz = 1
ondaNS = ampiezza*(sd/(freqIniz-sd*t))**(1/2)*numpy.cos(2*(freqIniz-sd*t)*t)
%matplotlib notebook
pylab.plot(t,ondaNS)
pylab.show()
ampPerTempo = ampiezza*(sd/(freqIniz-sd*t))**(1/2)
%matplotlib notebook
pylab.plot(t,ampPerTempo)
pylab.show()
"... |
astroumd/GradMap | notebooks/Lectures2020/Lecture3/Lecture3_Instructor.ipynb | gpl-3.0 | import numpy as np
"""
Explanation: Review from the previous lecture
In yesterday's Lecture 2, you learned how to use the numpy module, how to make your own functions, and how to import and export data. Below is a quick review before we move on to Lecture 3.
Remember, to use the numpy module, first it must be imported... |
elektrobohemian/courses | EvaluationMachineLearning.ipynb | mit | # The %... is an iPython thing, and is not part of the Python language.
# In this case we're just telling the plotting library to draw things on
# the notebook, instead of on a separate window.
%matplotlib inline
# the import statements load differnt Python packages that we need for the tutorial
# See all the "as ..." ... |
Aniruddha-Tapas/Applied-Machine-Learning | Miscellaneous/Lenses Data Classification.ipynb | mit | import os
from sklearn.tree import DecisionTreeClassifier, export_graphviz
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn import cross_validation, metrics
from sklearn.ensemble import RandomForestClassifier
from sklearn.naive_bayes import BernoulliNB
from sklea... |
michaelgat/Udacity_DL | language-translation/dlnd_language_translation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
import problem_unittests as tests
source_path = 'data/small_vocab_en'
target_path = 'data/small_vocab_fr'
source_text = helper.load_data(source_path)
target_text = helper.load_data(target_path)
"""
Explanation: Language Translation
In this project, you’re going... |
koverholt/notebooks | dask/create-cluster.ipynb | bsd-3-clause | import coiled
cluster = coiled.Cluster(n_workers=10)
"""
Explanation: Create a Dask cluster using Coiled
First, we'll create a Dask cluster with Coiled:
End of explanation
"""
from dask.distributed import Client
client = Client(cluster)
print('Dashboard:', client.dashboard_link)
"""
Explanation: Let's point the dis... |
scottprahl/miepython | docs/04_rayleigh.ipynb | mit | #!pip install --user miepython
import numpy as np
import matplotlib.pyplot as plt
try:
import miepython
except ModuleNotFoundError:
print('miepython not installed. To install, uncomment and run the cell above.')
print('Once installation is successful, rerun this cell again.')
"""
Explanation: Rayleigh S... |
mit-crpg/openmc | examples/jupyter/pincell.ipynb | mit | %matplotlib inline
import openmc
"""
Explanation: Modeling a Pin-Cell
This notebook is intended to demonstrate the basic features of the Python API for constructing input files and running OpenMC. In it, we will show how to create a basic reflective pin-cell model that is equivalent to modeling an infinite array of fu... |
mne-tools/mne-tools.github.io | dev/_downloads/bcaf3ed1f43ea7377c6c0b00137d728f/custom_inverse_solver.ipynb | bsd-3-clause | import numpy as np
from scipy import linalg
import mne
from mne.datasets import sample
from mne.viz import plot_sparse_source_estimates
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
fwd_fname = meg_path / 'sample_audvis-meg-eeg-oct-6-fwd.fif'
ave_fname = meg_path / 'sample_audvis-ave.fif'
cov... |
pinga-lab/paper-tesseroids | notebooks/results-figures.ipynb | bsd-3-clause | %matplotlib inline
from __future__ import division
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('svg')
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams['axes.labelsize'] = 9.0 # fontsize of the x any y labels
plt.rcParams['xtick.labelsize'] = 9.0 ... |
AstroHuntsman/POCS | examples/notebooks/Example Collecting Stats.ipynb | mit | positions_fn = 'accel-positions.csv'
# Show top of file
!head -n 3 $positions_fn
# For each row, create a SkyCoord
coords = list()
with open(positions_fn, 'r') as csv_file:
reader = DictReader(csv_file)
for row in reader:
coords.append(SkyCoord(**row)) # The ** passes the keys of the dict as params
... |
statsmodels/statsmodels.github.io | v0.13.1/examples/notebooks/generated/statespace_structural_harvey_jaeger.ipynb | bsd-3-clause | %matplotlib inline
import numpy as np
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
from IPython.display import display, Latex
"""
Explanation: Detrending, Stylized Facts and the Business Cycle
In an influential article, Harvey and Jaeger (1993) described the use of unobserved comp... |
ctroupin/OceanData_NoteBooks | PythonNotebooks/PlatformPlots/Read_drifter_data_2.ipynb | gpl-3.0 | year = 2015
month = 7
%matplotlib inline
import glob
import os
import netCDF4
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from matplotlib import colors
"""
Explanation: This notebook uses what was shown in the previous one.<br/>
The goal is represent all the temperatur... |
zoofIO/flexx-notebooks | EuroScipy 2015 demo.ipynb | bsd-3-clause | from flexx.webruntime import launch
rt = launch('http://flexx.rtfd.org', 'xul', title='Test title')
"""
Explanation: This is the demo that I used during the EuroScipy 2015 talk on Flexx.
flexx.webruntime
Launch a web runtime. Can be a browser or something that looks like a desktop app.
End of explanation
"""
from fl... |
kyleabeauchamp/mdtraj | examples/hbonds.ipynb | lgpl-2.1 | t = md.load_pdb('http://www.rcsb.org/pdb/files/2EQQ.pdb')
print(t)
"""
Explanation: Load up some example data. This is a little 28 residue peptide
End of explanation
"""
hbonds = md.baker_hubbard(t, periodic=False)
label = lambda hbond : '%s -- %s' % (t.topology.atom(hbond[0]), t.topology.atom(hbond[2]))
for hbond i... |
IanHawke/ET-NumericalMethods-2016 | notebooks/03-hyperbolic-pdes.ipynb | mit | import numpy
from matplotlib import pyplot
%matplotlib notebook
"""
Explanation: Hyperbolic PDEs
Most formulations of the Einstein equations for the spacetime (with $c=1$) look roughly like wave equations
$$
\frac{\partial^2 \phi}{\partial t^2} = \nabla^2 \phi.
$$
We will focus on the simple $1+1$d case
$$
\frac{\part... |
mne-tools/mne-tools.github.io | 0.23/_downloads/e1c3654f77f904db443b548e9d93b8f9/50_decoding.ipynb | bsd-3-clause | import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import mne
from mne.datasets import sample
from mne.decoding import (SlidingEstimator, GeneralizingEstimator, Scaler,
... |
chapmanbe/utah_highschool_airquality | social_justice/social_justice_bqplot.ipynb | apache-2.0 | %matplotlib inline
"""
Explanation: Air Quality and Social Justice
In the Salt Lake area, where smog will periodically hide the mountains that surround the city, air pollution is a consistent concern. The smog is a result of the pollution trapped by the unique topographic features of the Wasatch area. In this notebook... |
deepmind/dm_control | tutorial.ipynb | apache-2.0 | #@title Run to install MuJoCo and `dm_control`
import distutils.util
import subprocess
if subprocess.run('nvidia-smi').returncode:
raise RuntimeError(
'Cannot communicate with GPU. '
'Make sure you are using a GPU Colab runtime. '
'Go to the Runtime menu and select Choose runtime type.')
print('Ins... |
lionell/university-labs | ml/lab1.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
%matplotlib inline
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.neural_network import ... |
ES-DOC/esdoc-jupyterhub | notebooks/awi/cmip6/models/awi-cm-1-0-lr/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'awi', 'awi-cm-1-0-lr', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: AWI
Source ID: AWI-CM-1-0-LR
Topic: Ocean
Sub-Topics: Timestepping Framework, Adv... |
jinntrance/MOOC | coursera/ml-regression/assignments/week-2-multiple-regression-assignment-1-blank.ipynb | cc0-1.0 | import graphlab
"""
Explanation: Regression Week 2: Multiple Regression (Interpretation)
The goal of this first notebook is to explore multiple regression and feature engineering with existing graphlab functions.
In this notebook you will use data on house sales in King County to predict prices using multiple regressi... |
CNS-OIST/STEPS_Example | user_manual/source/ip3.ipynb | gpl-2.0 | import steps.model as smodel
mdl = smodel.Model()
"""
Explanation: Surface-Volume Reactions (Example: IP3 Model)
The simulation script described in this chapter is available at STEPS_Example repository.
In the previous chapter we used objects of type steps.model.Reac to represent
a reaction taking place inside a volum... |
y2ee201/Deep-Learning-Nanodegree | weight-initialization/weight_initialization.ipynb | mit | %matplotlib inline
import tensorflow as tf
import helper
from tensorflow.examples.tutorials.mnist import input_data
print('Getting MNIST Dataset...')
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print('Data Extracted.')
"""
Explanation: Weight Initialization
In this lesson, you'll learn how to fin... |
wcmckee/wcmckee.com | posts/GetsDrawnDotCom.ipynb | mit | import os
import requests
from bs4 import BeautifulSoup
import re
import json
import time
import praw
import dominate
from dominate.tags import *
from time import gmtime, strftime
#import nose
#import unittest
import numpy as np
import pandas as pd
from pandas import *
from PIL import Image
from pprint import pprint
... |
ES-DOC/esdoc-jupyterhub | notebooks/niwa/cmip6/models/sandbox-3/ocnbgchem.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'niwa', 'sandbox-3', 'ocnbgchem')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocnbgchem
MIP Era: CMIP6
Institute: NIWA
Source ID: SANDBOX-3
Topic: Ocnbgchem
Sub-Topics: Tracers.
Properties:... |
Featuretools/featuretools | docs/source/guides/feature_selection.ipynb | bsd-3-clause | import pandas as pd
import featuretools as ft
from featuretools.selection import (
remove_highly_correlated_features,
remove_highly_null_features,
remove_single_value_features,
)
from featuretools.primitives import NaturalLanguage
from featuretools.demo.flight import load_flight
es = load_flight(nrows=50... |
AhmetHamzaEmra/Deep-Learning-Specialization-Coursera | Sequence Models/Dinosaurus+Island+--+Character+level+language+model+final+-+v3.ipynb | mit | import numpy as np
from utils import *
import random
"""
Explanation: Character level language model - Dinosaurus land
Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of... |
oychang/just-a-number | generate_name_likelihoods.ipynb | mit | import csv
import json
import os
from collections import namedtuple, defaultdict
from glob import glob
"""
Explanation: Overview
This notebook is an attempt to recreate the dataset used in FiveThirtyEight's article How to Tell Someone’s Age When All You Know Is Her Name.
The gist of the article is that by using a comb... |
TemoaProject/temoa | data_files/temoa_utopia_analysis_with_pyam.ipynb | gpl-2.0 | import pyam
df = pyam.IamDataFrame('temoa_utopia_test_run_model/test_run_pyam.xlsx')
"""
Explanation: Analysis of Temoa Utopia results using pyam
The file temoa_utopia_pyam.xlsx used in this notebook is created by running the "Utopia" model
$ python temoa_model/ --config=temoa_model/config_sample
Running Temoa expor... |
dhutchis/systemml | samples/jupyter-notebooks/DML Tips and Tricks (aka Fun With DML).ipynb | apache-2.0 | from systemml import MLContext, dml, jvm_stdout
ml = MLContext(sc)
print (ml.buildTime())
"""
Explanation: Cross Validation
Value-based join of two Matrices
Filter Matrix to include only Frequent Column Values
Construct (sparse) Matrix from (rowIndex, colIndex, values) triplets
Find and remove duplicates in columns o... |
beangoben/HistoriaDatos_Higgs | Dia3/.ipynb_checkpoints/4_Datos_LHC-checkpoint.ipynb | gpl-2.0 | import pandas as pd
import numpy as np # modulo de computo numerico
import matplotlib.pyplot as plt # modulo de graficas
# esta linea hace que las graficas salgan en el notebook
import seaborn as sns
%matplotlib inline
"""
Explanation: A explorar los datos del LHC
Hoy vamos a combinar dos conceptos que vimos ayer:
A... |
Diyago/Machine-Learning-scripts | time series regression/time_series.ipynb | apache-2.0 | import warnings
warnings.filterwarnings('ignore')
import random
random.seed(42)
import seaborn as sns
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression, RidgeCV, LassoCV
from sklearn.metrics import mean_absolute_error, mean_squared_error
from sklearn.preprocessing import Standa... |
ShubhamDebnath/Coursera-Machine-Learning | Course 2/Optimization methods.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import scipy.io
import math
import sklearn
import sklearn.datasets
from opt_utils import load_params_and_grads, initialize_parameters, forward_propagation, backward_propagation
from opt_utils import compute_cost, predict, predict_dec, plot_decision_boundary, load_data... |
zzsza/TIL | deep_learning_from_scratch/Lecture note.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys, os
%matplotlib inline
def AND(x1, x2):
w1, w2, theta = 0.5, 0.5, 0.7
tmp = x1*w1 + x2*w2
if tmp <= theta:
return 0
elif tmp > theta:
return 1
AND(1, 1)
AND(1, 0)
def AND2(x1, x2):
x = np.array([x1,... |
jadianes/redis-integration-patterns-python | notebooks/Introduction to Redis with Python.ipynb | apache-2.0 | import redis
"""
Explanation: An Introduction to Redis with Python
In this notebook, we will go thourhg a similar set of commands as those described in the Redis Data Types introduction but using the redis-py Python client from a Jupyter notebook.
Remember that Redis is a server, and it can be access in a distribute... |
mne-tools/mne-tools.github.io | dev/_downloads/6965b7b1a563cc32b2b5388d95203d43/60_cluster_rmANOVA_spatiotemporal.ipynb | bsd-3-clause | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Denis Engemannn <denis.engemann@gmail.com>
#
# License: BSD-3-Clause
import os.path as op
import numpy as np
from numpy.random import randn
import matplotlib.pyplot as plt
import mne
from mne.stats ... |
catniplab/catniplab.github.io | journalclub/JournalClub.ipynb | mit | # %pip install --user pyzotero
%pip install unidecode
from pyzotero import zotero
import datetime
import re
import os
from unidecode import unidecode
import urllib.parse
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import base64
import ipywidgets as widgets
from IPython.display ... |
molgor/spystats | notebooks/Sandboxes/TensorFlow/GPFlow_examples.ipynb | bsd-2-clause | ## Import modules
import numpy as np
import scipy.spatial.distance as sp
from matplotlib import pyplot as plt
plt.style.use('ggplot')
"""
Explanation: GPFlow first approximation
End of explanation
"""
## Parameter definitions
N = 1000
phi = 0.05
sigma2 = 1.0
beta_0 = 10.0
beta_1 = 1.5
beta_2 = -1.0
# AL NAGAT
nugget... |
mne-tools/mne-tools.github.io | 0.17/_downloads/c252c7618c44ac318ad1e9e85d5b7059/plot_decoding_csp_timefreq.ipynb | bsd-3-clause | # Authors: Laura Gwilliams <laura.gwilliams@nyu.edu>
# Jean-Remi King <jeanremi.king@gmail.com>
# Alex Barachant <alexandre.barachant@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
from... |
dmc-2016/dmc | notebooks/week-2/03 - Introduction to Python - Functions and Objects.ipynb | apache-2.0 | def addFunction(inputNumber):
result = inputNumber + 2
return result
"""
Explanation: So far, we have seen how we can use variables in Python to store different kinds of data, and how we can use 'flow control' structures such as conditionals and loops to change the order or the way in which lines of code get e... |
kubeflow/examples | mnist/mnist_aws.ipynb | apache-2.0 | !pip install boto3
"""
Explanation: MNIST E2E on Kubeflow on AWS
This example guides you through:
Taking an example TensorFlow model and modifying it to support distributed training
Serving the resulting model using TFServing
Deploying and using a web-app that uses the model
Requirements
You must be running Kubeflo... |
ghaslam/AM207 | ModelSampler-Copy1.ipynb | mit | train = train[train['longitude'] > 1]
train = train[train['latitude'] < 0]
train = train[train['construction_year'] != 0]
train = train[train['gps_height'] != 0]
features = ['longitude','latitude']
trainLoc = train[features]
#hasLocIdx = train['longitude']>1
#trainLoc = trainLoc[hasLocIdx] #remove rows with empty loc... |
mathemage/h2o-3 | h2o-py/demos/kmeans_aic_bic_diagnostics.ipynb | apache-2.0 | import h2o
import imp
from h2o.estimators.kmeans import H2OKMeansEstimator
# Start a local instance of the H2O engine.
h2o.init();
"""
Explanation: Much data produced is unlabeled data, data where the target vale or class is unknown. Unsupervised learning gives us the tools to find hidden structure in unlabeled data... |
tatyana-perlova/py-taxis | examples/Full_walkthrough.ipynb | gpl-3.0 | %matplotlib inline
%load_ext autoreload
%autoreload
"""
Explanation: Ipython notebook magic
End of explanation
"""
import pylab
import sys
import matplotlib.pyplot as plt
import numpy as np
import seaborn
import re
import time
import datetime
import pandas as pd
import random
import trackpy as tp
from sklearn.extern... |
liganega/Gongsu-DataSci | previous/notes2017/W04/GongSu10_Tuples.ipynb | gpl-3.0 | from __future__ import print_function
"""
Explanation: 튜플 활용
주요 내용
파이썬에 내장되어 있는 컬렉션 자료형 중에서 튜플에 대해 알아 본다.
튜플(tuples): 리스트와 비슷. 하지만 수정 불가능(immutable).
* 사용 형태: 소괄호 사용
even_numbers_tuple = (2, 4, 6, 8, 10)
todays_datatypes_tuple = ('list', 'tuple', 'dictionary')
특징: 임의의 자료형 값들을 섞어서 항목으로 사용 가능
mixed_tuple = (1, 'abs', ... |
StanIsAdmin/PyProt | examples/sequence-alignment.ipynb | gpl-3.0 | a1 = AminoAcid("A")
print(a1)
a2 = AminoAcid(a1)
print(a1 == a2)
a3 = AminoAcid("K")
print(a3.getName("long"))
"""
Explanation: Sequence alignment
Genetic material such as DNA and proteins comes in sequences made up of different blocks. The study of these sequences and their correlation is invaluable to the field of b... |
feststelltaste/software-analytics | prototypes/KnowledgeGaps.ipynb | gpl-3.0 | git_blame.info(memory_usage='deep')
"""
Explanation: Wir haben X Einträge. Es wird viel Speicher belegt, wenn wir die Daten roh einlesen
End of explanation
"""
git_blame.path = pd.Categorical(git_blame.path)
git_blame.author = pd.Categorical(git_blame.author)
git_blame.timestamp = pd.to_datetime(git_blame.timestamp)... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_decoding_spatio_temporal_source.ipynb | bsd-3-clause | # Author: Denis A. Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import mne
import os
import numpy as np
from mne import io
from mne.datasets import sample
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator
... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive/05_review/labs/1_explore_dataset.ipynb | apache-2.0 | PROJECT = "cloud-training-demos" # Replace with your PROJECT
BUCKET = "cloud-training-bucket" # Replace with your BUCKET
REGION = "us-central1" # Choose an available region for Cloud MLE
TFVERSION = "1.14" # TF version for CMLE to use
import os
os.environ["BUCKET"] = BUCKET
os.environ["PROJ... |
zambzamb/zpic | python/Direct.ipynb | agpl-3.0 | # Using spectral EM1D code
import em1ds as zpic
import numpy as np
nx = 120
box = 4 * np.pi
dt = 0.08
tmax = 50.0
ppc = 500
ufl = [0.4, 0.0, 0.0]
uth = [0.001,0.001,0.001]
right = zpic.Species( "right", -1.0, ppc, ufl = ufl, uth = uth )
ufl[0] = -ufl[0]
left = zpic.Species( "left", -1.0, ppc, ufl = ufl, uth =... |
rossjp/jupyterExample | jupyterExample.ipynb | mit | print('Welcome to Jupyter Notebook!')
"""
Explanation: Hello World
End of explanation
"""
nums = [13, 137, 1347]
for num in nums:
# prime numbers are greater than 1
if num > 1:
for i in range(2,num):
if (num % i) == 0:
print(num,"is not a prime number")
print(... |
hillairet/analysis-for-safer-roads | Section1 - Data Wrangling.ipynb | gpl-3.0 | import pandas as pd
import numpy as np
from pandas import DataFrame,Series
%matplotlib inline
"""
Explanation: Section 1
This section is dedicated to the preparation of the dataframes used in the subsequent sections.
We present here what is actually performed in CSVtoSQLconverter.py where the CSV files are read into ... |
cangermueller/deepcpg | examples/notebooks/snp/index.ipynb | mit | import os
from os import path as pt
import h5py as h5
from matplotlib import pyplot as plt
import seaborn as sns
%matplotlib inline
example_dir = "../../data" # Directory with example data.
cpg_dir = pt.join(example_dir, "cpg") # Directory with CpG profiles.
dna_dir = pt.join(example_dir, "dna/mm10") # Directory wit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.