root_numpy.dup_idx¶
-
root_numpy.
dup_idx
(arr)¶ Return the indices of all duplicated array elements.
Parameters: arr : array-like object
An array-like object
Returns: idx : NumPy array
An array containing the indices of the duplicated elements
Examples
>>> from root_numpy import dup_idx >>> dup_idx([1, 2, 3, 4, 5]) array([], dtype=int64) >>> dup_idx([1, 2, 3, 4, 5, 5]) array([4, 5]) >>> dup_idx([1, 2, 3, 4, 5, 5, 1]) array([0, 4, 5, 6])