My original Dataframe (df):
column1 column2
0 1 a
1 2 b
2 3 c
3 4 d
4 5 e
5 6 f
I want to shift the values down by 6 like so:
column1 column2
0
1
2
3
4
5
6 1 a
7 2 b
8 3 c
9 4 d
10 5 e
11 6 f
When I use df = df.shift(6)
, I end up loosing data.
I found this post (How to shift a column in Pandas DataFrame without losing value) but it only seems to work if the values are shifted down by 1.
How can I shift multiple spots down while retaining the data?