Jupyter#
Jupyter aims to provide tools for interactive programming across multiple languages, including the three core languages Julia, Python and R, from which the name is derived. Besides the core languages, there is a long list of other kernels that are available (including Matlab, Fortran, Java)
The Jupyter environment#
Jupyter Notebook (original, basic interface)
JupyterLab (newer, more advanced interface)
JupyterHub (multi-user collaboration)
Other notable projects that rely on Jupyter are Jupyter Books (to create beautiful, publication-quality books), SoS (for using multiple different kernels in one document)
Why use Jupyter?#
Combine Code, Text, Equations and Visualisations
Jupyter notebooks can be broken up into Code and Markdown blocks. Markdown blocks blocks can include Latex Equations (put between
$signs, like$TS=10log_{10} (\sigma_{bs})$renders as \(TS=10log_{10} (\sigma_{bs})\)). Additionally Markdown blocks can include images, list, tables etc…
This makes notebooks useful to:Write code documentation (but Notebooks are no replacement for comments or docstrings!)
Generate sclear and transparent reports
Explain scientific work with equations
Data Visualisation and Exploration Jupyter allows the generation of inine plots, integrating well with most standard plotting libraries, including Matplotlib, Seaborn, Plotly, Holoviews, and others. Jupyter also supports the integration of Dash or Bokeh widgets to add even more interactivity.
Easy Sharing & Collaboration Jupyter notebooks, use the
ipynbending which can be converted to HTML, PDF, Markdown, Python, LaTeX, executable Python script, asciidoc or as Slides. Notebooks can directly be shared through GitHub, Google Colab or Binder and JupyterHub can be used for multi-user collaboration.
What are differences between Jupyter and JupyterLab?#
Feature |
Jupyter Notebook |
JupyterLab |
|---|---|---|
Interface |
Basic |
Modern, IDE-like |
Multiple Tabs |
No |
Yes |
File Management |
Simple |
Advanced (drag-drop, side panels) |
Customization |
Limited |
Extensive |
Extensibility |
Few extensions |
Many extensions |
Basically JupyterLab is the new, more extensive, powerful and fancy sibbling of Jupyter Notebook. In most cases it makes sense to use JupyterLab.
Installing Jupyter#
The easiest way to get started with the Jupyter environment is to install the full Jupyter package with:
mamba install -c conda-forge jupyter
This will include:
Package |
Description |
|---|---|
Jupyter Notebook (notebook) |
The classic Jupyter Notebook interface |
JupyterLab (jupyterlab) |
The modern, more powerful Jupyter interface |
IPython (ipython) |
Interactive Python shell used by Jupyter |
Jupyter Client (jupyter_client) |
Manages communication between the notebook and kernel |
Jupyter Core (jupyter_core) |
Core functionalities for Jupyter |
Nbconvert (nbconvert) |
Converts notebooks to formats like HTML, PDF, Markdown |
Nbformat (nbformat) |
Handles notebook file formats (.ipynb) |
Jupyter Console (jupyter_console) |
Command-line interface for Jupyter kernels |
QtConsole (qtconsole) Jupyter interface with a Qt-based GUI (optional) |
If you only want to use Jupyer Notebook use:
mamba install -c conda-forge notebook
or if you only want JupyterLab:
mamba install -c conda-forge jupyterlab
To run Jupyter notebook, open a Terminal window and browse to the folder within which you want to work. Now run:
jupyter notebook
This will open a browser window with the files in the selected folder.
Notebook Basics#
The first step will be to create a new Notebook:

Now you are ready to write code and Markdown content!

Mode Switching#
Jupyter has two modes:
Command Mode (Press
Esc) → Used for navigating and managing cells.Edit Mode (Press
Enter) → Used for typing inside a cell.
Action |
Shortcut Key |
Description |
|---|---|---|
Switch to Command Mode |
|
Exit Edit Mode to navigate cells |
Switch to Edit Mode |
|
Enter Edit Mode to modify a cell |
Cell Operations#
Command Mode - Press Esc First
Action |
Shortcut Key |
Description |
|---|---|---|
Run Cell & Stay |
|
Runs the cell & moves to the next one |
Run Cell & Insert Below |
|
Runs the cell & inserts a new one below |
Run Cell & Select Above |
|
Runs the cell but does not move |
Insert New Cell Below |
|
Adds a new cell below the current one |
Insert New Cell Above |
|
Adds a new cell above the current one |
Delete a Cell |
|
Deletes the selected cell |
Undo Delete |
|
Restores the last deleted cell |
Copy Cell |
|
Copies the current cell |
Cut Cell |
|
Cuts the current cell |
Paste Cell Below |
|
Pastes the copied/cut cell below |
Paste Cell Above |
|
Pastes the copied/cut cell above |
Move Cell Up |
|
Moves the selected cell up |
Move Cell Down |
|
Moves the selected cell down |
Change Cell to Code |
|
Converts the cell to a code cell |
Change Cell to Markdown |
|
Converts the cell to Markdown mode |
Merge with Cell Below |
|
Merges the selected cell with the one below |
Text Editing Shortcuts#
Edit Mode - Press Enter First
Action |
Shortcut Key |
Description |
|---|---|---|
Autocomplete Code |
|
Auto-suggests methods/variables |
Show Documentation |
|
Shows docstring/help for a function |
Comment/Uncomment Line |
|
Toggles comments for selected lines |
Indent Code |
|
Indents selected code |
Unindent Code |
|
Unindents selected code |
Kernel & Execution#
Action |
Shortcut Key |
Description |
|---|---|---|
Interrupt Kernel |
|
Stops the current execution |
Restart Kernel |
|
Restarts the notebook kernel |
Restart & Run All Cells |
|
Restarts kernel & runs all cells |
How to See All Shortcuts in Jupyter Notebook?#
Press:
Ctrl + Shift + H(in Command Mode) → Opens a help window with all shortcutsCtrl + Shift + P→ Opens the command palette for searching commands
Tip
You can customize shortcuts in Help > Edit Keyboard Shortcuts.
Basic Markdown Skills#
Category |
Syntax |
Example |
Rendered Output |
|---|---|---|---|
Headings |
|
|
This is a subheading |
Bold Text |
|
|
Important |
Italic Text |
|
|
Emphasized |
Bold + Italic |
|
|
Very important! |
Strikethrough |
|
|
~~wrong text~~ |
Lists |
|
|
- Apple |
Ordered List |
|
|
1. Start |
Inline Code |
|
|
|
Code Block |
```python |
|
Python code block |
Blockquote |
|
|
> Jupyter is great! |
Horizontal Line |
|
|
— |
Hyperlink |
|
|
|
Image |
|
|
|
LaTeX Math |
|
|
(E=mc^2) |
—- |
25 |
||
Task List |
|
|
☐ To do |
Tables:
|Name |Language |Age |
|---------|---------|-----|
|Kim |Python |42 |
|Sascha |R |24 |
will render as:
Name |
Language |
Age |
|---|---|---|
Kim |
Python |
42 |
Sascha |
R |
24 |