It will work : 
```
In [1]: import numpy

In [2]: a = numpy.array([1, 2, 5, 3, 4])

In [3]: numpy.nanarg
numpy.nanargmax  numpy.nanargmin  

In [3]: numpy.nanargmax(a)
Out[3]: 2

In [4]: a = numpy.array([1, 2, 5, float('inf'), 4])

In [5]: numpy.nanargmax(a)
Out[5]: 3
```