diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-10-17 20:41:39 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-10-17 20:41:39 -0700 |
commit | 3856a73ec59d9dcf8252a2d38b43191eacacbd2e (patch) | |
tree | 1f234ad1ec5a45546d6d011efa3a0845647661eb /numpy/core/numeric.py | |
parent | 77f9540f277de3e727d696eb5987a0505ed8cdf9 (diff) | |
download | numpy-3856a73ec59d9dcf8252a2d38b43191eacacbd2e.tar.gz |
BUG: count_nonzero treats empty axis tuples strangely
Fixes #9728
This bug was introduced with the `axis` keyword in #7177, as a misguided optimization.
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 6d29785da..1f8f5d43e 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -406,7 +406,7 @@ def count_nonzero(a, axis=None): array([2, 3]) """ - if axis is None or (isinstance(axis, tuple) and axis == ()): + if axis is None: return multiarray.count_nonzero(a) a = asanyarray(a) |