summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-08-06 11:36:11 -0500
committerGitHub <noreply@github.com>2017-08-06 11:36:11 -0500
commitf307cec3962926558b6387ebb4ab8d3f4ea3aa34 (patch)
treeb902a845cb2b7a64f78aae7a10776c3daeb16e50 /numpy/core/numeric.py
parentd6539868b353e211b4aaa3a683101e094b3ee1df (diff)
parent091b8c3b16d39d18f6921f9a17d06c1652b40dca (diff)
downloadnumpy-f307cec3962926558b6387ebb4ab8d3f4ea3aa34.tar.gz
Merge pull request #9505 from eric-wieser/fix-issubdtype
BUG: issubdtype is inconsistent on types and dtypes
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py3
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)