diff options
author | Allan Haldane <ealloc@gmail.com> | 2017-09-04 23:24:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-04 23:24:22 +0200 |
commit | d6d72787c079079cc8fcb7a1bb1142ed647d7884 (patch) | |
tree | 5ee2023e3dcdcb10b5175b31d983a50b87bc5eca /numpy/core/numeric.py | |
parent | 2afa142ae6ee121f6c75f28403526e35473ee6d5 (diff) | |
parent | 09257ce4dba8abf375c0d37278e842bd5dccda2d (diff) | |
download | numpy-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.py | 2 |
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 |