diff options
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 13a99505c..7d53f2b68 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -436,8 +436,7 @@ def count_nonzero(a, axis=None): if issubdtype(a.dtype, np.number): return (a != 0).sum(axis=axis, dtype=np.intp) - if (issubdtype(a.dtype, np.string_) or - issubdtype(a.dtype, np.unicode_)): + if issubdtype(a.dtype, np.character): nullstr = a.dtype.type('') return (a != nullstr).sum(axis=axis, dtype=np.intp) |