On a side note, I noticed that all the nan-ops degenerate to their non-nan-ops counterparts (i.e. nanmin --> min) when called with integer dtypes. Below is a diff where that's made a little more obvious by returning early for integer dtypes.
Index: numpy/lib/function_base.py
===================================================================
--- numpy/lib/function_base.py (revision 8445)
+++ numpy/lib/function_base.py (working copy)
@@ -1295,15 +1295,15 @@
"""
y = array(a, subok=True)
- mask = isnan(a)
# We only need to take care of NaN's in floating point arrays
- if not np.issubdtype(y.dtype, np.integer):
- # y[mask] = fill
- # We can't use fancy indexing here as it'll mess w/ MaskedArrays
- # Instead, let's fill the array directly...
- np.putmask(y, mask, fill)
-
+ if np.issubdtype(y.dtype, np.integer):
+ return op(y, axis=axis)
+ mask = isnan(a)
+ # y[mask] = fill
+ # We can't use fancy indexing here as it'll mess w/ MaskedArrays
+ # Instead, let's fill the array directly...
+ np.putmask(y, mask, fill)
res = op(y, axis=axis)
mask_all_along_axis = mask.all(axis=axis)