diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-10-18 09:16:52 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 09:16:52 -0600 |
commit | ce65f115c409a4a8089ace496e15bbfca566070b (patch) | |
tree | 1f234ad1ec5a45546d6d011efa3a0845647661eb /numpy/core/numeric.py | |
parent | 77f9540f277de3e727d696eb5987a0505ed8cdf9 (diff) | |
parent | 3856a73ec59d9dcf8252a2d38b43191eacacbd2e (diff) | |
download | numpy-ce65f115c409a4a8089ace496e15bbfca566070b.tar.gz |
Merge pull request #9881 from eric-wieser/fix-count_nonzero-axis
BUG: count_nonzero treats empty axis tuples strangely
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) |