repo_name stringlengths 6 77 | path stringlengths 8 215 | license stringclasses 15
values | content stringlengths 335 154k |
|---|---|---|---|
volodymyrss/3ML | examples/basic_test.ipynb | bsd-3-clause | from threeML import *
import matplotlib.pyplot as plt
%matplotlib inline
%matplotlib notebook
"""
Explanation: <center><img src="http://identity.stanford.edu/overview/images/emblems/SU_BlockStree_2color.png" width="200" style="display: inline-block"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/... |
GoogleCloudPlatform/ml-design-patterns | 05_resilience/serving_function.ipynb | apache-2.0 | # Already installed if you are using Cloud AI Platform Notebooks
#!pip install -q tensorflow-hub
#!pip install -q tfds-nightly
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
train_data, test_data = tfds.load(
name="imdb_reviews",
split=('train', 't... |
csaladenes/aviation | code/.ipynb_checkpoints/airport_arrv_parser-checkpoint.ipynb | mit | L=json.loads(file('../json/L.json','r').read())
M=json.loads(file('../json/M.json','r').read())
N=json.loads(file('../json/N.json','r').read())
import requests
AP={}
for c in M:
if c not in AP:AP[c]={}
for i in range(len(L[c])):
AP[c][N[c][i]]=L[c][i]
"""
Explanation: Load airports of each country
En... |
darkomen/TFG | ipython_notebooks/06_regulador_experto/.ipynb_checkpoints/ensayo5-checkpoint.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
reachtarunhere/aima-python | agents.ipynb | mit | from agents import *
class BlindDog(Agent):
def eat(self, thing):
print("Dog: Ate food at {}.".format(self.location))
def drink(self, thing):
print("Dog: Drank water at {}.".format( self.location))
dog = BlindDog()
"""
Explanation: AGENT
An agent, as defined in 2.1 is anything th... |
encima/Comp_Thinking_In_Python | Session_6/Modules, Imports and Packages.ipynb | mit | import random
dir(random)
"""
Explanation: Modules, Imports and Packages
Dr. Chris Gwilliams
gwilliamsc@cardiff.ac.uk
Python Modules
We have seen that there are many things one can do using Python, but this barely touches the surface.
Python uses modules (a.ka. libraries) to extend the basic functionality and we hav... |
metpy/MetPy | v1.0/_downloads/83b6998284b63bb8a8f46a92e71d6000/isentropic_example.ipynb | bsd-3-clause | import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import add_metpy_logo, add_timestamp
from metpy.units import units
"""
Explanation: Isentropic Analysi... |
bmeaut/python_nlp_2017_fall | course_material/02_Types_Operators_Strings/02_Types_Operators_Strings_lab_solution.ipynb | mit | def is_symmetric(l):
for i in range(len(l) // 2):
if l[i] != l[len(l)-i-1]:
return False
return True
# idiomatic solution
def is_symmetric(l):
return all(l[i] == l[len(l)-i-1] for i in range(len(l) // 2))
assert(is_symmetric([1]) == True)
assert(is_symmetric([]) == True)
assert(is_symm... |
greenelab/GCB535 | 25_Python-III/Lesson3_extra_material.ipynb | bsd-3-clause | print range(5)
print range(1, 6)
print range(0, 11, 2)
"""
Explanation: Lesson 3: Extra material
Endless loops
With while loops, there's always a risk of accidentally creating a conditional that never becomes False, leading to an endless loop. Luckily, this can usually be avoided just by checking over your loop lo... |
aavanian/bokeh | examples/howto/server_embed/notebook_embed.ipynb | bsd-3-clause | import yaml
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.themes import Theme
from bokeh.io import show, output_notebook
from bokeh.sampledata.sea_surface_temperature import sea_surface_temperature
output_notebook()
"""
Explanation: E... |
mediagit2016/workcamp-maschinelles-lernen-grundlagen | 17-12-11-workcamp-ml/2017-12-11-arbeiten-mit-dataframes-10.ipynb | gpl-3.0 | import pandas as pd #Import der Bibliothek pandas
from pandas import Series
objekt = Series([1200,1500,1600,1400,1800])
print objekt
print objekt.values
print objekt.index
objekt2 = Series([1200,1500,1600,1400,1800],index=['Montag','Dienstag','Mittwoch','Donnerstag','Freitag'])
print objekt2
objekt2['Montag']
obje... |
magic-lantern/NLP_Project | GetRadLexTermsExpanded.ipynb | apache-2.0 | def create_regex(r1,r2):
if r2:
return r"\b%s\b|\b%s\b"%(r1,r2)
else:
return r"\b%s\b"%r1
print("Grabradlex: ", GRABRADLEX)
if GRABRADLEX:
g = rdflib.Graph()
#result = g.parse("http://data.bioontology.org/ontologies/RADLEX/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_fo... |
BinWang0213/Nearwellbore_Streamline | Example-QuickStart.ipynb | bsd-3-clause | import Lib.subdivision as sub
Method_subdivision=sub.WellGrid(Rect0=(0,0),Rect1=(50,50),Qw=1000,Qe=(200,400,300,100),h=26.25,phi=0.2)
Method_subdivision.Subdivision()
SL,TOF,SL_end,TOF_end=Method_subdivision.SLTrace(NSL=80)
Method_subdivision=sub.WellGrid(Rect0=(0,0),Rect1=(50,50),Qw=1000,Qe=(0,0,500,500),h=26.25,phi... |
darcamo/pyphysim | notebooks/TDL_and_OFDM.ipynb | gpl-2.0 | %matplotlib inline
import math
import sys
import numpy as np
from matplotlib import pyplot as plt
from pyphysim import channels
from pyphysim.channels.fading import COST259_RAx, TdlChannel
from pyphysim.channels.fading_generators import JakesSampleGenerator
from pyphysim.modulators import OFDM, PSK, QAM
from pyphysi... |
tylere/ee-jupyter-examples | 4 - Earth Engine and TensorFlow.ipynb | apache-2.0 | import ee
from IPython import display
import math
from matplotlib import pyplot
import numpy
from osgeo import gdal
import tempfile
import tensorflow as tf
import urllib
import zipfile
"""
Explanation: Introduction to Earth Engine and TensorFlow in Cloud Datalab
This notebook walks you through a simple example of usin... |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/09_sequence/labs/text_classification.ipynb | apache-2.0 | !sudo chown -R jupyter:jupyter /home/jupyter/training-data-analyst
!pip install --user google-cloud-bigquery==1.25.0
"""
Explanation: <h1> Text Classification using TensorFlow/Keras on AI Platform </h1>
This notebook illustrates:
<ol>
<li> Creating datasets for AI Platform using BigQuery
<li> Creating a text classif... |
jpwhite3/python-analytics-demo | Part_4.ipynb | cc0-1.0 | import pandas as pd
import numpy as np
import seaborn as sns
import statsmodels.formula.api as sm
from scipy import stats
stats.chisqprob = lambda chisq, df: stats.chi2.sf(chisq, df)
"""
Explanation: Regression and Prediction
End of explanation
"""
tips = pd.read_csv('input/tips.csv')
tips['tip_percent'] = (tips['ti... |
GoogleCloudPlatform/mlops-on-gcp | immersion/docker_and_kubernetes/solutions/3_k8s_hello_node.ipynb | apache-2.0 | !cat ./src/server.js
"""
Explanation: Hello Node Kubernetes
Learning Objectives
* Create a Node.js server
* Create a Docker container image
* Create a container cluster and a Kubernetes pod
* Scale up your services
Overview
The goal of this hands-on lab is for you to turn code that you have developed into a replic... |
DavidObando/carnd | Term1/Project3/P3 workspace.ipynb | apache-2.0 | import csv
import cv2
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout, Lambda
from keras.layers.convolutional import Convolution2D
from keras.layers.pooling import MaxPooling2D
from keras.optimizers import Adam
from keras.regularizers import l2, activity_l2
import m... |
Ironlors/SmartIntersection-Ger | Journal/.ipynb_checkpoints/Pandas-checkpoint.ipynb | apache-2.0 | import pandas as pd
import numpy as np
"""
Explanation: Analyse von Daten
mit Python
Einführung
Dies ist mein Lerndokument zur Erkundung der Möglichkeiten, welche mir mit der Hilfe von Python zur Erkundung von Datensätzen zur verfühung steht.
Dabei nutzen wir pandas und numpy als unsere hauptsächlichen Werkzeuge.
Hier... |
flaviocordova/udacity_deep_learn_project | intro-to-tflearn/TFLearn_Digit_Recognition.ipynb | mit | # Import Numpy, TensorFlow, TFLearn, and MNIST data
import numpy as np
import tensorflow as tf
import tflearn
import tflearn.datasets.mnist as mnist
"""
Explanation: Handwritten Number Recognition with TFLearn and MNIST
In this notebook, we'll be building a neural network that recognizes handwritten numbers 0-9.
This... |
AnyBody-Research-Group/AnyPyTools | docs/Tutorial/06_Tips&Tricks.ipynb | mit | from anypytools import AnyPyProcess
app = AnyPyProcess(num_processes=1)
macro = [
'load "Knee.any"',
'operation Main.MyStudy.InverseDynamics',
'run',
]
macrolist = [macro]*20
app.start_macro(macrolist);
"""
Explanation: Tips & Trics for anypytools
Stopping and restarting simulations
AnyPyProcess cache... |
google/fedjax | docs/notebooks/algorithms_tutorial.ipynb | apache-2.0 | # Uncomment these to install fedjax.
# !pip install fedjax
# !pip install --upgrade git+https://github.com/google/fedjax.git
import jax
import jax.numpy as jnp
import numpy as np
import fedjax
# We only use TensorFlow for datasets, so we restrict it to CPU only to avoid
# issues with certain ops not being available o... |
sebastiandres/mat281 | laboratorios/lab03-HoldoutSetYCrossValidation/Lab03-HSoCV.ipynb | cc0-1.0 | #Configuracion para recargar módulos y librerías cada vez
%reload_ext autoreload
%autoreload 2
... |
vzg100/Post-Translational-Modification-Prediction | old/Phosphorylation Sequence Tests -MLP -dbptm+ELM -EnzymeBenchmarks-VectorAvr..ipynb | mit | from pred import Predictor
from pred import sequence_vector
from pred import chemical_vector
"""
Explanation: Template for test
End of explanation
"""
par = ["pass", "ADASYN", "SMOTEENN", "random_under_sample", "ncl", "near_miss"]
benchmarks = ["Data/Benchmarks/phos_CDK1.csv", "Data/Benchmarks/phos_CK2.csv", "Data/B... |
elect000/Journal | value-tracker/report/python/report.ipynb | bsd-3-clause | import quandl
data = quandl.get('NIKKEI/INDEX')
data[:5]
data_normal = (((data['Close Price']).to_frame())[-10000:-1])['Close Price']
data_normal[-10:-1] # 最新のデータ10件を表示
"""
Explanation: データの取得方法
ここではQuandl.comからのデータを受け取っています。今回入手した日経平均株価は、
時間、開始値、最高値、最低値、終値のデータを入手していますが、古いデータは終値しかないようですので、終値を用います。
*** TODO いつからデータを入... |
probml/pyprobml | notebooks/book1/15/rnn_sentiment_jax.ipynb | mit | import numpy as np
import matplotlib.pyplot as plt
import math
from IPython import display
import jax
import jax.numpy as jnp
try:
from flax import linen as nn
except ModuleNotFoundError:
%pip install -qq flax
from flax import linen as nn
from flax.training import train_state
try:
import optax
except... |
KJE2001/seminars | problem_candidates/Plotting surfacees.ipynb | mit | %matplotlib notebook
# This enables you to drag and rotate the figure
from mpl_toolkits.mplot3d import Axes3D # needed to do the 3D Plots
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca(projection='3d')
u = np.linspace(0, 2*np.pi, 100)
v = np.linspace(0, 2*np.pi, 100)
u, v = np.me... |
yangw1234/BigDL | python/chronos/use-case/network_traffic/network_traffic_autots_forecasting_deprecated.ipynb | apache-2.0 | def get_drop_dates_and_len(df, allow_missing_num=3):
"""
Find missing values and get records to drop
"""
missing_num = df.total.isnull().astype(int).groupby(df.total.notnull().astype(int).cumsum()).sum()
drop_missing_num = missing_num[missing_num > allow_missing_num]
drop_datetimes = df.iloc[dro... |
ES-DOC/esdoc-jupyterhub | notebooks/cnrm-cerfacs/cmip6/models/sandbox-1/ocean.ipynb | gpl-3.0 | # DO NOT EDIT !
from pyesdoc.ipython.model_topic import NotebookOutput
# DO NOT EDIT !
DOC = NotebookOutput('cmip6', 'cnrm-cerfacs', 'sandbox-1', 'ocean')
"""
Explanation: ES-DOC CMIP6 Model Properties - Ocean
MIP Era: CMIP6
Institute: CNRM-CERFACS
Source ID: SANDBOX-1
Topic: Ocean
Sub-Topics: Timestepping Fram... |
jhillairet/scikit-rf | doc/source/examples/metrology/Calibration With Three Receivers.ipynb | bsd-3-clause | from IPython.display import *
SVG('three_receiver_cal/pics/vnaBlockDiagramForwardRotated.svg')
"""
Explanation: Calibration With Three Receivers
Intro
It has long been known that full error correction is possible given a VNA with only three receivers and no internal coaxial switch. However, since no modern VNA employs... |
DJCordhose/ai | notebooks/rl/berater-v11-higher.ipynb | mit | !pip install git+https://github.com/openai/baselines >/dev/null
!pip install gym >/dev/null
"""
Explanation: <a href="https://colab.research.google.com/github/DJCordhose/ai/blob/master/notebooks/rl/berater-v11-higher.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open ... |
aaschroeder/Titanic_example | Titanic_data_exploration_MASTER.ipynb | gpl-3.0 | print titanic.info()
print titanic.describe().T
print titanic.head(5)
"""
Explanation: First take a look at the data types and non-null entries
End of explanation
"""
titanic.Sex.replace(['male','female'],[True,False], inplace=True)
"""
Explanation: Some observations from looking at the above data include:
Age c... |
Danghor/Formal-Languages | Ply/Symbolic-Calculator.ipynb | gpl-2.0 | import ply.lex as lex
tokens = [ 'NUMBER', 'IDENTIFIER', 'ASSIGN_OP' ]
"""
Explanation: A Simple Symbolic Calculator
This file shows how a simply symbolic calculator can be implemented using Ply.
Specification of the Scanner
End of explanation
"""
def t_NUMBER(t):
r'0|[1-9][0-9]*(\.[0-9]+)?(e[+-]?([1-9][0-9]*))... |
tleonhardt/CodingPlayground | dataquest/DataVisualiation/Pixar_Movies.ipynb | mit | # Setup the environment by importing the libraries we need
import pandas as pd
import matplotlib.pyplot as plt
# Note: Importing seaborn effects all matplotlib and pandas plots as well
import seaborn as sns
# Run the Jupyter magic so that plots are displayed in the notebook
%matplotlib notebook
# Read the dataset int... |
tpin3694/tpin3694.github.io | python/pandas_replace_values.ipynb | mit | import pandas as pd
import numpy as np
"""
Explanation: Title: Replacing Values In Pandas
Slug: pandas_replace_values
Summary: Replacing Values In Pandas
Date: 2016-05-01 12:00
Category: Python
Tags: Data Wrangling
Authors: Chris Albon
import modules
End of explanation
"""
raw_data = {'first_name': ['Jason', 'Moll... |
Kaggle/learntools | notebooks/python/raw/ex_1.ipynb | apache-2.0 | print("You've successfully run some Python code")
print("Congratulations!")
"""
Explanation: Welcome to your first set of Python coding problems. If this is your first time using Kaggle Notebooks, welcome!
Notebooks are composed of blocks (called "cells") of text and code. Each of these is editable, though you'll ma... |
fantasycheng/udacity-deep-learning-project | tv-script-generation/dlnd_tv_script_generation.ipynb | mit | """
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
data_dir = './data/simpsons/moes_tavern_lines.txt'
text = helper.load_data(data_dir)
# Ignore notice, since we don't use it for analysing the data
text = text[81:]
"""
Explanation: TV Script Generation
In this project, you'll generate your own Simpsons TV scrip... |
transcranial/keras-js | notebooks/layers/pooling/AveragePooling1D.ipynb | mit | data_in_shape = (6, 6)
L = AveragePooling1D(pool_size=2, strides=None, padding='valid')
layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)
# set weights to random (use seed for reproducibility)
np.random.seed(250)
data_in = 2 * np.random.random(data_in_shape) - 1
... |
mjbrodzik/ipython_notebooks | charis/Converting Naryn streamflow to hyps.ipynb | apache-2.0 | from __future__ import print_function
import calendar
from charistools.hypsometry import Hypsometry
from charistools.timeSeries import TimeSeries
import datetime as dt
import pandas as pd
import numpy as np
import os
import re
from time import strptime
%cd /Users/brodzik/projects/CHARIS/streamflow/From_Alice_Naryn
%ls... |
kingtaurus/cs224d | class_notebooks/vanishing_grad_example.ipynb | mit | # Setup
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
import seaborn as sns
sns.set_context("notebook", font_scale=1.5, rc={"lines.linewi... |
dgasmith/EEX_scratch | demos/EEX Demo.ipynb | bsd-3-clause | import eex
import os
import pandas as pd
import numpy as np
# Create empty data layer
dl = eex.datalayer.DataLayer("butane", backend="Memory")
dl.summary()
"""
First, we add atoms to the system. Atoms have associated metadata. The possible atom metadata is listed here.
"""
dl.list_valid_atom_properties()
"""
TOPO... |
Hash--/documents | notebooks/TP Master Fusion/Tore Supra Confinement Time Analysis.ipynb | mit | %matplotlib notebook
import pywed as pd
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from scipy.interpolate import interp1d
from scipy.integrate import trapz
from scipy.constants import pi, e, Boltzmann as k_B
# Pulses and signal lists
pulses = [40999, 41003, 41004, 41005, 41006, 41007,... |
thesarahmeister/studyGroup | lessons/pythonClasses/Classes_in_Python.ipynb | apache-2.0 | # create the Client class below
class Client(object):
def __init__(self, name, balance):
self.name = name
self.balance = balance + 100
#define account level
if self.balance < 5000:
self.level = "Basic"
elif self.balance < 15000:
self.level = "... |
GAMPTeam/vampyre | demos/sparse/sparse_lin_inverse.ipynb | mit | import os
import sys
vp_path = os.path.abspath('../../')
if not vp_path in sys.path:
sys.path.append(vp_path)
import vampyre as vp
"""
Explanation: Sparse Linear Inverse Demo
In this demo, we illustrate how to use the vampyre package for a simple sparse linear inverse problem. The problem is to estimate a sparse... |
karlstroetmann/Formal-Languages | Ply/Ply-Scanning-Example.ipynb | gpl-2.0 | from IPython.core.display import HTML
with open ("../style.css", "r") as file:
css = file.read()
HTML(css)
"""
Explanation: Note that you have to execute the command jupyter notebook in the parent directory of
this directory for otherwise jupyter won't be able to access the file style.css.
End of explanation
"""
... |
mne-tools/mne-tools.github.io | 0.14/_downloads/plot_brainstorm_phantom_ctf.ipynb | bsd-3-clause | # Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import fit_dipole
from mne.datasets.brainstorm import bst_phantom_ctf
from mne.io import read_raw_ctf
print(__doc__)
"""
Explanation: Brainstorm CT... |
seg/2016-ml-contest | StoDIG/Facies_classification_StoDIG_3.ipynb | apache-2.0 | %%sh
pip install pandas
pip install scikit-learn
pip install keras
pip install sklearn
from __future__ import print_function
import time
import numpy as np
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
f... |
AntArch/Presentations_Github | 20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData/20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData.ipynb | cc0-1.0 | from IPython.display import YouTubeVideo
YouTubeVideo('F4rFuIb1Ie4')
## PDF output using pandoc
import os
### Export this notebook as markdown
commandLineSyntax = 'ipython nbconvert --to markdown 20160202_Nottingham_GIServices_Lecture3_Beck_InteroperabilitySemanticsAndOpenData.ipynb'
print (commandLineSyntax)
os.s... |
nafitzgerald/allennlp | tutorials/notebooks/embedding_tokens.ipynb | apache-2.0 | # This cell just makes sure the library paths are correct.
# You need to run this cell before you run the rest of this
# tutorial, but you can ignore the contents!
import os
import sys
module_path = os.path.abspath(os.path.join('../..'))
if module_path not in sys.path:
sys.path.append(module_path)
from allennlp.d... |
nansencenter/nansat-lectures | notebooks/14 Django exercise.ipynb | gpl-3.0 | !django-admin startproject myproj1
!cd myproj1 && django-admin startapp myapp1
"""
Explanation: Create your own database and fill it with data
Create Django project
Create first App (place to store your models)
End of explanation
"""
from django.db import models
class Profile(models.Model):
''' Description of T... |
google/applied-machine-learning-intensive | content/02_data/03_visualizations/colab.ipynb | apache-2.0 | # 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 the L... |
majeau-bettez/ecospold2matrix | doc/Adapt_C_matrices_for_versions4&5.ipynb | bsd-2-clause | import pandas as pd
old_LCIA = pd.read_excel('put_the_path_to_your_old_LCIA_implementation_file.xls_here','CFs')
incomplete_LCIA = pd.read_excel('put_the_path_to_your_incomplete_LCIA_implementation_file.xls_here','CFs')
complete_LCIA = incomplete_LCIA.merge(old_LCIA,how='left')
# drop obsolete columns
complete_LCIA ... |
garth-wells/IA-maths-Ipython | Lecture11.ipynb | bsd-3-clause | # Import NumPy and seed random number generator to make generated matrices deterministic
import numpy as np
np.random.seed(2)
# Create a matrix with random entries
A = np.random.rand(4, 4)
print(A)
"""
Explanation: Lecture 11 - diagonalising matrices
By an appropriate transformation, most matrices can be made diagona... |
lyoung13/deep-learning-nanodegree | p1-bikesharing-predictions/dlnd-your-first-neural-network.ipynb | mit | %matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
"""
Explanation: Your first neural network
In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code... |
musketeer191/job_analytics | nmf.ipynb | gpl-3.0 | import my_util as my_util
import cluster_skill_helpers as cluster_skill_helpers
from cluster_skill_helpers import *
import random as rd
HOME_DIR = 'd:/larc_projects/job_analytics/'
SKILL_DAT = HOME_DIR + 'data/clean/skill_cluster/'
SKILL_RES = HOME_DIR + 'results/' + 'skill_cluster/new/'
"""
Explanation: Skill Clus... |
sdpython/ensae_teaching_cs | _doc/notebooks/td2a/td2a_cenonce_session_1.ipynb | mit | %matplotlib inline
# Cette première instruction indique à Jupyter d'insérer les graphiques
# dans le notebook plutôt que dans une fenêtre externe.
import matplotlib.pyplot as plt
# Ces deux lignes change le style des graphes.
"""
Explanation: 2A.data - DataFrame et Graphes
Les Dataframe se sont imposés pour manipuler ... |
tensorflow/docs-l10n | site/ja/tutorials/keras/text_classification_with_hub.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... |
mila-udem/summerschool2015 | fuel_tutorial/fuel_logreg_solution.ipynb | bsd-3-clause | import os
# If you have not defined a Fuel data_path:
!mkdir fuel_data
os.environ['FUEL_DATA_PATH'] = os.path.abspath('./fuel_data')
# Download and convert MNIST
!fuel-download mnist -d $FUEL_DATA_PATH
!fuel-convert mnist -d $FUEL_DATA_PATH -o $FUEL_DATA_PATH
"""
Explanation: Fuel solution: logistic regression
This ... |
psychemedia/ou-robotics-vrep | robotVM/notebooks/Getting Started With The Notebooks.ipynb | apache-2.0 | #...and code cells like this one, that can be used to execute code
print("Hello world")
"""
Explanation: Getting Started With The Notebooks
Welcome to the world of Jupyter Notebooks on the one hand, and programming in the Python programming language on the other.
Be warned, though. This is not a fully blown Python pro... |
binh-vu/python-tutorial | 0.0_Introduction.ipynb | mit | for number in [0, 1, 2, 3, 4, 5, 6]:
if number % 2 == 0:
print "Even number:", number
"""
Explanation: Agenda
<ul>
<li><h3>Control flows</h3></li>
<li><h3>Functions</h3></li>
<li><h3>Data structures</h3></li>
<li><h3>Modules</h3></li>
</ul>
Python at a glance
A sample code from C
<pre>
for (int i = ... |
JackDi/phys202-2015-work | assignments/assignment03/NumpyEx02.ipynb | mit | import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
"""
Explanation: Numpy Exercise 2
Imports
End of explanation
"""
def np_fact(n):
"""Compute n! = n*(n-1)*...*1 using Numpy."""
if n==0:
return 1
a=np.arange(1,n+1,1)
b=np.cumprod(a)
c=b[::-1]
r... |
phoebe-project/phoebe2-docs | development/tutorials/saving_and_loading.ipynb | gpl-3.0 | #!pip install -I "phoebe>=2.4,<2.5"
import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt
logger = phoebe.logger(clevel='INFO')
b = phoebe.default_binary()
"""
Explanation: Advanced: Saving, Loading, and Exporting
Setup
Let's first make sure we have the latest version of PHOE... |
rocketproplab/Guides | Guides/filtering/State Estimation Using a GPS and Accelerometer.ipynb | mit | %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
fsize = 15
time_of_sim = 30 # s
freq_acc = 50 # frequency of accelerometer measurements
freq_meas = 2
dt = 1./freq_acc
dt_meas = 1./freq_meas
time_steps_acc = freq_acc*time_of_sim+1
time_steps_meas = freq_meas*time_of_sim+1
time = np.linspace(0... |
GoogleCloudPlatform/asl-ml-immersion | notebooks/end-to-end-structured/labs/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... |
steinam/teacher | jup_notebooks/data-science-ipython-notebooks-master/pandas/03.09-Pivot-Tables.ipynb | mit | import numpy as np
import pandas as pd
import seaborn as sns
titanic = sns.load_dataset('titanic')
titanic.head()
"""
Explanation: <!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png">
This notebook contains an excerpt from the Python Data Science Handbook by Jake V... |
CentroGeo/PyHagerstrand | hagerstrand.ipynb | gpl-2.0 | %pylab inline
from haggerstrand.diffusion import SimpleDiffusion
"""
Explanation: Difusión espacial
En este taller vamos a trabajar con una implementación en Python del modelo de difusión espacial de Torsten Hägerstrand. Este modelo es una simulación tipo Monte Carlo del proceso de difusión de innovaciones concebido o... |
sauloal/ipython | opticalmapping/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... |
rahulkgup/deep-learning-foundation | transfer-learning/Transfer_Learning_Solution.ipynb | mit | from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
vgg_dir = 'tensorflow_vgg/'
# Make sure vgg exists
if not isdir(vgg_dir):
raise Exception("VGG directory doesn't exist!")
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_s... |
xpgeng/exercises_of_machine_learning | k-Nearest_Neighbors/kNN_ML_in_Action.ipynb | mit | # -*- coding: utf-8 -*-
import operator
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
df = pd.DataFrame({'x1': [1.0, 1.0, 0, 0], 'x2': [1.1, 1.0, 0, 0.1], 'Labels': ['A', 'A', 'B', 'B']})
df
group = df.loc[:, ['x1', 'x2']].values
labels = df.Labels.v... |
Olsthoorn/TransientGroundwaterFlow | exercises_notebooks/PartialPenetration.ipynb | gpl-3.0 | from scipy.special import k0 # bessel function K0
import numpy as np
def dWpp(r, z, a, b, D):
"""Returns additional drawdown caused by partial penetration
Solution by Hantush. See Kruseman and De Ridder (1994), p159.
The real extra drawdown is Q/(2 pi kD) * dW
Parmeters:
----------
r : dis... |
tritemio/multispot_paper | dsDNA - Burst Statistics - MultiSpot-vs-SingleSpot.ipynb | mit | from fretbursts import *
sns = init_notebook()
import os
from glob import glob
import pandas as pd
from IPython.display import display
%config InlineBackend.figure_format='retina' # for hi-dpi displays
import lmfit
print('lmfit version:', lmfit.__version__)
figure_size = (5, 4)
default_figure = lambda: plt.subplots... |
mne-tools/mne-tools.github.io | 0.18/_downloads/e52b6a53120d8703a6509530cf6251dc/plot_roi_erpimage_by_rt.ipynb | bsd-3-clause | # Authors: Jona Sassenhagen <jona.sassenhagen@gmail.com>
#
# License: BSD (3-clause)
import mne
from mne.event import define_target_events
from mne.channels import make_1020_channel_selections
print(__doc__)
"""
Explanation: ===========================================================
Plot single trial activity, grou... |
astroumd/GradMap | notebooks/Lectures2018/Lecture2/Lecture2_InstructorCopy.ipynb | gpl-3.0 | import numpy as np
"""
Explanation: Review from the previous lecture
We covered a bunch of basic math commands (+,-,/,**) and variables:
- int, float, list, "string", array (today: booleans, functions)
- type() and print()
We also introduced you to Numerical Python (numpy) arrays and basic plotting using matplotlib.
... |
mne-tools/mne-tools.github.io | stable/_downloads/ab20eadd8e6e3c70dc4dd75cfef6ca4c/60_visualize_stc.ipynb | bsd-3-clause | import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.datasets import sample, fetch_hcp_mmp_parcellation
from mne.minimum_norm import apply_inverse, read_inverse_operator
from mne import read_evokeds
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
subjects... |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/image_classification/labs/4_tpu_training.ipynb | apache-2.0 | import os
os.environ["BUCKET"] = "your-bucket-here"
"""
Explanation: Transfer Learning on TPUs
In the <a href="3_tf_hub_transfer_learning.ipynb">previous notebook</a>, we learned how to do transfer learning with TensorFlow Hub. In this notebook, we're going to kick up our training speed with TPUs.
Learning Objectives
... |
taylor-oconnell/PyFBA | iPythonNotebooks/Using_an_SBML_model.ipynb | mit | import sys
import copy
import PyFBA
from __future__ import print_function
"""
Explanation: Using an SBML model
Getting started
Installing libraries
Before you start, you will need to install a couple of libraries:
The ModelSeedDatabase has all the biochemistry we'll need. You can install that with git clone.
The PyFBA... |
CalPolyPat/phys202-2015-work | assignments/assignment10/ODEsEx03.ipynb | mit | %matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, fixed
"""
Explanation: Ordinary Differential Equations Exercise 3
Imports
End of explanation
"""
g = 9.81 # m/s^2
l = 0.5 # length of pendulum, in meters
tmax = 50.... |
mselin/machine-learning-udacity | titanic_survival_exploration/.ipynb_checkpoints/titanic_survival_exploration-checkpoint.ipynb | unlicense | # Import libraries necessary for this project
import numpy as np
import pandas as pd
from IPython.display import display # Allows the use of display() for DataFrames
# Import supplementary visualizations code visuals.py
import visuals as vs
# Pretty display for notebooks
%matplotlib inline
# Load the dataset
in_file... |
anthonyng2/FX-Trading-with-Python-and-Oanda | Oanda v20 REST-oandapyV20/07.00 Transaction History.ipynb | mit | import pandas as pd
import oandapyV20
import oandapyV20.endpoints.transactions as trans
import configparser
config = configparser.ConfigParser()
config.read('../config/config_v20.ini')
accountID = config['oanda']['account_id']
access_token = config['oanda']['api_key']
client = oandapyV20.API(access_token=access_token... |
Stanford-BIS/syde556 | SYDE 556 Lecture 8 Memory.ipynb | gpl-2.0 | %pylab inline
import nengo
from nengo.utils.ensemble import response_curves
from nengo.dists import Uniform
model = nengo.Network('Oscillator')
freq = .25
scale = 1.1
N=300
with model:
stim = nengo.Node(lambda t: [.5,.5] if .1<t<.12 else [0,0])
inhib = nengo.Node(lambda t: [-1]*N if .8<t<.82 else [0]*N)
... |
ptpro3/ptpro3.github.io | Projects/Project3/Project3_Prashant.ipynb | mit | # imports
import pandas as pd
import dateutil.parser
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import BernoulliNB
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import Multinom... |
wkerzendorf/wsynphot | docs/quickstart.ipynb | bsd-3-clause | import wsynphot
"""
Explanation: Quickstart
End of explanation
"""
# wsynphot.download_filter_data()
"""
Explanation: Getting filter data ready to use
If you are using wsynphot for 1st time, YOU NEED TO DOWNLOAD THE FILTER DATA by using:
End of explanation
"""
# wsynphot.update_filter_data()
"""
Explanation: Thi... |
mari-linhares/tensorflow-workshop | code_samples/RNN/weather_prediction/model.ipynb | apache-2.0 | # tensorflow
import tensorflow as tf
# rnn common functions
from tensorflow.contrib.learn.python.learn.estimators import rnn_common
# visualization
import seaborn as sns
import matplotlib.pyplot as plt
# helpers
import numpy as np
import pandas as pd
import csv
# enable tensorflow logs
tf.logging.set_verbosity(tf.l... |
mlperf/training_results_v0.5 | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/notebooks/hello_t2t-rl.ipynb | apache-2.0 | iteration_num=300
hparams = trainer_lib.create_hparams("ppo_atari_base", "epochs_num={}".format(iteration_num+1))
ppo_dir = tempfile.mkdtemp(dir=data_dir, prefix="ppo_")
rl_trainer_lib.train(hparams, "stacked_pong", ppo_dir)
agent_policy_path = os.path.join(ppo_dir, "model{}.ckpt.index".format(iteration_num))[:-6]
""... |
L2V/like2vec | notebooks/04-JJA-Covariance-Similarity.ipynb | apache-2.0 | ml2 = loading_data("data/ml1m-train-clean")
ml_user_item_matrix, cov_ml = create_interaction_cov(ml2)
ml_user_item_matrix.shape, cov_ml.shape
"""
Explanation: Load training set and Create interaction matrix
End of explanation
"""
ml_user_item_matrix.head()
# find neighbors of user "1"
u = 1
nn = neighbors(cov_ml, ... |
cvxgrp/cvxpylayers | examples/torch/ReLU Layers.ipynb | apache-2.0 | from cvxpylayers.torch import CvxpyLayer
import torch
import cvxpy as cp
class ReluLayer(torch.nn.Module):
def __init__(self, D_in, D_out):
super(ReluLayer, self).__init__()
self.W = torch.nn.Parameter(1e-3*torch.randn(D_out, D_in))
self.b = torch.nn.Parameter(1e-3*torch.randn(D_out))
... |
ComputationalModeling/spring-2017-danielak | past-semesters/fall_2016/day-by-day/day08-modeling-viral-load-day1/Day_8_Pre_Class_Notebook.ipynb | agpl-3.0 | # Imports the functionality that we need to display YouTube videos in a Jupyter Notebook.
# You need to run this cell before you run ANY of the YouTube videos.
from IPython.display import YouTubeVideo
# WATCH THE VIDEO IN FULL-SCREEN MODE
YouTubeVideo("8_wSb927nH0",width=640,height=360) # Complex 'if' statements... |
cochoa0x1/integer-programming-with-python | 01-introduction/Linear Programming.ipynb | mit | #load all the things!
from pulp import *
"""
Explanation: Introduction
When life was easy
At some point in my calculus education I developed a simple rule, when in doubt set the derivative equal to zero and solve for x. You might recall doing this, and the reason for doing it is because for a smooth function its loca... |
DaveBackus/Data_Bootcamp | Code/IPython/bootcamp_practice_a_answerkey.ipynb | mit | # to make sure things are working, run this
import pandas as pd
print('Pandas version: ', pd.__version__)
"""
Explanation: Data Bootcamp: Code Practice A (answerkey)
Optional Code Practice A: Jupyter basics and Python's graphics tools (the Matplotlib package). The goals are to become familiar with Jupyter and Matp... |
econ-ark/HARK | examples/ConsumptionSaving/example_ConsMarkovModel.ipynb | apache-2.0 | # Define the Markov transition matrix for serially correlated unemployment
unemp_length = 5 # Averange length of unemployment spell
urate_good = 0.05 # Unemployment rate when economy is in good state
urate_bad = 0.12 # Unemployment rate when economy is in bad state
bust_prob = 0.01 # Probability of economy switchin... |
probml/pyprobml | notebooks/book1/13/bnn_hierarchical_numpyro.ipynb | mit | # http://num.pyro.ai/en/stable/getting_started.html#installation
!pip install numpyro[cuda111] -f https://storage.googleapis.com/jax-releases/jax_releases.html
import argparse
import os
import time
import matplotlib
import matplotlib.pyplot as plt
from jax import vmap, jit
import jax.numpy as jnp
from jax.random imp... |
mne-tools/mne-tools.github.io | 0.17/_downloads/d3fde1d7b973bb4cbb6d73fba6fd6e00/plot_cwt_sensor_connectivity.ipynb | bsd-3-clause | # Author: Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import numpy as np
import mne
from mne import io
from mne.connectivity import spectral_connectivity, seed_target_indices
from mne.datasets import sample
from mne.time_frequency import AverageTFR
print(__doc__)
"""
Explanation: Compute... |
payne92/notebooks | 30 Text to Speech.ipynb | mit | %%javascript
var msg = new SpeechSynthesisUtterance("I Python is fun!");
window.speechSynthesis.speak(msg);
"""
Explanation: Text-to-Speech
andy@payne.org
Updated: March 11, 2016
This notebook shows how to use Chrome's built-in text-to-speech engine. ... |
darkomen/TFG | medidas/06082015/.ipynb_checkpoints/Untitled-checkpoint.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
thundergolfer/Insults | insults/exploration/dataset/basic_features.ipynb | gpl-3.0 | from enchant.checker import SpellChecker
"""
Explanation: This dataset seems to offer a lot of easy wins around the 0-50 character range, but there's also a very long tail with comments ranging up to 17,803 characters in length (!).
Taking only those comments with length within 1 SD the max drops to ~630 characters, a... |
ecabreragranado/OpticaFisicaII | Trabajo Anillos de Newton/.ipynb_checkpoints/prueba-checkpoint.ipynb | gpl-3.0 | # MODIFICAR EL NOMBRE DEL FICHERO IMAGEN. LUEGO EJECUTAR
########################################################
nombre_fichero_imagen="IMG_20141121_122547.jpg" # Incluir el nombre completo con extensión del fichero imagen
# DESDE AQUÍ NO TOCAR
#####################################################... |
streety/biof509 | Wk08-machine-learning-workflow-in-class-complete.ipynb | mit | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
%matplotlib inline
"""
Explanation: Week 8 - The Machine Learning Workflow
End of explanation
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model, decomposition, datasets
from sklearn.metrics import accuracy_... |
darkomen/TFG | medidas/12082015/.ipynb_checkpoints/Análisis de datos Ensayo 2-checkpoint.ipynb | cc0-1.0 | #Importamos las librerías utilizadas
import numpy as np
import pandas as pd
import seaborn as sns
#Mostramos las versiones usadas de cada librerías
print ("Numpy v{}".format(np.__version__))
print ("Pandas v{}".format(pd.__version__))
print ("Seaborn v{}".format(sns.__version__))
#Abrimos el fichero csv con los datos... |
CrowdTruth/CrowdTruth-core | tutorial/notebooks/CrowdTruth vs. MACE vs. Majority Vote for Temporal Event Ordering.ipynb | apache-2.0 | # Read the input file into a pandas DataFrame
import pandas as pd
test_data = pd.read_csv("../data/temp.standardized.csv")
test_data.head()
"""
Explanation: CrowdTruth vs. MACE vs. Majority Vote for Temporal Event Ordering Annotation
This notebook contains a comparative analysis on the task of temporal event orderin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.