nanmax(a, axis=None, dtype=None, keepdims=False)¶
Return the maximum of an array or maximum along an axis, ignoring any NaNs.
Numpy arguments out is not supported. For all NaN slices, a very small negative number is returned instead of NaN.
mindspore.dtype, optional) – defaults to None. Overrides the dtype of the output Tensor.
keepdims (boolean, optional) – defaults to False. 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.
ValueError – if axes are out of the range of
[-a.ndim, a.ndim), or if the axes contain duplicates.
- Supported Platforms:
>>> import mindspore.numpy as np >>> a = np.array([[1, 2], [3, np.nan]]) >>> output = np.nanmax(a) >>> print(output) 3.0 >>> output = np.nanmax(a, axis=0) >>> print(output) [3. 2.]