Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change index number in jupyter notebook

I am using Jupyter Notebook to write some tutorials. However, I met a problem here. As shown in following picture, when I made changes to my colleague's notebook program, the index is not right. how to change those in 1, in [2] to in [34], in [35]?enter image description here

like image 560
Hao Zhang Avatar asked Dec 11 '15 14:12

Hao Zhang


People also ask

How do I change the index number in Jupyter Notebook?

Click the menu Cell --> Run all . This will execute all cells and you will have ordered cell index numbers. If it does not start from cell index 1 , first click Kernel --> Restart and confirm the re-start.

How do you give a cell a number in Jupyter Notebook?

The easiest way to add line numbers to a Jupyter Notebook is to use the keyboard shortcut, which is Ctrl-m to enter Command Mode, then type L. Just highlight the cell you are interested in adding line numbers to, then hit the keyboard shortcut to toggle the line numbers.

What is the number in Jupyter Notebook?

Every code cell has a number, such as 1, or 2. The Notebook labels the cell with its number. The code that will be executed has the label In[ followed by the cell number, meaning Input. If there is a variable on its own at the end, that will generate an Output cell, labeled with Out[ followed by the cell number.

What is in [] in Jupyter?

This means that your kernel is busy. If you want to interrupt/stop the execution, go to the menu Kernel and click Interrupt. If it doesn't work, click Restart. You need to go in a new cell and press Shift + Enter to see if it worked.


1 Answers

Click the menu Cell --> Run all. This will execute all cells and you will have ordered cell index numbers. If it does not start from cell index 1, first click Kernel --> Restart and confirm the re-start.

like image 188
Mike Müller Avatar answered Oct 11 '22 08:10

Mike Müller