bundles / scipy latest / scipy / _lib / array_api_extra / _lib / _funcs / nunique
function
scipy._lib.array_api_extra._lib._funcs:nunique
Signature
def nunique ( x : Array , / , xp : ModuleType | None = None ) → Array Summary
Count the number of unique elements in an array.
Extended Summary
Compatible with JAX and Dask, whose laziness would be otherwise problematic.
Parameters
x: ArrayInput array.
xp: array_namespace, optionalThe standard-compatible namespace for
x. Default: infer.
Returns
: array: 0-dimensional integer arrayThe number of unique elements in
x. It can be lazy.
Aliases
-
scipy.differentiate.xpx.nunique