I'm trying to resample some data in 1 minute intervals and use the mean average to represent that minute of data, but I keep getting an error:
DataError: No numeric types to aggregate.
if I try min()
,max()
or sum()
it works fine but not with mean.
for example:
mdf = mdf.resample('1min').sum()
will work but not
mdf = mdf.resample('1min').mean()
I've tried converting the dtypes using but I don't understand how to do this. mdf = pd.to_numeric(mdf)
gives the following error,
TypeError: arg must be a list, tuple, 1-d array, or Series
The dtypes for my dataframe are all objects as shown below:
- NO object
- NO2 object
- O3 object
- ambHumidity object
- ambPressure object
- ambTempC object
- humidity object
- particulatePM1 object
- particulatePM10 object
- particulatePM25 object
- tempC object
This is what the dataframe looks like