argmin

Contents

argmin#

class saiunit.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 (Union[Array, ndarray, number, bool, saiunit.Quantity]) – Input data.

  • axis (Optional[int]) – Axis along which to operate. By default the flattened input is used.

  • keepdims (Optional[bool]) – 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)