I have data like this:
| price | Date | Time |
|---|---|---|
| 100 | 2021/01/01 | 9:00 |
| 200 | 2021/01/02 | 9:00 |
| 112 | 2021/01/01 | 9:01 |
| 223 | 2021/01/02 | 9:02 |
| 1145 | 2021/01/01 | 9:02 |
| 2214 | 2021/01/02 | 9:03 |
| 11 | 2021/01/01 | 9:03 |
| 20 | 2021/01/02 | 9:10 |
I need to get 3 values from each day. The price at 9:00, the price at 18:00 (There are more data), and a random value from that day except 9:00 and 18:00. 9:00 is not the start time, and 18:00 is not the end time.
I know I should use groupby for example: df.groupby('Date')['price'] But I don't know how to use conditions to filter data after groupby.
Because I need to use these data of every day, after I filter these data, I also need to get these data. The expected answer is like [100,112,200] (100 is price at 9:00,112 is the random price, 200 is the price at 18:00)
