Could anyone please tell me how to achieve this?
The original dataframe is like:
value
2021-4-22 1
2021-4-23 22
2021-4-26 31
2021-4-27 42
2021-10-11 12
2021-10-13 15
2021-10-15 54
2021-10-16 65
2022-02-21 27
2022-02-22 23
2022-02-23 78
2022-02-24 56
For example ,I want to shift my data by 1 row with every 4 rows as a group:
value
2021-4-22 nan
2021-4-23 1
2021-4-26 22
2021-4-27 31
2021-10-11 nan
2021-10-13 12
2021-10-15 15
2021-10-16 54
2022-02-21 nan
2022-02-22 27
2022-02-23 23
2022-02-24 78