cupynumeric.unique_inverse#

cupynumeric.unique_inverse(
x: ndarray,
/,
) _UniqueInverseResult#

Find unique values and the indices needed to reconstruct the input.

Each NaN is treated as a distinct value. Results are currently sorted, with NaNs placed after non-NaN values.

Parameters:

x (array_like) – Input array. The values are flattened before grouping.

Returns:

out – A result whose values field contains the unique values and whose inverse_indices field has the shape of x and reconstructs the input from values.

Return type:

namedtuple

See also

unique

Availability:

Multiple GPUs, Multiple CPUs