nunique¶
- array_api_extra.nunique(x, /, *, xp=None)¶
Count the number of unique elements in an array.
Compatible with JAX and Dask, whose laziness would be otherwise problematic.
- Parameters:
x (
object) – Input array.xp (
ModuleType|None) – The standard-compatible namespace for x. Default: infer.
- Returns:
array – The number of unique elements in x. It can be lazy.
- Return type: