nanargmin

Contents

nanargmin#

class saiunit.math.nanargmin(a, axis=None, keepdims=False, **kwargs)#

Return the index of the minimum value, ignoring NaNs.

Units are stripped before finding the minimum.

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

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

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

Returns:

index – Index of the minimum value (NaNs ignored).

Return type:

Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.nanargmin(jnp.array([3.0, jnp.nan, 1.0]))
Array(2, dtype=int32)