MCPcopy Create free account
hub / github.com/numpy/numpy / min

Method min

numpy/ma/core.py:5760–5857  ·  view source on GitHub ↗

Return the minimum along a given axis. Parameters ---------- axis : None or int or tuple of ints, optional Axis along which to operate. By default, ``axis`` is None and the flattened input is used. .. versionadded:: 1.7.0

(self, axis=None, out=None, fill_value=None, keepdims=np._NoValue)

Source from the content-addressed store, hash-verified

5758 self[...] = np.take_along_axis(self, sidx, axis=axis)
5759
5760 def min(self, axis=None, out=None, fill_value=None, keepdims=np._NoValue):
5761 """
5762 Return the minimum along a given axis.
5763
5764 Parameters
5765 ----------
5766 axis : None or int or tuple of ints, optional
5767 Axis along which to operate. By default, ``axis`` is None and the
5768 flattened input is used.
5769 .. versionadded:: 1.7.0
5770 If this is a tuple of ints, the minimum is selected over multiple
5771 axes, instead of a single axis or all the axes as before.
5772 out : array_like, optional
5773 Alternative output array in which to place the result. Must be of
5774 the same shape and buffer length as the expected output.
5775 fill_value : scalar or None, optional
5776 Value used to fill in the masked values.
5777 If None, use the output of `minimum_fill_value`.
5778 keepdims : bool, optional
5779 If this is set to True, the axes which are reduced are left
5780 in the result as dimensions with size one. With this option,
5781 the result will broadcast correctly against the array.
5782
5783 Returns
5784 -------
5785 amin : array_like
5786 New array holding the result.
5787 If ``out`` was specified, ``out`` is returned.
5788
5789 See Also
5790 --------
5791 ma.minimum_fill_value
5792 Returns the minimum filling value for a given datatype.
5793
5794 Examples
5795 --------
5796 >>> import numpy.ma as ma
5797 >>> x = [[1., -2., 3.], [0.2, -0.7, 0.1]]
5798 >>> mask = [[1, 1, 0], [0, 0, 1]]
5799 >>> masked_x = ma.masked_array(x, mask)
5800 >>> masked_x
5801 masked_array(
5802 data=[[--, --, 3.0],
5803 [0.2, -0.7, --]],
5804 mask=[[ True, True, False],
5805 [False, False, True]],
5806 fill_value=1e+20)
5807 >>> ma.min(masked_x)
5808 -0.7
5809 >>> ma.min(masked_x, axis=-1)
5810 masked_array(data=[3.0, -0.7],
5811 mask=[False, False],
5812 fill_value=1e+20)
5813 >>> ma.min(masked_x, axis=0, keepdims=True)
5814 masked_array(data=[[0.2, -0.7, 3.0]],
5815 mask=[[False, False, False]],
5816 fill_value=1e+20)
5817 >>> mask = [[1, 1, 1,], [1, 1, 1]]

Callers 15

ptpMethod · 0.95
test_in_bounds_fuzzMethod · 0.45
test_in_bounds_fuzzMethod · 0.45
test_in_bounds_fuzzMethod · 0.45
in1dFunction · 0.45
_as_pairsFunction · 0.45
_ptpFunction · 0.45
_get_outer_edgesFunction · 0.45
test_randomMethod · 0.45

Calls 8

filledMethod · 0.95
_check_mask_axisFunction · 0.85
minimum_fill_valueFunction · 0.85
getmaskFunction · 0.85
make_mask_noneFunction · 0.85
MaskErrorClass · 0.85
__setmask__Method · 0.80
viewMethod · 0.45

Tested by 13

test_in_bounds_fuzzMethod · 0.36
test_in_bounds_fuzzMethod · 0.36
test_in_bounds_fuzzMethod · 0.36
test_randomMethod · 0.36
doMethod · 0.36
test_minmaxMethod · 0.36
test_minmax_methodsMethod · 0.36
test_minmax_dtypesMethod · 0.36
test_minmaxMethod · 0.36