min

Contents

min#

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

Return the minimum of a quantity or an array or minimum along an axis.

Parameters:
  • a (Array | saiunit.Quantity) – Array or quantity containing numbers whose minimum is desired.

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

  • 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 input array.

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

  • where (Array | None) – Values of True indicate to calculate the ufunc at that position, values of False indicate to leave the value in the output alone.

Returns:

res – Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> a = [1, 2, 3] * u.meter
>>> u.math.min(a)