Skip to content
Tutorials Center
My learning

Topics

Jupyter and Notebooks Tutorial

Learn Jupyter and Notebooks step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Jupyter? Learn what Jupyter is, how notebooks mix code, text and results, what the Jupyter project includes, and when a notebook is the right tool for your work.
  2. 2 Installing and Launching Jupyter Install Jupyter Notebook and JupyterLab with pip in a virtual environment, or with conda, then start the server, open the browser and stop it safely.
  3. 3 The Notebook Interface A guided tour of the Jupyter interface: the file browser, notebook toolbar, menus, cell types, kernel status indicator, and the operations you use to arrange cells.
  4. 4 Writing and Running Your First Notebook Create your first Jupyter notebook step by step: run code cells, see the last expression displayed, write Markdown, save the file and share a clean result.
  5. 5 Modes and Keyboard Shortcuts Learn Jupyter's two modes, command and edit, the most useful keyboard shortcuts for cells and editing, the command palette, and how to customize shortcuts.

Notebooks and Kernels

  1. 6 Kernels Explained Understand the Jupyter kernel: the separate process that runs your code, how the front end talks to it with messages, what lives in kernel memory, and kernel lifecycle.
  2. 7 Execution Order and Hidden State Learn why Jupyter notebooks can give different results depending on the order cells ran, how hidden state arises, and the habits that keep notebooks reliable.
  3. 8 The .ipynb File Format Open a Jupyter notebook file and read it: the nbformat 4 JSON structure, cell types, output types, metadata, cell ids, and how to inspect or clean a notebook with Python.
  4. 9 Choosing and Managing Kernels Register a virtual environment as a Jupyter kernel with ipykernel, list and remove kernelspecs, read kernel.json, and add kernels for R, Julia, Bash and JavaScript.
  5. 10 Restart, Interrupt and Debug Handle stuck cells and dead kernels in Jupyter: interrupt versus restart, reading tracebacks, post-mortem debugging with %debug, the visual debugger, and freeing memory.

Cells and Magics

  1. 11 Cell Types and Markdown Write documentation in Jupyter Markdown cells: headings, emphasis, lists, tables, code blocks, links, images, LaTeX math with MathJax, HTML, and raw cells explained.
  2. 12 Line and Cell Magics Learn IPython magic commands in Jupyter: line magics with %, cell magics with %%, the most useful built-ins, help with ? and ??, and how to write your own magic.
  3. 13 Rich Output and display() Show more than plain text in Jupyter: display(), IPython.display classes for HTML, Markdown, images and math, custom _repr_html_ methods, MIME bundles and live updates.
  4. 14 Timing and Profiling Code Measure and speed up code in notebooks: %time versus %timeit, how timeit repeats runs, profiling with %prun and cProfile, line profiling and memory tools, plus honest benchmarking habits.
  5. 15 Shell Commands and the System Run terminal commands inside a notebook with ! and %%bash, capture their output into Python lists, pass variables, install packages safely with %pip, and avoid common shell pitfalls.

Widgets and Visualization

  1. 16 Plots in Notebooks Draw charts inside Jupyter notebooks with Matplotlib: inline and interactive backends, the figure and axes objects, multiple plots, sizing, saving figures and common mistakes.
  2. 17 Interactive Widgets with ipywidgets Build interactive controls in Jupyter with ipywidgets: interact and sliders, widget values, observe callbacks, buttons, layout boxes, output areas and how widget state syncs with the kernel.
  3. 18 Tables and DataFrame Display Show tables well in Jupyter notebooks: how pandas renders DataFrames as HTML, display options, previewing big data safely, styling with Styler, and exporting tables.
  4. 19 Interactive Charts and Progress Bars Go beyond static plots in Jupyter with Plotly, Altair and Bokeh, learn how chart specifications travel to the browser, and show progress for long loops with tqdm.

