I'm resampling a daily xarray dataset into monthly values. Is there a straightforward way to output NaN when for example only 50 percent of the days have valid data?
In the moment I'm using the xarray standard function which will output a monthly average regardless of the number of valid days: ds.resample(time='1MS').mean(dim='time')