How to reset index in a pandas dataframe?

If reset_index() is not an option, reassign a new index using range():

df.index = range(len(df))

This manually overwrites the index, effectively mimicking a pandas dataframe reset index operation.