You are viewing an older version (2.4.3).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / unique_values

_ArrayFunctionDispatcher

numpy:unique_values

source: /numpy/lib/_arraysetops_impl.py:617

Signature

def unique_values(x)

Summary

Returns the unique elements of an input array x.

Extended Summary

This function is an Array API compatible alternative to

np.unique(x, equal_nan=False, sorted=False)

Parameters

x : array_like

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

Returns

out : ndarray

The unique elements of an input array.

Examples

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

See also

unique

Find the unique elements of an array.

Aliases

  • numpy.unique_values