[PYTHON] Jupyter Notebook basic operations and shortcut keys

Explains the basic operation method and available shortcut keys for notebooks created with Jupyter Notebook.

Switch between command mode and edit mode

The cells displayed in the notebook have two modes: command mode and edit mode.

Command mode is the mode used to perform operations on cells such as adding and deleting cells using shortcut keys. If you see a blue line on the left side of the cell, you are in command mode. image.png

Edit mode is the mode used to enter a program in a cell. If you see a green line on the left side of the cell, you are in edit mode. image.png

Use the following shortcut keys to switch between command mode and edit mode.

Enter: Switch from command mode to edit mode Esc: Switch from edit mode to command mode

When switching using the mouse, click the text box to enter edit mode, and click the left part of the text box to enter command mode.

Add a cell

To add a cell, press the shortcut key in command mode as follows.

A: Add a cell above the current cell B: Add cell below current cell

If you press the B key from the following state, the cell will be added immediately below and the cell will move to the cell where the focus has been added. image.png image.png

If you press the A key from the following state, the cell will be added immediately above and the cell will move to the cell where the focus has been added. image.png image.png

To add a cell from the menu, click the "Insert" menu. Click "Insert Cell Above" from the displayed menu to add a cell just above the current cell, and click "Insert Cell Below" to add a cell just below the current cell. image.png

Delete cell

To delete a cell, press the shortcut key in command mode as follows. Press the D key twice in a row.

D D: Delete the current cell

If you press the D D key from the following states, the current cell will be deleted. image.png image.png

To delete a cell from the menu, click the "Edit" menu and then click "Delete Cells" from the displayed menu. image.png

Recommended Posts

Jupyter Notebook basic operations and shortcut keys
Shortcut key for Jupyter notebook
Try basic operations for Pandas DataFrame on Jupyter Notebook
[Complete version] Jupyter Notebook shortcut
Jupyter Notebook: 4 banal tips and tricks
Use markdown with jupyter notebook (with shortcut)
Use Jupyter Lab and Jupyter Notebook with EC2
Linking python and JavaScript with jupyter notebook
How to use Jupyter notebook [Super Basic]
Install matplotlib and display graph on Jupyter Notebook
Jupyter Notebook memo
Mutual conversion between Qiita articles and Jupyter notebook
Introducing Jupyter Notebook
Powerful Jupyter Notebook
[Python / Chrome] Basic settings and operations for scraping
Jupyter notebook password
Jupyter Notebook memo
(Bottom) Cooperation between Jupyter Notebook and running Excel
Easily launch jupyter notebook on AWS and access locally
Automatically save .py and .html files in Jupyter notebook.
[Windows] [Python3] Install python3 and Jupyter Notebook (formerly ipython notebook) on Windows
Make Jupyter Notebook your own: Change background and icons
3 Jupyter notebook (Python) tricks
Jupyter cell move shortcut
[Cloud103] # 3 Jupyter Notebook again