I have a dataframe like this,
d = {'ID': ["A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F"],
'value': [23, 23, 52, 52, 36, 36, 46, 46, 9, 9, 110, 110]}
df = pd.DataFrame(data=d)
ID value
0 A 23
1 A 23
2 B 52
3 B 52
4 C 36
5 C 36
6 D 46
7 D 46
8 E 9
9 E 9
10 F 110
11 F 110
Basically, I replicate original data set(n rows). The dataframe I want to get seems like this,
ID value
0 A 23
1 B 23
2 B 52
3 C 52
4 C 36
5 D 36
6 D 46
7 E 46
8 E 9
9 F 9
Move column of value one unit down and remain all pairs of values. So, I lost first of A, last of F and last two value 110. Finally, I have 2n-2 rows.