I am working on a problem, which needs to shift data from a column by 1,2 and 3 ..and the create new column for that vaue.
Example DataFrame:
Date Price
1-1-18 10
2-1-18 20
3-1-18 25
4-1-18 30
5-1-18 45
6-1-18 50
7-1-18 60
Expected DataFrame :
Date Price Price1 Price2 Price3
1-1-18 10 -1 -1 -1
2-1-18 20 -1 -1 -1
3-1-18 25 -1 -1 -1
4-1-18 30 25 20 10
5-1-18 45 30 25 20
6-1-18 50 45 30 25
7-1-18 60 50 45 30