cupy.ediff1d#

cupy.ediff1d(arr, to_end=None, to_begin=None)[source]#

Calculates the difference between consecutive elements of an array.

Parameters:
  • arr (cupy.ndarray) – Input array.

  • to_end (cupy.ndarray, optional) – Numbers to append at the end of the returned differences.

  • to_begin (cupy.ndarray, optional) – Numbers to prepend at the beginning of the returned differences.

Returns:

New array consisting differences among succeeding elements.

Return type:

cupy.ndarray

See also

numpy.ediff1d()