I have a Dataframe like:
timestamp Order Price Quantity
0 2019-10-09 09:15:42 0 27850.00 2040
1 2019-10-09 09:15:42 0 27850.00 1980
2 2019-10-09 09:15:53 0 27860.85 1800
3 2019-10-09 09:16:54 0 27860.85 2340
4 2019-10-09 09:18:48 0 27860.85 1500
5 2019-10-09 09:21:08 0 27979.00 1840
6 2019-10-09 09:21:08 0 27979.00 2020
7 2019-10-09 09:21:12 0 27850.00 1800
8 2019-10-09 09:21:15 0 27850.00 1580
9 2019-10-09 09:21:21 35 28000.00 1840
10 2019-10-09 09:21:23 34 28000.00 1800
11 2019-10-09 09:28:17 0 28035.00 2020
12 2019-10-09 09:28:18 0 28035.00 1960
13 2019-10-09 09:28:18 0 28035.00 1920
14 2019-10-09 09:28:24 0 28035.00 1940
15 2019-10-09 09:28:24 0 28035.00 1960
16 2019-10-09 09:28:25 0 28000.00 2140
17 2019-10-09 09:28:25 0 28000.00 2020
18 2019-10-09 09:28:26 0 28000.00 2120
I want to check when successive Price Values are same then return the row with Max Quantity Value.
My Result Dataframe Like:
timestamp Order Price Quantity
0 2019-10-09 09:15:42 0 27850.00 2040
3 2019-10-09 09:16:54 0 27860.85 2340
6 2019-10-09 09:21:08 0 27979.00 2020
7 2019-10-09 09:21:12 0 27850.00 1800
9 2019-10-09 09:21:21 35 28000.00 1840
11 2019-10-09 09:28:17 0 28035.00 2020
16 2019-10-09 09:28:25 0 28000.00 2140
PS: Here in result table Price Value 27850.00 appears once more in Row No:7 and will be considered as independently. Similarly for 28000.00 also.