numpy.unique_values

numpy.unique_values(x)[source]

Returns the unique elements of an input array x.

This function is Array API compatible alternative to:

>>> x = np.array([1, 1, 2])
>>> np.unique(x, equal_nan=False)
array([1, 2])
Parameters:
xarray_like

Input array. It will be flattened if it is not already 1-D.

Returns:
outndarray

The unique elements of an input array.

See also

unique

Find the unique elements of an array.

© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.0/reference/generated/numpy.unique_values.html