bundles / numpy 2.4.4 / numpy / ma / core / min
function
numpy.ma.core:min
source: /numpy/ma/core.py :6989
Signature
def min ( obj , axis = None , out = None , fill_value = None , keepdims = <no value> ) Summary
Return the minimum along a given axis.
Parameters
axis: None or int or tuple of ints, optionalAxis along which to operate. By default,
axisis 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.out: array_like, optionalAlternative output array in which to place the result. Must be of the same shape and buffer length as the expected output.
fill_value: scalar or None, optionalValue used to fill in the masked values. If None, use the output of minimum_fill_value.
keepdims: bool, optionalIf 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.
Returns
amin: array_likeNew array holding the result. If
outwas specified,outis returned.
Examples
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 ma.min(masked_x) ma.min(masked_x, axis=-1) ma.min(masked_x, axis=0, keepdims=True) mask = [[1, 1, 1,], [1, 1, 1]] masked_x = ma.masked_array(x, mask) ma.min(masked_x, axis=0)
See also
- ma.minimum_fill_value
Returns the minimum filling value for a given datatype.
Aliases
-
numpy.ma.min