Learn Jupyter

Interactive notebooks for code, results and narrative in one document

14 lessons · 3 hours · 4 levels · covers Jupyter JupyterLab 4.6

Jupyter is the open-source platform behind notebooks: documents that mix live code, its output (tables, charts, widgets) and Markdown text. JupyterLab and Jupyter Notebook are the browser interfaces, kernels run the code (Python via IPython, and dozens of other languages), and tools like nbconvert and papermill turn notebooks into reports and pipelines. It is the default workspace for data analysis, teaching and research.

Before you start

Jupyter builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics4 lessons · 36 min in total
2. PracticalUse it productively at work, with the usual idioms8 lessons · 1 hour in total
3. AdvancedThe less common features, performance and trade-offs11 lessons · 2 hours in total
4. ExpertInternals and the edge cases experts know14 lessons · 3 hours in total

The Jupyter tree

JupyterNotebooks, cells and execution orderNotebooks, cells andexecution orderInstalling and launching JupyterLabInstalling andlaunching JupyterLabMarkdown and rich outputMarkdown and richoutputCommand mode, edit mode and shortcutsCommand mode, editmode and shortcutsKernels and environmentsKernels andenvironmentsIPython magics and shell commandsIPython magics andshell commandsInteractive widgets with ipywidgetsInteractive widgetswith ipywidgetsWorking effectively in JupyterLabWorking effectivelyin JupyterLabRunning Python: REPL and scriptsRunning Python:REPL and scriptsModules and importsModules and importsDefining functionsDefining functionsSpecial methods and protocolsSpecial methods andprotocolsDictionariesDictionaries
Essentials and Practical shown (8 of 14 lessons); the full list is below. Click a lesson to read it.

All 14 lessons, in order

Notebook basics

  1. Notebooks, cells and execution order · Essentials · 10 min

    A notebook is a list of code and Markdown cells run by a kernel; outputs depend on the order you ran cells, not their position.

  2. Installing and launching JupyterLab · Essentials · 8 min

    Install JupyterLab or Notebook into an environment, start the server, and understand what runs where.

  3. Command mode, edit mode and shortcuts · Essentials · 8 min

    Move between edit and command mode and use the core keyboard shortcuts to work quickly in notebooks.

Rich output and widgets

  1. Markdown and rich output · Essentials · 10 min

    Write formatted Markdown cells with math, and display tables, images, HTML and charts inline from code.

  2. Interactive widgets with ipywidgets · Practical · 14 min

    Add sliders, dropdowns and buttons to notebooks with interact and ipywidgets, and react to changes with observe.

  3. The rich display protocol · Advanced · 12 min

    Make your own objects render nicely in notebooks with _repr_html_ and _repr_mimebundle_, and update outputs in place with display IDs.

Kernels and IPython

  1. Kernels and environments · Practical · 12 min

    Understand what a kernel is, restart and interrupt it, and register virtual environments or other languages as kernels.

  2. IPython magics and shell commands · Practical · 12 min

    Use line and cell magics such as %timeit, %%time, %run, %pip and %autoreload, plus ! shell commands, from a notebook.

Workflow and reproducibility

  1. Working effectively in JupyterLab · Practical · 10 min

    Use JupyterLab's file browser, side-by-side views, consoles, terminals, debugger, table of contents and extensions.

  2. Exporting and executing notebooks · Advanced · 14 min

    Convert notebooks to HTML, PDF or scripts with nbconvert, and run them headless with parameters using papermill.

  3. Reproducible notebooks and version control · Advanced · 14 min

    Avoid hidden state, pin environments, strip outputs, pair notebooks with scripts via Jupytext, and diff them with nbdime.

Formats, protocol and deployment

  1. The .ipynb format and nbformat · Expert · 14 min

    Read, create, validate and execute notebooks programmatically using the nbformat JSON schema and nbclient.

  2. Kernel architecture and the messaging protocol · Expert · 16 min

    See how front ends talk to kernels over ZeroMQ channels with the Jupyter messaging protocol, and drive a kernel from Python with jupyter_client.

  3. Server security and multi-user deployment · Expert · 14 min

    Run Jupyter safely on remote machines with tokens, passwords, TLS and SSH tunnels, and serve teams with JupyterHub.