Reproducibility

  1. 20 Reproducible Environments for Notebooks Give every notebook project its own virtual environment and register it as a kernel, so imports, versions and results stay the same on every machine and every day.
  2. 21 Pinning Dependencies and Requirement Files Record exact package versions with requirements.txt, constraints, lock files and environment.yml so a notebook can be rebuilt years later with the same results.
  3. 22 Hidden State and Restart and Run All Understand why notebooks silently depend on cell execution order, how hidden state breaks reproducibility, and how Restart and Run All plus a few habits fix it.
  4. 23 Seeds and Deterministic Results Control randomness with seeds, NumPy generators and library settings so shuffles, samples, simulations and model training give the same answers on every run.

JupyterLab and Extensions

  1. 24 The JupyterLab Interface Tour the JupyterLab workspace: launcher, file browser, tabs and split views, command palette, console, terminal, text editor, shortcuts, settings and workspaces.
  2. 25 JupyterLab Extensions and Customization Install and manage JupyterLab extensions with pip, learn prebuilt versus source extensions, useful ones such as the LSP and Git tools, and how an extension is structured.

Collaboration and Deployment

  1. 26 Version Control for Notebooks Why .ipynb files make noisy Git diffs, and how to fix it: strip outputs with nbstripout, review changes with nbdime, pair notebooks with scripts using Jupytext.
  2. 27 Exporting Notebooks with nbconvert Convert notebooks to HTML, PDF, Markdown, slides and Python scripts with jupyter nbconvert, execute them headlessly, hide code or inputs, and use templates in automated builds.
  3. 28 Parameterized Notebook Runs with Papermill Turn one notebook into a reusable report: tag a parameters cell, run it with Papermill for different dates or regions, collect outputs, and schedule the runs.
  4. 29 Sharing with JupyterHub, Binder and Cloud Notebooks Compare ways to share notebooks: static HTML, Binder, JupyterHub for teams and classes, and hosted notebooks. Learn architecture, repo2docker files and security trade-offs.
  5. 30 Voila, Dashboards and Notebook Apps Serve a notebook as a standalone web app with Voila: hide code, add ipywidgets controls, deploy to a server, and compare it with Streamlit, Panel and Dash.

Best Practices

  1. 31 Structuring a Notebook Organize notebooks so others can read and rerun them: a clear title and purpose, setup cell, headings, small focused cells, narrative Markdown and a closing summary.
  2. 32 Moving Code from Notebooks into Modules Turn repeated notebook code into functions and importable .py modules: when to extract, project layout, autoreload, editable installs and keeping notebooks thin.
  3. 33 Testing Notebook Code Test notebooks at three levels: pytest for extracted functions, asserts inside cells, and whole-notebook execution with nbmake or nbconvert. Includes CI and data checks.
  4. 34 Performance and Memory in Notebooks Find slow cells and memory hogs: time with %timeit, profile with cProfile, measure memory, free big variables, use efficient types, chunk files and cache expensive results.
  5. 35 Notebook Security and Secrets Keep notebooks safe: never store secrets in cells or outputs, use environment variables, understand trusted notebooks, secure the server with tokens and HTTPS, and scan for leaks.

Projects and Practice

  1. 36 Project: A Notebook Linter Build a small linter that reads .ipynb JSON and reports hidden state, missing titles, leaked secrets, long cells and uncleared outputs, then wire it into pre-commit and CI.
  2. 37 Project: A Parameterized Sales Report Pipeline Build an automated monthly sales report: tested functions in a module, a thin parameterized notebook, executed per region, exported to HTML, with checks and a summary file.
  3. 38 Project: A Reproducible Experiment Tracker Build a lightweight experiment log for notebook work: record parameters, seed, versions, data fingerprint and metrics per run, compare runs and reproduce the best one.
  4. 39 Practice Questions and Challenges Test what you learned about reproducible notebooks, JupyterLab, sharing, testing and security with a quiz, short exercises, a runnable checker and review prompts.