cupy.digitize#

cupy.digitize(x, bins, right=False)[source]#

Finds the indices of the bins to which each value in input array belongs.

Note

In order to avoid device synchronization, digitize does not raise an exception when the array is not monotonic

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

  • bins (cupy.ndarray) – Array of bins. It has to be 1-dimensional and monotonic increasing or decreasing.

  • right (bool) – Indicates whether the intervals include the right or the left bin edge.

Returns:

Output array of indices, of same shape as x.

Return type:

cupy.ndarray

See also

numpy.digitize()