MCPcopy Index your code
hub / github.com/numpy/numpy / min

Method min

numpy/ma/core.py:5875–5971  ·  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. If this is a tuple of ints, the

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

Source from the content-addressed store, hash-verified

5873 self[...] = np.take_along_axis(self, sidx, axis=axis)
5874
5875 def min(self, axis=None, out=None, fill_value=None, keepdims=np._NoValue):
5876 """
5877 Return the minimum along a given axis.
5878
5879 Parameters
5880 ----------
5881 axis : None or int or tuple of ints, optional
5882 Axis along which to operate. By default, ``axis`` is None and the
5883 flattened input is used.
5884 If this is a tuple of ints, the minimum is selected over multiple
5885 axes, instead of a single axis or all the axes as before.
5886 out : array_like, optional
5887 Alternative output array in which to place the result. Must be of
5888 the same shape and buffer length as the expected output.
5889 fill_value : scalar or None, optional
5890 Value used to fill in the masked values.
5891 If None, use the output of `minimum_fill_value`.
5892 keepdims : bool, optional
5893 If this is set to True, the axes which are reduced are left
5894 in the result as dimensions with size one. With this option,
5895 the result will broadcast correctly against the array.
5896
5897 Returns
5898 -------
5899 amin : array_like
5900 New array holding the result.
5901 If ``out`` was specified, ``out`` is returned.
5902
5903 See Also
5904 --------
5905 ma.minimum_fill_value
5906 Returns the minimum filling value for a given datatype.
5907
5908 Examples
5909 --------
5910 >>> import numpy.ma as ma
5911 >>> x = [[1., -2., 3.], [0.2, -0.7, 0.1]]
5912 >>> mask = [[1, 1, 0], [0, 0, 1]]
5913 >>> masked_x = ma.masked_array(x, mask)
5914 >>> masked_x
5915 masked_array(
5916 data=[[--, --, 3.0],
5917 [0.2, -0.7, --]],
5918 mask=[[ True, True, False],
5919 [False, False, True]],
5920 fill_value=1e+20)
5921 >>> ma.min(masked_x)
5922 -0.7
5923 >>> ma.min(masked_x, axis=-1)
5924 masked_array(data=[3.0, -0.7],
5925 mask=[False, False],
5926 fill_value=1e+20)
5927 >>> ma.min(masked_x, axis=0, keepdims=True)
5928 masked_array(data=[[0.2, -0.7, 3.0]],
5929 mask=[[False, False, False]],
5930 fill_value=1e+20)
5931 >>> mask = [[1, 1, 1,], [1, 1, 1]]
5932 >>> masked_x = ma.masked_array(x, mask)

Callers 15

ptpMethod · 0.95
test_in_bounds_fuzzMethod · 0.45
test_in_bounds_fuzzMethod · 0.45
test_in_bounds_fuzzMethod · 0.45
_ptpFunction · 0.45
_get_outer_edgesFunction · 0.45
_arg_trim_zerosFunction · 0.45
_quantile_is_validFunction · 0.45
_isinFunction · 0.45
_as_pairsFunction · 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 15

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_minmax_intsMethod · 0.36