cfdm.Data.min¶
-
Data.
min
(axes=None, squeeze=False, split_every=None, inplace=False)[source]¶ Calculate minimum values.
Calculates the minimum value or the minimum values along axes.
See https://ncas-cms.github.io/cf-python/analysis.html#collapse-methods for mathematical definitions.
- Parameters
- axes: (sequence of)
int
, optional The axes to be collapsed. By default all axes are collapsed, resulting in output with size 1. Each axis is identified by its positive or negative integer position. If axes is an empty sequence then the collapse is applied to each scalar element and the result has the same shape as the input data.
- squeeze:
bool
, optional By default, the axes which are collapsed are left in the result as dimensions with size one, so that the result will broadcast correctly against the input array. If set to True then collapsed axes are removed from the data.
- split_every:
int
ordict
, optional Determines the depth of the
dask
recursive aggregation. If set to or more than the number of input Dask chunks, the aggregation will be performed in two steps, one partial collapse per input chunk and a single aggregation at the end. If set to less than that, an intermediate aggregation step will be used, so that any of the intermediate or final aggregation steps operates on no more thansplit_every
inputs. The depth of the aggregation graph will be logsplit_every(extnormalinputchunksalongreducedaxes). Setting to a low value can reduce cache size and network transfers, at the cost of more CPU and a larger dask graph.By default,
dask
heuristically decides on a good value. A default can also be set globally with thesplit_every
key indask.config
. Seedask.array.reduction
for details.New in version (cfdm): 1.11.2.0
- inplace:
bool
, optional If True then do the operation in-place and return
None
.
- axes: (sequence of)
- Returns
Examples
>>> a = np.ma.arange(12).reshape(4, 3) >>> d = cfdm.Data(a, 'K') >>> d[1, 1] = cfdm.masked >>> print(d.array) [[0 1 2] [3 -- 5] [6 7 8] [9 10 11]] >>> d.min() <Data(1, 1): [[0]] K>