Back to Numerical Arrays (NumPy)
np.digitize
Return the indices of the bins to which each value in input array belongs.
Syntax
np.digitize(x, bins, right?)
Description
Return the indices of the bins to which each value in input array belongs.
Parameters
| Name | Description |
|---|---|
| x | - Input array to be binned |
| bins | - Array of bins. Must be 1-dimensional and monotonic. |
| right(optional) | - If true, bins[i-1] < x <= bins[i]. If false (default), bins[i-1] <= x < bins[i]. |
Returns
Promise<NDArray>