I have an xarray DataArray with dimensions time, y, and x. Time is in datetime64[ns] format with an hourly frequency. Part of the array contain missing values (np.nan), as they are not part of the study area. These are the same for every time-step. Now I like to resample this to daily grids using:
p = d[‘prec’].resample(time=‘1D’, skipna=True).sum()
However, all the cells that had np.nan in the original DataArray now have a value of zero after resampling. Why are these not kept at NaN? Changing skipna to False does not seem to make a difference.
Anyone any suggestions? Or is this a bug?