For interpolation, the xarray documentation says: "linear
and nearest
methods return arrays including NaN, while other methods such as cubic
or quadratic
return all NaN arrays." You can also refer to the reference below for solutions.
Reference: https://docs.xarray.dev/en/latest/user-guide/interpolation.html#interpolating-arrays-with-nan