argmin

Contents

argmin#

class brainunit.math.argmin(a, axis=None, keepdims=None, **kwargs)#

Return the index of the minimum value along an axis.

Units are stripped before finding the minimum.

Parameters:
  • a (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity) – Input data.

  • axis (int | None) – Axis along which to operate. By default the flattened input is used.

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

Returns:

index – Index of the minimum value.

Return type:

Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.argmin(jnp.array([3.0, 1.0, 2.0]))
Array(1, dtype=int32)