I have a file in Jupyter notebook but for some reason the cell numbering is not in order (e.g 1,2,3,4).
In my file it starts at 1, then 89, then 44:
![Screenshot of file](https://img.codepudding.com/202209/e54c4a14c28845c9bbcab20c6cc4867d.png)
Does anyone know how to get them in sequential order?
CodePudding user response:
The numbers you are referring to are there to show the order in which your cells have been executed. Consider this example:
![](https://img.codepudding.com/202209/efac36e9975c43009c9984b683186585.png)
If you want these numbers to be in order, by definition it means that you have to execute all your cells in order.
- If you want them to start from 1, restart your kernel:
![](https://img.codepudding.com/202209/91f510612a394f798a94d4493cccd783.png)
or:
![](https://img.codepudding.com/202209/3f80eaeb0df045c587077f658c521f19.png)
- You can either execute all your cells manually, or click on the button "Run all cells":
![](https://img.codepudding.com/202209/bfc0ca6c64344a9eae782c2bab16c4c7.png)
Result:
![](https://img.codepudding.com/202209/3b4191d824614ad5bbde8dfe89f07133.png)
CodePudding user response:
The numbers have no importance. They are the order at which you ran them.
As suggested above - do Kernel | Restart
and this will reset the numbers.