I want to create a new column in my DataFrame equal to the Index column but shifted 1 position upwards.
I know how to use the shift function to a columns that can be referred to in a df['column_name'] way, but I don't know how to do this with the index column.
I have tried df.index.shift(-1) but it doesn't work. df['index_name'].shift(-1) doesn't work either.
The desired result of would be to create a column which the index but shifted, just as if I did df['column2'] = df['column1'].shift(-1).