diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 6a2dcd459bb..93e20138c3d 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2398,25 +2398,25 @@ def interp_like( determine which interpolant is used: 1. **Interpolation along one dimension of 1D data (`method='linear'`)** - - Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`. + - Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`. 2. **Interpolation along one dimension of N-dimensional data (N ≥ 1)** - - Methods {"linear", "nearest", "zero", "slinear", "quadratic", "cubic", "quintic", "polynomial"} - use :py:class:`scipy.interpolate.interp1d`, unless conditions permit the use of :py:class:`numpy.interp` - (as in the case of `method='linear'` for 1D data). - - If `method='polynomial'`, the `order` keyword argument must also be provided. + - Methods {"linear", "nearest", "zero", "slinear", "quadratic", "cubic", "quintic", "polynomial"} + use :py:class:`scipy.interpolate.interp1d`, unless conditions permit the use of :py:class:`numpy.interp` + (as in the case of `method='linear'` for 1D data). + - If `method='polynomial'`, the `order` keyword argument must also be provided. 3. **Special interpolants for interpolation along one dimension of N-dimensional data (N ≥ 1)** - - Depending on the `method`, the following interpolants from :py:class:`scipy.interpolate` are used: - - `"pchip"`: :py:class:`scipy.interpolate.PchipInterpolator` - - `"barycentric"`: :py:class:`scipy.interpolate.BarycentricInterpolator` - - `"krogh"`: :py:class:`scipy.interpolate.KroghInterpolator` - - `"akima"` or `"makima"`: :py:class:`scipy.interpolate.Akima1dInterpolator` - (`makima` is handled by passing the `makima` flag). + - Depending on the `method`, the following interpolants from :py:class:`scipy.interpolate` are used: + - `"pchip"`: :py:class:`scipy.interpolate.PchipInterpolator` + - `"barycentric"`: :py:class:`scipy.interpolate.BarycentricInterpolator` + - `"krogh"`: :py:class:`scipy.interpolate.KroghInterpolator` + - `"akima"` or `"makima"`: :py:class:`scipy.interpolate.Akima1dInterpolator` + (`makima` is handled by passing the `makima` flag). 4. **Interpolation along multiple dimensions of multi-dimensional data** - - Uses :py:func:`scipy.interpolate.interpn` for methods {"linear", "nearest", "slinear", - "cubic", "quintic", "pchip"}. + - Uses :py:func:`scipy.interpolate.interpn` for methods {"linear", "nearest", "slinear", + "cubic", "quintic", "pchip"}. Parameters ---------- diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 5b314b6d6bd..9e4b2bee83c 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3900,26 +3900,26 @@ def interp( determine which interpolant is used: 1. **Interpolation along one dimension of 1D data (`method='linear'`)** - - Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`. + - Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`. 2. **Interpolation along one dimension of N-dimensional data (N ≥ 1)** - - Methods {"linear", "nearest", "zero", "slinear", "quadratic", "cubic", "quintic", "polynomial"} - use :py:class:`scipy.interpolate.interp1d`, unless conditions permit the use of :py:class:`numpy.interp` - (as in the case of `method='linear'` for 1D data). - - If `method='polynomial'`, the `order` keyword argument must also be provided. In this case, - :py:class:`scipy.interpolate.interp1d` is called with `kind=order`. + - Methods {"linear", "nearest", "zero", "slinear", "quadratic", "cubic", "quintic", "polynomial"} + use :py:class:`scipy.interpolate.interp1d`, unless conditions permit the use of :py:class:`numpy.interp` + (as in the case of `method='linear'` for 1D data). + - If `method='polynomial'`, the `order` keyword argument must also be provided. In this case, + :py:class:`scipy.interpolate.interp1d` is called with `kind=order`. 3. **Special interpolants for interpolation along one dimension of N-dimensional data (N ≥ 1)** - - Depending on the `method`, the following interpolants from :py:class:`scipy.interpolate` are used: - - `"pchip"`: :py:class:`scipy.interpolate.PchipInterpolator` - - `"barycentric"`: :py:class:`scipy.interpolate.BarycentricInterpolator` - - `"krogh"`: :py:class:`scipy.interpolate.KroghInterpolator` - - `"akima"` or `"makima"`: :py:class:`scipy.interpolate.Akima1dInterpolator` - (`makima` is handled by passing `makima` to `method`). + - Depending on the `method`, the following interpolants from :py:class:`scipy.interpolate` are used: + - `"pchip"`: :py:class:`scipy.interpolate.PchipInterpolator` + - `"barycentric"`: :py:class:`scipy.interpolate.BarycentricInterpolator` + - `"krogh"`: :py:class:`scipy.interpolate.KroghInterpolator` + - `"akima"` or `"makima"`: :py:class:`scipy.interpolate.Akima1dInterpolator` + (`makima` is handled by passing `makima` to `method`). 4. **Interpolation along multiple dimensions of multi-dimensional data** - - Uses :py:func:`scipy.interpolate.interpn` for methods {"linear", "nearest", "slinear", - "cubic", "quintic", "pchip"}. + - Uses :py:func:`scipy.interpolate.interpn` for methods {"linear", "nearest", "slinear", + "cubic", "quintic", "pchip"}. Out-of-range values are filled with NaN, unless specified otherwise via `kwargs` to the numpy/scipy interpolant. @@ -4202,26 +4202,26 @@ def interp_like( determine which interpolant is used: 1. **Interpolation along one dimension of 1D data (`method='linear'`)** - - Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`. + - Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`. 2. **Interpolation along one dimension of N-dimensional data (N ≥ 1)** - - Methods {"linear", "nearest", "zero", "slinear", "quadratic", "cubic", "quintic", "polynomial"} - use :py:class:`scipy.interpolate.interp1d`, unless conditions permit the use of :py:class:`numpy.interp` - (as in the case of `method='linear'` for 1D data). - - If `method='polynomial'`, the `order` keyword argument must also be provided. In this case, - :py:class:`scipy.interpolate.interp1d` is called with `kind=order`. + - Methods {"linear", "nearest", "zero", "slinear", "quadratic", "cubic", "quintic", "polynomial"} + use :py:class:`scipy.interpolate.interp1d`, unless conditions permit the use of :py:class:`numpy.interp` + (as in the case of `method='linear'` for 1D data). + - If `method='polynomial'`, the `order` keyword argument must also be provided. In this case, + :py:class:`scipy.interpolate.interp1d` is called with `kind=order`. 3. **Special interpolants for interpolation along one dimension of N-dimensional data (N ≥ 1)** - - Depending on the `method`, the following interpolants from :py:class:`scipy.interpolate` are used: - - `"pchip"`: :py:class:`scipy.interpolate.PchipInterpolator` - - `"barycentric"`: :py:class:`scipy.interpolate.BarycentricInterpolator` - - `"krogh"`: :py:class:`scipy.interpolate.KroghInterpolator` - - `"akima"` or `"makima"`: :py:class:`scipy.interpolate.Akima1dInterpolator` - (`makima` is handled by passing `makima` to `method`). + - Depending on the `method`, the following interpolants from :py:class:`scipy.interpolate` are used: + - `"pchip"`: :py:class:`scipy.interpolate.PchipInterpolator` + - `"barycentric"`: :py:class:`scipy.interpolate.BarycentricInterpolator` + - `"krogh"`: :py:class:`scipy.interpolate.KroghInterpolator` + - `"akima"` or `"makima"`: :py:class:`scipy.interpolate.Akima1dInterpolator` + (`makima` is handled by passing `makima` to `method`). 4. **Interpolation along multiple dimensions of multi-dimensional data** - - Uses :py:func:`scipy.interpolate.interpn` for methods {"linear", "nearest", "slinear", - "cubic", "quintic", "pchip"}. + - Uses :py:func:`scipy.interpolate.interpn` for methods {"linear", "nearest", "slinear", + "cubic", "quintic", "pchip"}. Out-of-range values are filled with NaN, unless specified otherwise via `kwargs` to the numpy/scipy interpolant.