I have intraday OHLCV data on several coins on the 4H timeframe that I want to convert to the daily timeframe. I am new to Python so I don't know where to proceed next(my focus right now is studying sql). So here's the sample of the dataframe:
Pair | Date | Open | High | Low | Close | Volume |
---|---|---|---|---|---|---|
BTCUSDT | 2021-06-30 08:00:00 | 35000 | 36100 | 34000 | 35500 | 10000000 |
2021-06-30 12:00:00 | 35505 | 37000 | 35400 | 35600 | 12000000 | |
2021-06-30 16:00:00 | 35650 | 42000 | 32000 | 41000 | 20000000 | |
2021-06-30 20:00:00 | 41100 | 41500 | 38000 | 39000 | 15000000 | |
ETCUSDT | 2021-06-30 08:00:00 | 3500 | 3800 | 3200 | 3300 | 1000000 |
2021-06-30 12:00:00 | 3350 | 3600 | 3100 | 3200 | 730000 | |
2021-06-30 16:00:00 | 3270 | 4000 | 3200 | 3800 | 2000000 | |
2021-06-30 20:00:00 | 3900 | 4300 | 3800 | 4200 | 3000000 |
So for the dataframe, I used "Pair" and "Date" as multiindex. There are over 300 pairs in the actual data. Tried searching for similar questions but unlike my question, the others had only one pair, or for those with multiple pairs, they don't have the OHLCV data. They just only have the close or mean price.
Here is the result I want:
Pair | Date | Open | High | Low | Close | Volume |
---|---|---|---|---|---|---|
BTCUSDT | 2021-06-30 | 35000 | 42000 | 32000 | 39000 | 57000000 |
ETCUSDT | 2021-06-30 | 3500 | 4300 | 3100 | 4200 | 6730000 |