class_docstr: NearestNDInterpolator(x, y).
  
  Nearest-neighbor interpolation in N > 1 dimensions.
  
  .. versionadded:: 0.9
  
  Methods
  -------
  __call__
  
  Parameters
  ----------
  x : (Npoints, Ndims) ndarray of floats
      Data point coordinates.
  y : (Npoints,) ndarray of float or complex
      Data values.
  rescale : boolean, optional
      Rescale points to unit cube before performing interpolation.
      This is useful if some of the input dimensions have
      incommensurable units and differ by many orders of magnitude.
  
      .. versionadded:: 0.14.0
  tree_options : dict, optional
      Options passed to the underlying ``cKDTree``.
  
      .. versionadded:: 0.17.0
  
  
  Notes
  -----
  Uses ``scipy.spatial.cKDTree``
  
  Examples
  --------
  We can interpolate values on a 2D plane:
  
  >>> from scipy.interpolate import NearestNDInterpolator
  >>> import matplotlib.pyplot as plt
  >>> rng = np.random.default_rng()
  >>> x = rng.random(10) - 0.5
  >>> y = rng.random(10) - 0.5
  >>> z = np.hypot(x, y)
  >>> X = np.linspace(min(x), max(x))
  >>> Y = np.linspace(min(y), max(y))
  >>> X, Y = np.meshgrid(X, Y)  # 2D grid for interpolation
  >>> interp = NearestNDInterpolator(list(zip(x, y)), z)
  >>> Z = interp(X, Y)
  >>> plt.pcolormesh(X, Y, Z, shading='auto')
  >>> plt.plot(x, y, "ok", label="input point")
  >>> plt.legend()
  >>> plt.colorbar()
  >>> plt.axis("equal")
  >>> plt.show()
  
  See also
  --------
  griddata :
      Interpolate unstructured D-D data.
  LinearNDInterpolator :
      Piecewise linear interpolant in N dimensions.
  CloughTocher2DInterpolator :
      Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D.
code: def __init__(self, x, y, rescale=False, tree_options=None):
      NDInterpolatorBase.__init__(
          self,
          x,
          y,
          rescale=rescale,
          need_contiguous=False,
          need_values=False,
      )
      if tree_options is None:
          tree_options = dict()
      self.tree = cKDTree(self.points, **tree_options)
      self.values = np.asarray(y)
  
file_path: catboost/contrib/python/scipy/py3/scipy/interpolate/ndgriddata.py
imports: import numpy
  from .interpnd import LinearNDInterpolator, NDInterpolatorBase, CloughTocher2DInterpolator, _ndim_coords_from_arrays
  from scipy.spatial import cKDTree
label_desc: Use image node_id 1 to create a new NearestNDInterpolator object from inherited base classes: NDInterpolatorBase with example: obj = NearestNDInterpolator(x, y, rescale, tree_options)