method to change index dataframe pandas 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