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)
| 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) |