I've following code to calculate ohlc data. When I print, it shows date and other data. I'm interested in only close value. Any help on this, I've searched everywhere but unable to find.
Thank you for your response. It still prints other values as well. Please note I'm interested in only retrieving 15838 value. I'm not that familiar with pandas, so all learnings are from the web.
data = df['last_price'].resample("5T").ohlc()
If you have more than one symbol then you have to first group by symbols and then apply above
OUTPUT:
date
2021-07-08 11:25:00 15838.0
Freq: 5T, Name: close, dtype: float64
My input file (data.csv):
15837.75,2021-07-08 11:29:28
15837.9,2021-07-08 11:29:29
15838.0,2021-07-08 11:29:30
print (data['close'].values[0])
Thank you once again.