# scipy 1.18.1 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

        Interpolation at coordinates.

        Parameters
        ----------
        xi : ndarray of shape (..., ndim)
            The coordinates to evaluate the interpolator at.

        method : str, optional
            The method of interpolation to perform. Supported are "linear",
            "nearest", "slinear", "cubic", "quintic" and "pchip". Default is
            the method chosen when the interpolator was created.

        nu : sequence of ints, length ndim, optional
            If not None, the orders of the derivatives to evaluate.
            Each entry must be non-negative.
            Only allowed for methods "slinear", "cubic" and "quintic".

            .. versionadded:: 1.13

        Returns
        -------
        values_x : ndarray, shape xi.shape[:-1] + values.shape[ndim:]
            Interpolated values at `xi`. See notes for behaviour when
            ``xi.ndim == 1``.

        Notes
        -----
        In the case that ``xi.ndim == 1`` a new axis is inserted into
        the 0 position of the returned array, values_x, so its shape is
        instead ``(1,) + values.shape[ndim:]``.

        Examples
        --------
        Here we define a nearest-neighbor interpolator of a simple function

        >>> import numpy as np
        >>> x, y = np.array([0, 1, 2]), np.array([1, 3, 7])
        >>> def f(x, y):
        ...     return x**2 + y**2
        >>> data = f(*np.meshgrid(x, y, indexing='ij', sparse=True))
        >>> from scipy.interpolate import RegularGridInterpolator
        >>> interp = RegularGridInterpolator((x, y), data, method='nearest')

        By construction, the interpolator uses the nearest-neighbor
        interpolation

        >>> interp([[1.5, 1.3], [0.3, 4.5]])
        array([2., 9.])

        We can however evaluate the linear interpolant by overriding the
        `method` parameter

        >>> interp([[1.5, 1.3], [0.3, 4.5]], method='linear')
        array([ 4.7, 24.3])
        
=== parse numpydoc
short_description: 'Interpolation at coordinates.'
blank_after_short_description: True
blank_after_long_description: False
style: numpydoc
- DocstringParam
  description: 'The coordinates to evaluate the interpolator at.'
  kind: param
  key: 'param'
  arg_name: 'xi'
  type_name: 'ndarray of shape (..., ndim)'
  is_optional: False
- DocstringParam
  description: |
    The method of interpolation to perform. Supported are "linear",
    "nearest", "slinear", "cubic", "quintic" and "pchip". Default is
    the method chosen when the interpolator was created.
  kind: param
  key: 'param'
  arg_name: 'method'
  type_name: 'str'
  is_optional: True
  raw_type_name: 'str, optional'
- DocstringParam
  description: |
    If not None, the orders of the derivatives to evaluate.
    Each entry must be non-negative.
    Only allowed for methods "slinear", "cubic" and "quintic".
    
    .. versionadded:: 1.13
  kind: param
  key: 'param'
  arg_name: 'nu'
  type_name: 'sequence of ints, length ndim'
  is_optional: True
  raw_type_name: 'sequence of ints, length ndim, optional'
- DocstringReturns
  description: |
    Interpolated values at `xi`. See notes for behaviour when
    ``xi.ndim == 1``.
  kind: returns
  key: 'returns'
  type_name: 'ndarray, shape xi.shape[:-1] + values.shape[ndim:]'
  is_generator: False
  return_name: 'values_x'
- DocstringMeta
  description: |
    In the case that ``xi.ndim == 1`` a new axis is inserted into
    the 0 position of the returned array, values_x, so its shape is
    instead ``(1,) + values.shape[ndim:]``.
  kind: text
  key: 'notes'
  title: 'Notes'
- DocstringExample
  description: 'Here we define a nearest-neighbor interpolator of a simple function'
  kind: examples
  key: 'examples'
  snippet: '>>> import numpy as np'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> x, y = np.array([0, 1, 2]), np.array([1, 3, 7])'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: |
    >>> def f(x, y):
    ...     return x**2 + y**2
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: ">>> data = f(*np.meshgrid(x, y, indexing='ij', sparse=True))"
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> from scipy.interpolate import RegularGridInterpolator'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: ">>> interp = RegularGridInterpolator((x, y), data, method='nearest')"
- DocstringExample
  description: |
    By construction, the interpolator uses the nearest-neighbor
    interpolation
  kind: examples
  key: 'examples'
  snippet: |
    >>> interp([[1.5, 1.3], [0.3, 4.5]])
    array([2., 9.])
- DocstringExample
  description: |
    We can however evaluate the linear interpolant by overriding the
    `method` parameter
  kind: examples
  key: 'examples'
  snippet: |
    >>> interp([[1.5, 1.3], [0.3, 4.5]], method='linear')
    array([ 4.7, 24.3])
=== detect
numpydoc
=== compose numpydoc
Interpolation at coordinates.

Parameters
----------
xi : ndarray of shape (..., ndim)
    The coordinates to evaluate the interpolator at.
method : str, optional
    The method of interpolation to perform. Supported are "linear",
    "nearest", "slinear", "cubic", "quintic" and "pchip". Default is
    the method chosen when the interpolator was created.
nu : sequence of ints, length ndim, optional
    If not None, the orders of the derivatives to evaluate.
    Each entry must be non-negative.
    Only allowed for methods "slinear", "cubic" and "quintic".

    .. versionadded:: 1.13

Returns
-------
values_x : ndarray, shape xi.shape[:-1] + values.shape[ndim:]
    Interpolated values at `xi`. See notes for behaviour when
    ``xi.ndim == 1``.

Notes
-----
In the case that ``xi.ndim == 1`` a new axis is inserted into
the 0 position of the returned array, values_x, so its shape is
instead ``(1,) + values.shape[ndim:]``.

Examples
--------
Here we define a nearest-neighbor interpolator of a simple function

>>> import numpy as np
>>> x, y = np.array([0, 1, 2]), np.array([1, 3, 7])
>>> def f(x, y):
...     return x**2 + y**2
>>> data = f(*np.meshgrid(x, y, indexing='ij', sparse=True))
>>> from scipy.interpolate import RegularGridInterpolator
>>> interp = RegularGridInterpolator((x, y), data, method='nearest')

By construction, the interpolator uses the nearest-neighbor
interpolation

>>> interp([[1.5, 1.3], [0.3, 4.5]])
array([2., 9.])

We can however evaluate the linear interpolant by overriding the
`method` parameter

>>> interp([[1.5, 1.3], [0.3, 4.5]], method='linear')
array([ 4.7, 24.3])
