11

I everyday try out my solutions before answering a pandas question in stack overflow . Usually after two to three days the jupyter notebook I use will be with n number of cells. Is there a way to delete all cells at once other than creating new notebook by deleting current one?

D D deletes one cell at a time.

Bharath M Shetty
  • 30,075
  • 6
  • 57
  • 108

3 Answers3

28

You can delete all Jupyter notebook's cells at once as follows:

  1. Select all cells : ESC + SHIFT + DOWN (starting from the top)
  2. Then click ESC + D D (D twice)
Mohamed Ali JAMAOUI
  • 14,275
  • 14
  • 73
  • 117
1
  1. Hit esc to exit edit mode
  2. Click to select the topmost cell you want to delete. in jupyterlab, a blue vertical line appears to the cell's left.
  3. Hit end to scroll to the bottom of the notebook
  4. Shift-click the last cell (similar to step 2) to select the range of cells to delete.
  5. Hit d, d to delete all the selected cells.

Hope that helps.

itny grad
  • 51
  • 2
1
  • <ESC><CTRL-A> Select all cells
  • <ESC><D><D> Delete all selected cells

<ESC>P will bring up the list of commands and key bindings

T. Vuong
  • 41
  • 3