All Projects → SamLau95 → Nbinteract

SamLau95 / Nbinteract

Licence: bsd-3-clause
Create interactive webpages from Jupyter Notebooks

Programming Languages

python3
1442 projects

Projects that are alternatives of or similar to Nbinteract

Fastdoc
Create publication-quality books from Jupyter notebooks
Stars: ✭ 134 (-29.1%)
Mutual labels:  jupyter-notebook, notebook
Ipyplot
IPyPlot is a small python package offering fast and efficient plotting of images inside Python Notebooks. It's using IPython with HTML for faster, richer and more interactive way of displaying big numbers of images.
Stars: ✭ 152 (-19.58%)
Mutual labels:  jupyter-notebook, notebook
Image classifier
CNN image classifier implemented in Keras Notebook 🖼️.
Stars: ✭ 139 (-26.46%)
Mutual labels:  jupyter-notebook, notebook
Prml
PRML algorithms implemented in Python
Stars: ✭ 10,206 (+5300%)
Mutual labels:  jupyter-notebook, notebook
Ipystata
Enables the use of Stata together with Python via Jupyter (IPython) notebooks.
Stars: ✭ 154 (-18.52%)
Mutual labels:  jupyter-notebook, notebook
Spark R Notebooks
R on Apache Spark (SparkR) tutorials for Big Data analysis and Machine Learning as IPython / Jupyter notebooks
Stars: ✭ 109 (-42.33%)
Mutual labels:  jupyter-notebook, notebook
Face generator
DCGAN face generator 🧑.
Stars: ✭ 146 (-22.75%)
Mutual labels:  jupyter-notebook, notebook
Starcraft2 Replay Analysis
A jupyter notebook that provides analysis for StarCraft 2 replays
Stars: ✭ 90 (-52.38%)
Mutual labels:  jupyter-notebook, notebook
Oreilly Intro To Predictive Clv
Repo that contains the supporting material for O'Reilly Webinar "An Intro to Predictive Modeling for Customer Lifetime Value" on Feb 28, 2017
Stars: ✭ 153 (-19.05%)
Mutual labels:  jupyter-notebook, notebook
Python Clustering Exercises
Jupyter Notebook exercises for k-means clustering with Python 3 and scikit-learn
Stars: ✭ 153 (-19.05%)
Mutual labels:  jupyter-notebook, notebook
Spark Py Notebooks
Apache Spark & Python (pySpark) tutorials for Big Data Analysis and Machine Learning as IPython / Jupyter notebooks
Stars: ✭ 1,338 (+607.94%)
Mutual labels:  jupyter-notebook, notebook
Signals And Systems Lecture
Continuous- and Discrete-Time Signals and Systems - Theory and Computational Examples
Stars: ✭ 166 (-12.17%)
Mutual labels:  jupyter-notebook, notebook
Python Thenotheoryguide
Jupyter NoteBooks to get you boosted with the basics of python with hands-on-practice.
Stars: ✭ 95 (-49.74%)
Mutual labels:  jupyter-notebook, notebook
Ipyexperiments
jupyter/ipython experiment containers for GPU and general RAM re-use
Stars: ✭ 128 (-32.28%)
Mutual labels:  jupyter-notebook, notebook
Satellite imagery python
Sample sample scripts and notebooks on processing satellite imagery
Stars: ✭ 93 (-50.79%)
Mutual labels:  jupyter-notebook, notebook
Practical Machine Learning With Python
Master the essential skills needed to recognize and solve complex real-world problems with Machine Learning and Deep Learning by leveraging the highly popular Python Machine Learning Eco-system.
Stars: ✭ 1,868 (+888.36%)
Mutual labels:  jupyter-notebook, notebook
Nbconflux
nbconflux converts Jupyter Notebooks to Atlassian Confluence pages
Stars: ✭ 82 (-56.61%)
Mutual labels:  jupyter-notebook, notebook
Jupytemplate
Templates for jupyter notebooks
Stars: ✭ 85 (-55.03%)
Mutual labels:  jupyter-notebook, notebook
Simfin Tutorials
Tutorials for SimFin - Simple financial data for Python
Stars: ✭ 150 (-20.63%)
Mutual labels:  jupyter-notebook, notebook
Image keras
Building an image classifier using keras
Stars: ✭ 162 (-14.29%)
Mutual labels:  jupyter-notebook, notebook

