max#
- class brainunit.math.max(a, axis=None, keepdims=False, initial=None, where=None, **kwargs)#
Return the maximum of a quantity or an array or maximum along an axis.
- Parameters:
a (
Array| saiunit.Quantity) – Array or quantity containing numbers whose maximum 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 minimum 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 – Maximum 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.max(a)