Jupyter Shortcuts Cheat Sheet



  1. Jupyter Notebook Hyperlink
  2. Jupiter Keyboard Shortcut Cheat Sheet

When using ipython, use%quickref for quick access to a built-in cheat sheet. Here is an opinionated cheat sheet of some of ipython's features, in order of usefulness. Most of those work in the jupyter notebook as well! Tab completion and syntax highlighting. Use tab for tab completion. Conda user cheat sheet For full documentation of any command, type the command followed by -help. Conda create -help TIP: Many options after two dashes (-) have shortcuts. Conda create -help or conda create -h Take a conda test drive at bit.ly/tryconda conda env export puppies.yml conda env create -f puppies.yml. Jupyter Notebook Cheat Sheet This Jupyter Notebook cheat sheet will help you to find your way around the well-known Notebook App, a subproject of Project Jupyter. You'll probably know the Jupyter notebooks pretty well - it's one of the most well-known parts of the Jupyter ecosystem!

Jupyter notebook markdown cheat sheet
  • Command CheatSheet

Command CheatSheet

h(elp)

Without argument, print the list of available commands. With a command name as argument, print help about that command.

w(here)

Print a stack trace, with the most recent frame at the bottom. An arrow indicates the “current frame”, which determines the context of most commands.

d(own)

Move the current frame one level down in the stack trace (to a newer frame).

u(p)

Move the current frame one level up in the stack trace (to an older frame).

b(reak): [ ([filename:]lineno | function) [, condition] ]

With a filename:line number argument, set a break there. If filename is omitted, use the current file. With a function name, set a break at the first executable line of that function. Without argument, list all breaks. Each breakpoint is assigned a number to which all the other breakpoint commands refer.

The condition argument, if present, is a string which must evaluate to true in order for the breakpoint to be honored.

tbreak: [ ([filename:]lineno | function) [, condition] ]

Temporary breakpoint, which is removed automatically when it is first hit. The arguments are the same as break.

cl(ear): [bpnumber [bpnumber ...] ]

With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation).

disable bpnumber: [bpnumber ...]

Jupyter

Disables the breakpoints given as a space separated list of breakpoint numbers. Disabling a breakpoint means it cannot cause the program to stop execution, but unlike clearing a breakpoint, it remains in the list of breakpoints and can be (re-)enabled.

enable bpnumber: [bpnumber ...]

Enables the breakpoints specified.

ignore bpnumber count

Sets the ignore count for the given breakpoint number. If count is omitted, the ignore count is set to 0. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakpoint is reached and the breakpoint is not disabled and any associated condition evaluates to true.

condition bpnumber condition

Jupiter Keyboard Shortcut Cheat Sheet

condition is an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional.

s(tep)

Execute the current line, stop at the first possible occasion (either in a function that is called or in the current function).

n(ext)

Continue execution until the next line in the current function is reached or it returns.

unt(il)

Continue execution until the line with a number greater than the current one is reached or until the current frame returns.

Cheat

r(eturn)

Continue execution until the current function returns.

run [args ...]

Restart the debugged python program. If a string is supplied it is splitted with “shlex”, and the result is used as the new sys.argv. History, breakpoints, actions and debugger options are preserved. “restart” is an alias for “run”.

c(ont(inue))

Continue execution, only stop when a breakpoint is encountered.

l(ist): [first [,last]]

List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With one argument, list 11 lines starting at that line. With two arguments, list the given range; if the second argument is less than the first, it is a count.

a(rgs)

Print the argument list of the current function.

p expression

Print the value of the expression.

A complete overview of the current JupyterLab keyboard shortcuts:

Jupyter

(click on the picture to view it in full size or download the PDF below)

Notes: The key combinations generally have to be be pressed simultaneously, but a - between one or more keys means that it is a sequence (press them one after another). The Accelerator key is usually mapped to Ctrl.

It is generated directly from the config file, so all combinations are included. Since JupyterLab is still under development some could not yet work. I only changed the order a bit, put related groups close to each other and to make it fit better on the page.You can also download it as PDF here.

The generator is implemented in Node.js, it is also on my Github as jupyter-shortcuts. You can simply clone it, run yarn install and then start it with yarn start-default to use the supplied default config file or yarn start your/changed/config.json to generate it from custom shortcuts. It provides a small http server with the generated page.

The json data can be obtained/edited in JupyterLab through: Settings > Advanced Settings Editor > Keyboard Shortcuts. There is currently (version 0.35.4 as time of writing) no builtin visual settings editor, this might change in the next versions with the shortcutui extension.

Update 2020: I have updated the generator to the new 2.0 config format, here is a current default output: