numpy.unique_values#

numpy.unique_values(x)[source]#

Returns the unique elements of an input array x.

This function is an Array API compatible alternative to:

np.unique(x, equal_nan=False)
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.

Examples

>>> import numpy as np
>>> np.unique_values([1, 1, 2])
array([1, 2])