Python NumPy nanagrmax() is an inbuilt NumPy function that is used to get the indices of the maximum element from an array (single-dimensional array) or any row or column (multidimensional array) of any given array. But if there are any NaNs in the array, it ignores those values and returns indices.

Python Numpy nanargmax()

Python nanargmax() function returns indices of the max element of the array in a particular axis, ignoring NaNs. The results cannot be trusted if a slice contains only NaNs and Infs.

Syntax

numpy.nanargmax(arr,axis=None)

#python #numpy

Python Numpy nanargmax() Function Example
2.20 GEEK