diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-06-13 13:44:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 13:44:46 +0300 |
commit | 02c8e80d5f65c7870f71c989c425d1bad24bd312 (patch) | |
tree | 690627f8e09fa93962c147eecbe54900473f090c /doc | |
parent | 53c60d4b5152c9dddc584182d96caeb66a3036b4 (diff) | |
parent | dcf9d9628eb50d275a6d42a6ed2cfdd25949ef57 (diff) | |
download | numpy-02c8e80d5f65c7870f71c989c425d1bad24bd312.tar.gz |
Merge pull request #13708 from eric-wieser/deprecate-nonzero
DEP: Deprecate nonzero(0d) in favor of calling atleast_1d explicitly
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.17.0-notes.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst index 297dbbf2d..95de953b5 100644 --- a/doc/release/1.17.0-notes.rst +++ b/doc/release/1.17.0-notes.rst @@ -43,6 +43,13 @@ from python. This deprecation should not affect many users since arrays created in such a manner are very rare in practice and only available through the NumPy C-API. +`numpy.nonzero` should no longer be called on 0d arrays +------------------------------------------------------- +The behavior of nonzero on 0d arrays was surprising, making uses of it almost +always incorrect. If the old behavior was intended, it can be preserved without +a warning by using ``nonzero(atleast_1d(arr))`` instead of ``nonzero(arr)``. +In a future release, it is most likely this will raise a `ValueError`. + Future Changes ============== |