python

Jupyter Keyboard Shortcuts

Essential Jupyter notebook keyboard shortcuts and magic commands including cell execution, debugging with pdb, and HTML rendering.

A few Jupyter keyboard shortcuts and magic commands that help me stay productive.

  • To run a cell: Shift + enter or ctrl + enter.
  • Jupyter notebooks also offer tab completion.
  • You can get documentation within jupyter-notebook by hitting shift + tab three times, or by adding ? at the end of the function to get its docs.
  • M for markdown mode and Y for command mode.
  • %env prints environment variables.
  • %pdb activates the pdb debugger.
  • %pylab lets you work interactively with numpy and matplotlib.
  • %%debug activates debugging mode in a cell.
  • %%html renders a cell as HTML.
  • %%latex renders a cell as LaTeX.
  • %%sh runs a shell script.
  • %%time times how long a command takes to run.

These are my personal favorites for jupyter-notebook.