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 /doc | |
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 'doc')
-rw-r--r-- | doc/release/1.14.0-notes.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/release/1.14.0-notes.rst b/doc/release/1.14.0-notes.rst index 5dbd9b44c..f576923b2 100644 --- a/doc/release/1.14.0-notes.rst +++ b/doc/release/1.14.0-notes.rst @@ -122,6 +122,13 @@ passed, despite not doing so under the simple cases:: This change affects only ``float32`` and ``float16`` arrays. +``count_nonzero(arr, axis=())`` now counts over no axes, not all axes +--------------------------------------------------------------------- +Elsewhere, ``axis==()`` is always understood as "no axes", but +`count_nonzero` had a special case to treat this as "all axes". This was +inconsistent and surprising. The correct way to count over all axes has always +been to pass ``axis == None``. + ``__init__.py`` files added to test directories ----------------------------------------------- This is for pytest compatibility in the case of duplicate test file names in |