Is there any method in python pandas to slice price range a DataFrame, not only time range, like groupby('D')? I need price range from this DataFrame, when price range is 5, and I want to other columns start/end/min/max of prices.
Time,Price,Volume
2022-04-10 00:01:00,100,5
2022-04-10 00:02:00,102,5
2022-04-10 00:03:00,104,5
2022-04-10 00:04:00,102,5
2022-04-10 00:05:00,105,5
2022-04-10 00:06:00,105,5
2022-04-10 00:07:00,106,5
2022-04-10 00:08:00,104,5
2022-04-10 00:09:00,103,5
2022-04-10 00:10:00,106,5
2022-04-10 00:11:00,108,5
2022-04-10 00:12:00,107,5
2022-04-10 00:13:00,105,5
2022-04-10 00:14:00,108,5
2022-04-10 00:15:00,104,5
2022-04-10 00:16:00,103,5
I'd like to get this:
Time,Start_price,End_price,Min_price,Max_price,Sum_volume
2022-04-10 00:01:00,100,105,100,105,25
2022-04-10 00:06:00,105,108,103,108,30
2022-04-10 00:12:00,107,103,103,108,25