czs108 / Jupyter-Cell-Index-Resetter

🧹 A script used to reset a Jupyter notebook's execution cell indexes, making them increase from 1.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jupyter Cell Index Resetter

PowerShell License

Introduction

Cover

This script is used to reset a Jupyter notebook's execution cell indexes, making them increase from 1.

Usage

You need to specify a Jupyter file and an output name.

PS> .\Reset-JupyterCellIndex.ps1 -InputPath origin.ipynb -OutputPath new.ipynb

Warning

Variable values in cells might 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.

License

Distributed under the MIT License. See LICENSE for more information.

About

🧹 A script used to reset a Jupyter notebook's execution cell indexes, making them increase from 1.

License:MIT License


Languages

Language:PowerShell 100.0%