I have a dataframe like this
crdf = pd.DataFrame(Maindf.loc[Maindf['Symbol'] == 'ICICIBANK']).set_index(['TimeStamp'])
crdf.index = pd.to_datetime(crdf.index)
crdf['Ltp'] = crdf['Ltp'].astype('float64')
crdf['Volume'] = crdf['Volume'].astype('float64')
Symbol Ltp Volume
TimeStamp
1970-01-01 05:30:00 AM ICICIBANK 371.15 34111143
This dataframe is getting the tick data and is constantly getting updated
I want to resample this dataframe at the end on 1 min to get the
Open = First(Ltp)
Low = Min(Ltp)
High = Max(Ltp)
Close = Last(Ltp)
and Volume = Last(Volume)
Rcrdf = crdf.resample('1Min').ohlc()
I am using resample function but i am getting error DataError: No numeric types to aggregate
Can someone please help how to resample this