summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorAllan Haldane <ealloc@gmail.com>2017-09-04 23:24:22 +0200
committerGitHub <noreply@github.com>2017-09-04 23:24:22 +0200
commitd6d72787c079079cc8fcb7a1bb1142ed647d7884 (patch)
tree5ee2023e3dcdcb10b5175b31d983a50b87bc5eca /numpy/core/numeric.py
parent2afa142ae6ee121f6c75f28403526e35473ee6d5 (diff)
parent09257ce4dba8abf375c0d37278e842bd5dccda2d (diff)
downloadnumpy-d6d72787c079079cc8fcb7a1bb1142ed647d7884.tar.gz
Merge pull request #9638 from juliantaylor/nonzero-dtype
BUG: ensure consistent result dtype of count_nonzero
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index ed350de7f..fde08490a 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -444,7 +444,7 @@ def count_nonzero(a, axis=None):
counts = np.apply_along_axis(multiarray.count_nonzero, axis[0], a)
if axis.size == 1:
- return counts
+ return counts.astype(np.intp, copy=False)
else:
# for subsequent axis numbers, that number decreases
# by one in this new 'counts' array if it was larger