This Data Frame DF:
Stock Date Time Price Open
AAA 2002-02-23 10:13 2.440 0.01
AAA 2002-02-27 17:17 2.460 0.02
Becomes :Transformed
Stock Date Time_0 Price_0 Open_0 Time_1 Price_1 Open_1
AAA 2002-02-23 10:13 2.440 0.01 17:17 2.460 0.02
AAA 2002-02-27 17:17 2.460 0.02 NA NA NA
I want to apply the above operation for a larger data set is there an efficient way to do this? (The images have a more detailed representation)
EDIT : Solution How to create a lagged data structure using pandas dataframe This answers the question