nbinteract

Read the Docs Gitter

Build Status PyPI npm

nbinteract is a Python package that creates interactive webpages from Jupyter notebooks. nbinteract also has built-in support for interactive plotting. These interactions are driven by data, not callbacks, allowing authors to focus on the logic of their programs.

nbinteract is most useful for:

  • Data scientists that want to create simple interactive blog posts without having to know / work with Javascript.
  • Instructors that want to include interactive examples in their textbooks.
  • Students that want to publish data analysis that contains interactive demos.

Currently, nbinteract is in an alpha stage because of its quickly-changing API.

Examples

Most plotting functions from other libraries (e.g. matplotlib) take data as input. nbinteract's plotting functions take functions as input.

import numpy as np
import nbinteract as nbi

def normal(mean, sd):
    '''Returns 1000 points drawn at random fron N(mean, sd)'''
    return np.random.normal(mean, sd, 1000)

# Pass in the `normal` function and let user change mean and sd.
# Whenever the user interacts with the sliders, the `normal` function
# is called and the returned data are plotted.
nbi.hist(normal, mean=(0, 10), sd=(0, 2.0), options=options)

example1

Simulations are easy to create using nbinteract. In this simulation, we roll a die and plot the running average of the rolls. We can see that with more rolls, the average gets closer to the expected value: 3.5.

rolls = np.random.choice([1, 2, 3, 4, 5, 6], size=300)
averages = np.cumsum(rolls) / np.arange(1, 301)

def x_vals(num_rolls):
    return range(num_rolls)

# The function to generate y-values gets called with the
# x-values as its first argument.
def y_vals(xs):
    return averages[:len(xs)]

nbi.line(x_vals, y_vals, num_rolls=(1, 300))

example2

Publishing

From a notebook cell:

# Run in a notebook cell to convert the notebook into a publishable HTML page:
#
# nbi.publish('my_binder_spec', 'my_notebook.ipynb')
#
# Replace my_binder_spec with a Binder spec in the format
# {username}/{repo}/{branch} (e.g. SamLau95/nbinteract-image/master).
#
# Replace my_notebook.ipynb with the name of the notebook file to convert.
#
# Example:
nbi.publish('SamLau95/nbinteract-image/master', 'homepage.ipynb')

From the command line:

# Run on the command line to convert the notebook into a publishable HTML page.
#
# nbinteract my_binder_spec my_notebook.ipynb
#
# Replace my_binder_spec with a Binder spec in the format
# {username}/{repo}/{branch} (e.g. SamLau95/nbinteract-image/master).
#
# Replace my_notebook.ipynb with the name of the notebook file to convert.
#
# Example:
nbinteract SamLau95/nbinteract-image/master homepage.ipynb

For more information on publishing, see the tutorial which has a complete walkthrough on publishing a notebook to the web.

Installation

Using pip:

pip install nbinteract

# The next two lines can be skipped for notebook version 5.3 and above
jupyter nbextension enable --py --sys-prefix widgetsnbextension
jupyter nbextension enable --py --sys-prefix bqplot

You may now import the nbinteract package in Python code and use the nbinteract CLI command to convert notebooks to HTML pages.

Tutorial and Documentation

Here's a link to the tutorial and docs for this project.

Developer Install

If you are interested in developing this project locally, run the following:

git clone https://github.com/SamLau95/nbinteract
cd nbinteract

# Installs the nbconvert exporter
pip install -e .

# To export a notebook to interactive HTML format:
jupyter nbconvert --to interact notebooks/Test.ipynb

pip install -U ipywidgets
jupyter nbextension enable --py --sys-prefix widgetsnbextension

brew install yarn
yarn install

# Start notebook and webpack servers
make -j2 serve

Feedback

If you have any questions or comments, send us a message on the Gitter channel. We appreciate your feedback!

Contributors

nbinteract is originally developed by Sam Lau and Caleb Siu as part of a Masters project at UC Berkeley. The code lives under a BSD 3 license and we welcome contributions and pull requests from the community.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].