- Series.digitize(bins, right=False)#
Return the indices of the bins to which each value in series belongs.
1-D monotonically, increasing array with same type as this series.
Indicates whether interval contains the right or left bin edge.
- A new Series containing the indices.
Monotonicity of bins is assumed and not checked.
>>> import cudf >>> s = cudf.Series([0.2, 6.4, 3.0, 1.6]) >>> bins = cudf.Series([0.0, 1.0, 2.5, 4.0, 10.0]) >>> inds = s.digitize(bins) >>> inds 0 1 1 4 2 3 3 2 dtype: int32