dpnp.unique_all¶
- dpnp.unique_all(x, /)[source]¶
Find the unique elements of an array, and counts, inverse, and indices.
For full documentation refer to
numpy.unique_all.- Parameters:
- x{dpnp.ndarray, usm_ndarray}
Input array. It will be flattened if it is not already 1-D.
- Returns:
- A namedtuple with the following attributes:
- valuesdpnp.ndarray
The unique elements of an input array.
- indicesdpnp.ndarray
The first occurring indices for each unique element.
- inverse_indicesdpnp.ndarray
The indices from the set of unique elements that reconstruct x.
- countsdpnp.ndarray
The corresponding counts for each unique element.
See also
dpnp.uniqueFind the unique elements of an array.
Examples
>>> import dpnp as np >>> x = np.array([1, 1, 2]) >>> uniq = np.unique_all(x) >>> uniq.values array([1, 2]) >>> uniq.indices array([0, 2]) >>> uniq.inverse_indices array([0, 0, 1]) >>> uniq.counts array([2, 1])