diff options
author | seberg <sebastian@sipsolutions.net> | 2013-02-12 13:48:32 -0800 |
---|---|---|
committer | seberg <sebastian@sipsolutions.net> | 2013-02-12 13:48:32 -0800 |
commit | b859daed214cbcf9b889713c548733f288a95c56 (patch) | |
tree | 7fe033ab91ea53519b7595ac46a69a13977ec92b /numpy/lib/function_base.py | |
parent | 1ee888709af17b20a6ff97c9f6b3562e5ed93b77 (diff) | |
parent | 8552cd5fcbf52dee79bdade97ca36c18599e64b4 (diff) | |
download | numpy-b859daed214cbcf9b889713c548733f288a95c56.tar.gz |
Merge pull request #2979 from charris/fix-nansum
BUG: Make nansum work with booleans.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 65f4ecb05..320a8ec6c 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1381,8 +1381,10 @@ def _nanop(op, fill, a, axis=None): y = array(a, subok=True) # We only need to take care of NaN's in floating point arrays - if np.issubdtype(y.dtype, np.integer): + dt = y.dtype + if np.issubdtype(dt, np.integer) or np.issubdtype(dt, np.bool_): return op(y, axis=axis) + mask = isnan(a) # y[mask] = fill # We can't use fancy indexing here as it'll mess w/ MaskedArrays |