nums.numpy.nanmin

nums.numpy.nanmin(a, axis=None, out=None, keepdims=False)[source]

Return minimum of an array or minimum along an axis, ignoring any NaNs. When all-NaN slices are encountered a RuntimeWarning is raised and Nan is returned for that slice.

This docstring was copied from numpy.nanmin.

Some inconsistencies with the NumS version may exist.

Parameters
  • a (BlockArray) – Array containing numbers whose minimum is desired. If a is not an array, a conversion is attempted.

  • axis ({int, tuple of int, None}, optional) – Axis or axes along which the minimum is computed. The default is to compute the minimum of the flattened array.

  • out (BlockArray, optional) – Alternate output array in which to place the result. The default is None; if provided, it must have the same shape as the expected output, but the type will be cast if necessary.

  • keepdims (bool, optional) –

    If 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 original a.

    If the value is anything but the default, then keepdims will be passed through to the min method of sub-classes of BlockArray. If the sub-classes methods does not implement keepdims any exceptions will be raised.

Returns

nanmin – An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, an BlockArray scalar is returned. The same dtype as a is returned.

Return type

BlockArray

See also

nanmax

The maximum value of an array along a given axis, ignoring any NaNs.

amin

The minimum value of an array along a given axis, propagating any NaNs.

fmin

Element-wise minimum of two arrays, ignoring any NaNs.

minimum

Element-wise minimum of two arrays, propagating any NaNs.

isnan

Shows which elements are Not a Number (NaN).

isfinite

Shows which elements are neither NaN nor infinity.

amax, fmax, maximum

Notes

NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). This means that Not a Number is not equivalent to infinity. Positive infinity is treated as a very large number and negative infinity is treated as a very small (i.e. negative) number.

If the input has a integer type the function is equivalent to nps.min.

‘out’ is currently not supported.

Examples

The doctests shown below are copied from NumPy. They won’t show the correct result until you operate get().

>>> a = nps.array([[1, 2], [3, nps.nan]])  
>>> nps.nanmin(a).get()  
arary(1.)
>>> nps.nanmin(a, axis=0).get()  
array([1.,  2.])
>>> nps.nanmin(a, axis=1).get()  
array([1.,  3.])