Jupyter Notebook Overview

Jupyter Notebook Overview

Jupyter Notebook Overview

What is Jupyter Notebook?

A client-server application that allows editing and running notebook documents via a web browser
Notebook Documents are documents, which can contain both computer code (e.g. python) and rich text elements (paragraph, equations, graphics, links, etc…).
The code can be executed in real time

What is Jupyter Notebook?

The name Jupyter is a loose acronym from:
Julia, Python, R
Jupyter Notebooks can be used with different programming languages, if you install the right kernel
list of available kernels
For Python2/3, the iPython kernel is pre-installed!

Output Formats

Jupyter notebooks document can be converted to a number of open standard output formats:
HTML, presentation slides, LaTeX, PDF, ReStructuredText, Markdown, Python.

On the Cloud

The major cloud providers have adopted the Jupyter Notebook
Google Colaboratory
Amazon SageMaker Notebooks
Microsoft Azure Notebook

Timeline

2011, December - first release
2014 - Project Jupyter founded
2015 - GitHub and the Jupyter Project announced native rendering of Jupyter notebooks (.ipynb files) on the GitHub platform.
2019,February - JupyterLab is Ready for Users - for daily use (installation, documentation, try it with Binder)

Start/stop the server

Start/stop the server

Start the server

Make sure you are in the folder, containing your project files
Activate the virtual environment

      cd /your/project/folder

      # activate the virtual environment:
      pipenv shell      

      # start the Jupyter server:
      jupyter notebook

      # in case of problems: start the Jupyter server with a clean config:
      jupyter notebook --generate-config
    
Jupyter Notebook will be opened automatically in your browser

Stop the server

Press CTRL+C on the Terminal running jupyterlab

        Shutdown this notebook server (y/[n])? y
      
Or if you're lazy to type 'y', then double press CTL+C
Or just exit that Terminal

Working with Notebooks

Live Demo
reference: Notebooks>Notebooks

Upload your Jupyter Notebook to GitHub

Upload your Jupyter Notebook to GitHub

There is nothing different than pushing any other file to your github account:
Add your changes to the stage
Commit those changes
Push the branch to your GitHub repo

        # add your changes to the stage:
        $ git add -A

        # commit those changes:
        $ git commit -m'__Describe your changes here__'

        # push the branch (assuming "master" below)to your GitHub repo:
        $ git push origin master
      

Share/Render your JupyterNotebooks (GitHub Render)

You can use github.com to host your .ipynb files for free
GitHub can render .ipynb files. For more details check github docs

Go to your github.com account and navigate to the notebook file you want to see/share.
when you click on it (the .ipynb extension) github will try to render the notebook in your browse
You can copy that URL and share it with anybody
Like that: DataFrameObject.ipynb

Share/Render your JupyterNotebooks (nbviewer)

The preferred way

nbviewer.jupyter.org is a Web Service to render .ipynb files
You can render there your .ipynb files, hosted on github, or GoogleDrive, Dropbox, ...
Like that: DataFrameObject.ipynb

Interact and share your Notebooks through Binder

Interact and share your Notebooks through Binder

Binder overview

binder - Turn a GitHub repo into a collection of interactive notebooks
Builds a docker images from a git repository
Uses JupyterHub - Multi-user server for Jupyter notebooks - to execute the notebook
Like that: Play with DataFrameObject.ipynb in binder
You have to be patient in order binder to build the Docker image and start the server...

Generating a shareable Binder link

To generate a link for your github repository/file, visit mybinder.org
Type in the information for your repository (repo name, branch,...).
You will see your Binder link automatically generated as you fill in the form
The link structure is:
https://mybinder.org/v2/<provider-name>/<org-name>
/<repo-name>/<branch|commit|tag>?
filepath=<path/to/notebook.ipynb>

Generating a shareable Binder link to a file - screenshot

Note, that the pathname is relative to your github repo folder

These slides are based on

customised version of

Hakimel's reveal.js

framework