Return the minimum along a given axis.
Axis along which to operate. By default, axis is None and the flattened input is used. If this is a tuple of ints, the minimum is selected over multiple axes, instead of a single axis or all the axes as before.
Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output.
Value used to fill in the masked values. If None, use the output of minimum_fill_value.
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 array.
New array holding the result. If out was specified, out is returned.
See also
ma.minimum_fill_valueReturns the minimum filling value for a given datatype.
>>> import numpy.ma as ma
>>> x = [[1., -2., 3.], [0.2, -0.7, 0.1]]
>>> mask = [[1, 1, 0], [0, 0, 1]]
>>> masked_x = ma.masked_array(x, mask)
>>> masked_x
masked_array(
data=[[--, --, 3.0],
[0.2, -0.7, --]],
mask=[[ True, True, False],
[False, False, True]],
fill_value=1e+20)
>>> ma.min(masked_x)
-0.7
>>> ma.min(masked_x, axis=-1)
masked_array(data=[3.0, -0.7],
mask=[False, False],
fill_value=1e+20)
>>> ma.min(masked_x, axis=0, keepdims=True)
masked_array(data=[[0.2, -0.7, 3.0]],
mask=[[False, False, False]],
fill_value=1e+20)
>>> mask = [[1, 1, 1,], [1, 1, 1]]
>>> masked_x = ma.masked_array(x, mask)
>>> ma.min(masked_x, axis=0)
masked_array(data=[--, --, --],
mask=[ True, True, True],
fill_value=1e+20,
dtype=float64)
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.ma.min.html