The `issubdtype` check will fail for complex. I think the easiest fix is to use copyto for the assignment `copyto(res,  nan, where=mask, casting='safe')`. There are some oddities with complex in current master

    In [20]: a = ones(3, dtype=np.complex)
    
    In [21]: nanargmin(a)
    Out[21]: 0
    
    In [22]: type(nanargmin(a))
    Out[22]: numpy.int64
    
    In [23]: a[:] = nan
    
    In [24]: nanargmin(a)
    Out[24]: nan
    
    In [25]: type(nanargmin(a))
    Out[25]: float

Also, 1d arrays behave differently than 2d with axis.