I am having the data shown in the image:
I have been trying to partition and order this data frame in such a way so that we get the output as shown in the below image:
Have tried partitioning and sorting with different columns such as partitioning by id and date and ordering by id, date, and column3 then again tried with partitioning and ordering by id and date but in all the cases it shows the different output.
Can anyone help with this? I am struggling for the past week on this.



