How to reindex the rows in excel using python

I have a modifed df but the rows index is changed so how to let it start from 0 and so on

Example :

2 Mc-system commercial

3 Mf-System educational

20 Mk-system fundemntal

I want it to be like this :

0 Mc-system commercial

1 Mf-System educational

2 Mk-system fundemntal

So that the row index is organized

>Solution :

use
dataframe.reset_index

df.reset_index(drop=True)

Leave a Reply