Jupyter - Hotkeys Flashcards
Esc
Esc will take you into command mode where you can navigate around your notebook with arrow keys.
A
A to insert a new cell above the current cell
B
B to insert a new cell below
M
M to change the current cell to Markdown
Y
Y to change it back to code
D + D
D + D (press the key twice) to delete the current cell
Enter
Enter will take you from command mode back into edit mode for the given cell.
Shift + Tab
Shift + Tab will show you the Docstring (documentation) for the the object you have just typed in a code cell - you can keep pressing this short cut to cycle through a few modes of documentation.
Ctrl + Shift + -
Ctrl + Shift + - will split the current cell into two from where your cursor is
Esc + F
Esc + F Find and replace on your code but not the outputs.
Esc + O Toggle cell output.
Toggle cell output.
Shift + Down
Shift + Up
Shift + J or Shift + Down selects the next sell in a downwards direction. You can also select sells in an upwards direction by using Shift + K or Shift + Up.
(Once cells are selected, you can then delete / copy / cut / paste / run them as a batch. This is helpful when you need to move parts of a notebook.)
Shift + M
You can also use Shift + M to merge multiple cells.
?[insert library, method, or variable here]
Don’t forget also that by prepending a library, method or variable with ?, you can access the Docstring for quick reference on syntax.
%run [insert .py or .ipynb file here]
%run can execute python code from .py files - this is well-documented behavior. Lesser known is the fact that it can also execute other jupyter notebooks, which can quite useful.