When using:
iris.pandas.as_series()
or iris.pandas.as_dataframe()
to convert a 1d cube to pandas series or dataframe, I am suddenly getting the following error:
'real_datetime' object has no attribute 'nanosecond'
Here is a minimal reproducible version:
# import packages
import iris
import iris.pandas
# load netcdf file
cubelist=iris.load('netcdffile.nc')
cube=cubelist[0]
# attempt to convert to pandas series:
dfs = iris.pandas.as_series(cube, copy=True)
This used to work fine, only now it has started throwing the error:
AttributeError: 'real_datetime' object has no attribute 'nanosecond'
I'm guessing could be a pandas or cftime issue. Does any iris experts have any advice on how to remove nanosecond from the time coord in an iris cube? Or change nanosecond to zero?
Any help appreciated, I've spent more time than I'd like to admit trying to fix this!