🍾 Xarray is now 10 years old! 🎉

xarray.core.resample.DataArrayResample.nearest

xarray.core.resample.DataArrayResample.nearest#

DataArrayResample.nearest(tolerance=None)[source]#

Take new values from nearest original coordinate to up-sampled frequency coordinates.

Parameters:

tolerance (float | Iterable[float] | None, default: None) – Maximum distance between original and new labels to limit the up-sampling method. Up-sampled data with indices that satisfy the equation abs(index[indexer] - target) <= tolerance are filled by new values. Data with indices that are outside the given tolerance are filled with NaN s.

Returns:

upsampled (DataArray or Dataset)