This script can reset a Jupyter notebook's execution cell indexes, making them increase from 1
.
You need to specify an original Jupyter file and an output path.
PS> .\Reset-JupyterCellIndex.ps1 -InputPath 'origin.ipynb' -OutputPath 'new.ipynb'
Variable values in cells may be different according to execution order. Users should make sure variables are correct by themselves.
In [2]: a = 1
In [1]: a = 0
In [3]: a
Out [3]: 1
For example, the above cells will become the following content after resetting:
In [1]: a = 1
In [2]: a = 0
In [3]: a
Out [3]: 1
The output of variable a
is incorrect according to the new execution order.
Distributed under the MIT License. See LICENSE
for more information.