Return indices of the maximum values over an axis, ignoring NaNs.
Parameters: | a : array_like
axis : int, optional
|
---|---|
Returns: | index_array : ndarray
|
Examples
>>> a = np.array([[np.nan, 4], [2, 3]])
>>> np.argmax(a)
0
>>> np.nanargmax(a)
1
>>> np.nanargmax(a, axis=0)
array([1, 0])
>>> np.nanargmax(a, axis=1)
array([1, 1])