The way to do that would be this:
Resetting the index:
df.reset_index(drop=True, inplace=True)
Sorting an index:
df.sort_index(inplace=True)
Setting a new index from a column:
df.set_index('column_name', inplace=True)
Setting a new index from a range:
df.index = range(1, 31, 1) #a range starting at one ending at 30 with a stepsize of 1.
Sorting a dataframe based on column value:
df.sort_values(by='column_name', inplace=True)
Reassigning variables works as-well:
df=df.reset_index(drop=True)
df=df.sort_index()
df=df.set_index('column_name')
df.index = range(1, 31, 1) #a range starting at one ending at 30 with a stepsize of 1.
df=df.sort_values(by='column_name')