Introduction to Python Data Analysis (2): 68 commonly used shortcut keys in Jupyter notebook

Python crawler, data analysis, website development and other case tutorial videos are free to watch online

https://space.bilibili.com/523606542 

Python learning exchange group: 1039645993

Commonly used shortcut keys:

Command mode (press Esc key):

  1. Enter: switch to edit mode
  2. Shift-Enter: Run this unit, select the next unit
  3. Ctrl-Enter: Run this unit
  4. Alt-Enter: Run this unit and insert a new unit under it
  5. Y: Unit transfer to code status
  6. M: The unit enters the markdown state
  7. R: The unit goes to raw state
  8. 1: Set level 1 heading
  9. 2: Set level 2 heading
  10. 3: Set level 3 heading
  11. 4: Set level 4 heading
  12. 5: Set level 5 heading
  13. 6: Set 6-level heading
  14. Up: select the upper unit
  15. K: Select the unit above
  16. Down: select the cell below
  17. J: Select the unit below
  18. Shift-K: Enlarge and select the upper cell
  19. Shift-J: Expand and select the cell below
  20. A: Insert a new unit above
  21. B: Insert a new unit below
  22. X: Cut the selected unit
  23. C: Copy the selected unit
  24. Shift-V: Paste into the cell above
  25. V: Paste into the cell below
  26. Z: Restore the last deleted unit
  27. D, D: delete the selected unit
  28. Shift-M: merge selected cells
  29. Ctrl-S: save file
  30. S: File save
  31. L: Conversion line number
  32. O: Conversion output
  33. Shift-O: Conversion output scroll
  34. Esc: close the page
  35. Q: Close the page
  36. H: Display shortcut help
  37. I, I: Interrupt the notebook core
  38. 0,0: Restart the notebook kernel
  39. Shift: ignore
  40. Shift-Space: scroll up
  41. Space: scroll down

Edit mode:

  1. Tab: code completion or indentation
  2. Shift-Tab: prompt
  3. Ctrl-]: indent
  4. Ctrl-[: Unindent
  5. Ctrl-A: select all
  6. Ctrl-Z: restore
  7. Ctrl-Shift-Z: Do it again
  8. Ctrl-Y: do it again
  9. Ctrl-Home: jump to the beginning of the unit
  10. Ctrl-Up: jump to the beginning of the unit
  11. Ctrl-End: jump to the end of the unit
  12. Ctrl-Down: jump to the end of the unit
  13. Ctrl-Left: jump to the left of the initial
  14. Ctrl-Right: jump to the beginning of the word on the right
  15. Ctrl-Backspace: delete the previous word
  16. Ctrl-Delete: delete the next word
  17. Esc: Enter command mode
  18. Ctrl-M: enter command mode
  19. Shift-Enter: Run this unit, select the next unit
  20. Ctrl-Enter: Run this unit
  21. Alt-Enter: Run this unit, insert a unit below
  22. Ctrl-Shift--: Split unit
  23. Ctrl-Shift-Subtract: Split unit
  24. Ctrl-S: save file
  25. Shift: ignore
  26. Up: Move the cursor up or go to the previous unit
  27. Down: Move the cursor down or go to the next unit

Precautions:

After each cell of jupyter notebook is run, the variables in the cell will be saved in the memory. If the previous variables are modified in a cell, some problems may occur when the cell is run again. For example, the following code:

# 第一个cell中的代码
a = 10
b = 20

# 第二个cell中的代码
c = a/b
b = 0

Because the second cell modifies the b variable, b is equal to 0 in the entire environment at this time, so when the cell is run in the future, a/b will have a problem. At this time, you can use Kernel->Restart&Run All to re-run the entire project.

Guess you like

Origin blog.csdn.net/m0_48405781/article/details/114752474