any

Contents

any#

class saiunit.math.any(x, axis=None, keepdims=False, where=None, **kwargs)#

Test whether any array element along a given axis evaluates to True.

The input must be dimensionless; a TypeError is raised if x carries physical units.

Parameters:
  • x (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Input array. Must be dimensionless if it is a Quantity.

  • axis (int | None) – Axis or axes along which a logical OR reduction is performed. The default (axis=None) reduces over all dimensions.

  • keepdims (bool) – If True, reduced axes are kept as dimensions with size one.

  • where (Array | None) – Elements to include in the check.

Returns:

any – Boolean result of the OR reduction.

Return type:

bool | Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.any(jnp.array([False, False, True]))
Array(True, dtype=bool)
>>> u.math.any(jnp.array([False, False, False]))
Array(False, dtype=bool)