import pandas as pd
Use reset_index
to create a new sequential index.
df = pd.DataFrame([('S7003', 24.1),
('S2344', 14.2),
('B3404', 17.7),
('E6911', 11.1)],
index=['1', '3', '5', '6'],
columns=('id', 'age'))
df
The default behavior to move the existing index to a column.
df.reset_index()
But the original index can also be dropped.
df.reset_index(drop=True)