numpy.ma.masked_array.mini

method

ma.masked_array.mini(axis=None)[source]

Return the array minimum along the specified axis.

Deprecated since version 1.13.0: This function is identical to both:

  • self.min(keepdims=True, axis=axis).squeeze(axis=axis)

  • np.ma.minimum.reduce(self, axis=axis)

Typically though, self.min(axis=axis) is sufficient.

Parameters
axisint, optional

The axis along which to find the minima. Default is None, in which case the minimum value in the whole array is returned.

Returns
minscalar or MaskedArray

If axis is None, the result is a scalar. Otherwise, if axis is given and the array is at least 2-D, the result is a masked array with dimension one smaller than the array on which mini is called.

Examples

>>> x = np.ma.array(np.arange(6), mask=[0 ,1, 0, 0, 0 ,1]).reshape(3, 2)
>>> x
masked_array(
  data=[[0, --],
        [2, 3],
        [4, --]],
  mask=[[False,  True],
        [False, False],
        [False,  True]],
  fill_value=999999)
>>> x.mini()
masked_array(data=0,
             mask=False,
       fill_value=999999)
>>> x.mini(axis=0)
masked_array(data=[0, 3],
             mask=[False, False],
       fill_value=999999)
>>> x.mini(axis=1)
masked_array(data=[0, 2, 4],
             mask=[False, False, False],
       fill_value=999999)

There is a small difference between mini and min:

>>> x[:,1].mini(axis=0)
masked_array(data=3,
             mask=False,
       fill_value=999999)
>>> x[:,1].min(axis=0)
3