cupy.interp#

cupy.interp(x, xp, fp, left=None, right=None, period=None)[source]#

One-dimensional linear interpolation.

Parameters
  • x (cupy.ndarray) – a 1D array of points on which the interpolation is performed.

  • xp (cupy.ndarray) – a 1D array of points on which the function values (fp) are known.

  • fp (cupy.ndarray) – a 1D array containing the function values at the the points xp.

  • left (float or complex) – value to return if x < xp[0]. Default is fp[0].

  • right (float or complex) – value to return if x > xp[-1]. Default is fp[-1].

  • period (None or float) – a period for the x-coordinates. Parameters left and right are ignored if period is specified. Default is None.

Returns

The interpolated values, same shape as x.

Return type

cupy.ndarray

Note

This function may synchronize if left or right is not already on the device.

See also

numpy.interp()