Statistical Functions

Array API specification for statistical functions.

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.

  • Unless stated otherwise, floating-point operations must adhere to IEEE 754-2019.

Objects in API

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

Calculates the maximum value of the input array x.

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

Calculates the arithmetic mean of the input array x.

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

Calculates the minimum value of the input array x.

prod(x, /, *, axis=None, dtype=None, keepdims=False)

Calculates the product of input array x elements.

std(x, /, *, axis=None, correction=0.0, keepdims=False)

Calculates the standard deviation of the input array x.

sum(x, /, *, axis=None, dtype=None, keepdims=False)

Calculates the sum of the input array x.

var(x, /, *, axis=None, correction=0.0, keepdims=False)

Calculates the variance of the input array x.