This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / unique_values

_ArrayFunctionDispatcher

numpy:unique_values

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/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])

See also

unique

Find the unique elements of an array.

Aliases

  • numpy.unique_values

Referenced by