Implement return_counts
and return_index
for unique
#1021
Closed as not planned
Description
Feature functionality
numpy.unique
provides 2 additional flags that are not present in heat.unique
.
return_counts
returns the number of times each unique item appears in the original array.return_index
returns the first occurrences of the unique items in the original array.
Additional context
unique_all
in the Python array API standard requires these flags to return the indices and counts of the unique values.- Also see
unique_counts
in the Python array API standard