nanmin

Contents

nanmin#

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

Return the minimum of the array elements, ignoring NaNs.

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

  • axis (int | Sequence[int] | None) – Axis or axes along which the minimum is computed. The default is to compute the minimum of the flattened array.

  • keepdims (bool) –

    If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original a.

    If the value is anything but the default, then keepdims will be passed through to the min method of sub-classes of ndarray. If the sub-classes methods does not implement keepdims any exceptions will be raised.

  • initial (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity | None) – The maximum value of an output element. Must be present to allow computation on empty slice. See ~numpy.ufunc.reduce for details.

  • where (Array | ndarray | bool | number | bool | int | float | complex | None) – Elements to compare for the minimum. See ~numpy.ufunc.reduce for details.

Returns:

out – Quantity if x is a Quantity, else an array.

Return type:

saiunit.Quantity | Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> a = [1.0, jnp.nan, 3.0] * u.meter
>>> u.math.nanmin(a)