This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / _external / array_api_extra / _delegation / nunique

function

scipy._external.array_api_extra._delegation:nunique

source: build-install/usr/lib/python3.14/site-packages/scipy/_external/array_api_extra/_delegation.py:830

Signature

def nunique(x: Array, /, xp: ArrayNamespace | 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 : Array

Input array.

xp : array_namespace, optional

The standard-compatible namespace for x. Default: infer.

Returns

: array: 0-dimensional integer array

The number of unique elements in x. It can be lazy.

Aliases

  • scipy.differentiate.xpx.nunique