cfdm.Data.minimum¶
-
Data.
minimum
(axes=None)[source]¶ Return the minimum of an array or minimum along axes.
Missing data array elements are omitted from the calculation.
New in version (cfdm): 1.8.0
See also
- Parameters
- axes: (sequence of)
int
, optional The axes over which to take the minimum. By default the minimum over all axes is returned.
Each axis is identified by its integer position in the data. Negative integers counting from the last position are allowed.
- Parameter example:
axes=0
- Parameter example:
axes=-1
- Parameter example:
axes=[1, -2]
- axes: (sequence of)
- Returns
Data
Minimum of the data along the specified axes.
Examples
>>> d = cfdm.Data(numpy.arange(24).reshape(1, 2, 3, 4)) >>> d <Data(1, 2, 3, 4): [[[[0, ..., 23]]]]> >>> print(d.array) [[[[ 0 1 2 3] [ 4 5 6 7] [ 8 9 10 11]] [[12 13 14 15] [16 17 18 19] [20 21 22 23]]]] >>> e = d.min() >>> e <Data(1, 1, 1, 1): [[[[0]]]]> >>> print(e.array) [[[[0]]]] >>> e = d.min(2) >>> e <Data(1, 2, 1, 4): [[[[0, ..., 15]]]]> >>> print(e.array) [[[[ 0 1 2 3]] [[12 13 14 15]]]] >>> e = d.min([-2, -1]) >>> e <Data(1, 2, 1, 1): [[[[0, 12]]]]> >>> print(e.array) [[[[ 0]] [[12]]]]