pandas dataframe change the index of a row code example
Example 1: rename dataframe index column pandas
df.index.names = ['new_name']
Example 2: how to change index in dataframe python
index = [1,2]
df.index = index
df.index.names = ['new_name']
index = [1,2]
df.index = index