liminfo

Jupyter Reference

Free reference guide: Jupyter Reference

32 results

About Jupyter Reference

The Jupyter Reference is a comprehensive cheat sheet covering every major aspect of Jupyter Notebook and JupyterLab: line and cell magic commands (%time, %%time, %timeit, %matplotlib inline, %run, %load, %%writefile, %who, %env), kernel operations (restart, interrupt, kernel change, !pip install, shell commands), interactive widgets (ipywidgets.interact, IntSlider, Dropdown, Output), extension management (jupyter labextension, nbconvert, jupytext), server configuration (jupyter_notebook_config.py, port, token), and essential keyboard shortcuts (Shift+Enter, Ctrl+Enter, A/B/D/M/Y). All entries include real code examples you can copy and use immediately.

This reference is built for data scientists, machine learning engineers, research scientists, and Python developers who use Jupyter as their primary interactive computing environment. Whether you are running exploratory data analysis in pandas and matplotlib, prototyping deep learning models in PyTorch or TensorFlow, or teaching a Python workshop, this guide keeps every command and shortcut at your fingertips without leaving your browser tab.

The reference is organized into six categories — Magic Commands, Kernel, Widgets, Extensions, Configuration, and Shortcuts — so you can instantly navigate to the section that matches your current task. Each entry shows the exact syntax alongside a working example, making it easy to understand not just what a command does but how to use it in context.

Key Features

  • Full coverage of line magic (%time, %timeit, %run, %load, %who, %env) and cell magic (%%time, %%writefile) commands
  • Kernel management reference: restart, interrupt, kernel switching, and running pip/shell commands from cells
  • ipywidgets reference including interact decorator, IntSlider, Dropdown, and Output capture widget with examples
  • Extension management: jupyter labextension, nbextension, nbconvert HTML/PDF export, and jupytext format conversion
  • Server configuration snippets for jupyter_notebook_config.py: port, token, browser, and headless remote access
  • All essential keyboard shortcuts for edit mode and command mode — cell execution, insertion, deletion, and type switching
  • Instant search and category filter so you can find any command or shortcut within seconds
  • Dark mode support, mobile-responsive layout, and completely free with no login required

Frequently Asked Questions

What is the difference between %time and %%time magic commands?

%time measures the execution time of a single Python statement on one line. %%time is a cell magic that measures the total execution time of all the code in a cell. Use %timeit for a more statistically reliable average over multiple runs.

How do I display matplotlib plots inline in Jupyter?

Run %matplotlib inline at the top of your notebook (or in any cell before plotting). This magic command tells Jupyter to render matplotlib figures directly below the code cell instead of opening a separate window. You only need to run it once per session.

How do I run a shell command from a Jupyter cell?

Prefix any shell command with an exclamation mark: !ls -la, !pwd, !pip install pandas. The output is displayed inline below the cell. For complex shell scripts, use the %%bash cell magic to run an entire cell as a bash script.

What is the difference between Jupyter Notebook and JupyterLab?

Jupyter Notebook is the classic single-document interface, while JupyterLab is the next-generation IDE-like environment that supports multiple tabs, file browser, terminal, and extension system. Both share the same .ipynb file format and support the same magic commands and kernels.

How do I convert a Jupyter notebook to HTML or PDF?

Use the nbconvert command-line tool: `jupyter nbconvert --to html notebook.ipynb` for HTML or `jupyter nbconvert --to pdf notebook.ipynb` for PDF (requires LaTeX). You can also use jupytext to convert notebooks to plain Python scripts and back.

How do I create interactive widgets in Jupyter?

Install ipywidgets and use the @interact decorator for the simplest case, or manually create widgets like IntSlider, Dropdown, and Output from ipywidgets. Widgets let you build interactive controls that update output in real time without writing JavaScript.

How do I run Jupyter Lab on a remote server without opening a browser?

Start JupyterLab with the --no-browser flag: `jupyter lab --no-browser --port=8888 --ip=0.0.0.0`. Then set a token or password in jupyter_notebook_config.py. Connect from your local machine by forwarding the port via SSH: `ssh -L 8888:localhost:8888 user@server`.

What are the most important Jupyter keyboard shortcuts?

The most essential shortcuts are: Shift+Enter (run cell and move to next), Ctrl+Enter (run cell in place), Esc (enter command mode), Enter (enter edit mode), A/B (insert cell above/below), D D (delete cell), M (convert to Markdown), and Y (convert to code cell). Press H in command mode to see the full shortcut list.