method in Pandas can be used to change the indexes of a Series. code example
Example 1: how to change index in dataframe python
index = [1,2]
df.index = index
Example 2: series change index pandas
x.index = index_values
index = [1,2]
df.index = index
x.index = index_values