pandas data frame how to edit index code example Example: how to change index in dataframe python index = [1,2] df.index = index