Skip to content

numojo.routines.logic.truth

Truth value testing (numojo.routines.logic.truth)

This module implements the truth value testing functions, such as all and any, for both NDArray and Matrix.

Functions

all

Overload 1

all[dtype: DType](A: Matrix[dtype]) -> Scalar[dtype]

Test whether all array elements evaluate to True.

Parameters:

  • dtype (DType)

Args:

  • A (Matrix): Matrix.

Returns:

  • Scalar

Overload 2

all[dtype: DType](A: Matrix[dtype], axis: Int) -> Matrix[dtype]

Test whether all array elements evaluate to True along axis.

Parameters:

  • dtype (DType)

Args:

  • A (Matrix)
  • axis (Int)

Returns:

  • Matrix

Raises

Overload 3

all(array: NDArray[DType.bool]) -> Scalar[DType.bool]

If all True.

Args:

  • array (NDArray): A NDArray.

Returns:

  • Scalar

Raises

any

Overload 1

any(array: NDArray[DType.bool]) -> Scalar[DType.bool]

If any True.

Args:

  • array (NDArray): A NDArray.

Returns:

  • Scalar

Raises

Overload 2

any[dtype: DType](A: Matrix[dtype]) -> Scalar[dtype]

Test whether any array elements evaluate to True.

Parameters:

  • dtype (DType)

Args:

  • A (Matrix): Matrix.

Returns:

  • Scalar

Overload 3

any[dtype: DType](A: Matrix[dtype], axis: Int) -> Matrix[dtype]

Test whether any array elements evaluate to True along axis.

Parameters:

  • dtype (DType)

Args:

  • A (Matrix)
  • axis (Int)

Returns:

  • Matrix

Raises