Searching Functions

Array API specification for functions for searching arrays.

A conforming implementation of the array API standard must provide and support the following functions adhering to the following conventions.

  • Positional parameters must be positional-only parameters. Positional-only parameters have no externally-usable name. When a function accepting positional-only parameters is called, positional arguments are mapped to these parameters based solely on their order.

  • Optional parameters must be keyword-only arguments.

  • Broadcasting semantics must follow the semantics defined in Broadcasting.

  • Unless stated otherwise, functions must support the data types defined in Data Types.

  • Unless stated otherwise, functions must adhere to the type promotion rules defined in Type Promotion Rules.

Objects in API

argmax(x, /, *, axis=None, keepdims=False)

Returns the indices of the maximum values along a specified axis.

argmin(x, /, *, axis=None, keepdims=False)

Returns the indices of the minimum values along a specified axis.

nonzero(x, /)

Returns the indices of the array elements which are non-zero.

where(condition, x1, x2, /)

Returns elements chosen from x1 or x2 depending on condition.