Bharath M Shetty
Bharath M Shetty

Reputation: 30605

Is there a way to delete all cells at once in jupyter?

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.

Upvotes: 13

Views: 13059

Answers (3)

T. Vuong
T. Vuong

Reputation: 51

  • <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

Upvotes: 2

itny grad
itny grad

Reputation: 81

  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.

Upvotes: 1

Mohamed Ali JAMAOUI
Mohamed Ali JAMAOUI

Reputation: 14689

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)

Upvotes: 30

Related Questions