cf.Data.maximum_absolute_value

Data.maximum_absolute_value(axes=None, squeeze=False, mtol=1, inplace=False, _preserve_partitions=False)[source]

Collapse axes with their maximum absolute value.

Missing data elements are omitted from the calculation.

Parameters

axes : (sequence of) int, optional

squeeze : bool, optional

inplace: bool, optional

If True then do the operation in-place and return None.

Returns
Data or None

The collapsed data, or None if the operation was in-place.

Examples:

>>> d = cf.Data([[-1, 2, 3], [9, -8, -12]], 'm')
>>> d.maximum_absolute_value()
<CF Data(1, 1): [[12]] m>
>>> d.max()
<CF Data(1, 1): [[9]] m>
>>> d.maximum_absolute_value(axes=1)
<CF Data(2, 1): [[3, 12]] m>
>>> d.max(axes=1)
<CF Data(2, 1): [[3, 9]] m>