reindex pandas dataframe from 0

41

reset_index pandas -

df.reset_index(drop=True, inplace=True)

reindex pandas dataframe from 0 -

df.reset_index()
    index   class  max_speed
0  falcon    bird      389.0
1  parrot    bird       24.0
2    lion  mammal       80.5
3  monkey  mammal        NaN

reindex pandas dataframe from 0 -

df.reset_index(drop=True, inplace=True)

reset index pandas -

df.reset_index(drop=True)

Comments

Submit
0 Comments