Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset the number inside "In [ ]" from Jupyter Notebook cell?

I am a newbie to Jupyter and trying to learn it. I ran a cell four times and now there's In[4] and Out[4] and if I execute again, it increases. Now how can I reset the values?

Also why are these values stored? Any help is appreciated.

like image 878
lu5er Avatar asked Jun 15 '17 05:06

lu5er


People also ask

How do you reset line numbers in Jupyter notebook?

Another valid option that clears all those numbers at the left side is on the top bar: >"Kernel" >"Restart and Clear Output".

How do you clear the output of a cell in Jupyter?

Press 'control-shift-p', that opens the command palette. Then type 'clear cell output'. That will let you select the command to clear the output.


1 Answers

It's so that if you have a lot of cells you can have a record of what order you ran them in. To reset the counter, you reset the kernel, either via the Kernel menu or by pressing "0" twice.

like image 51
maxymoo Avatar answered Sep 18 '22 19:09

maxymoo