summaryrefslogtreecommitdiff
path: root/doc/release
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-11-04 17:32:10 -0700
committerGitHub <noreply@github.com>2019-11-04 17:32:10 -0700
commit4393e0c0cb1772d0f9691117d238d000b209decd (patch)
tree5dda9c9a885af59ecdcd4c3c947e69bd6bab48bf /doc/release
parent7b8513fff4c3673d8a967a1d72a73feab2072e8f (diff)
parent9aa8c4756d7282dd49a7093ce7a6725258106b9a (diff)
downloadnumpy-4393e0c0cb1772d0f9691117d238d000b209decd.tar.gz
Merge pull request #14800 from mattip/reorder-obj-comparison-loop
ENH: change object-array comparisons to prefer OO->O unfuncs
Diffstat (limited to 'doc/release')
-rw-r--r--doc/release/upcoming_changes/14800.improvement.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/14800.improvement.rst b/doc/release/upcoming_changes/14800.improvement.rst
new file mode 100644
index 000000000..158c31536
--- /dev/null
+++ b/doc/release/upcoming_changes/14800.improvement.rst
@@ -0,0 +1,14 @@
+Comparison on ``object`` dtypes will prefer ``object`` output
+-------------------------------------------------------------
+Comparison ufuncs (``np.equal`` and friends) would return boolean arrays when
+the input array dtype was ``object``. This led to inconsistent behaviour for
+ragged arrays ``a = np.array([1, np.array([1, 2, 3])], dtype=object)``. This
+will now return an object array::
+
+ >>> a = np.array([1, np.array([1, 2, 3])], dtype=object)
+ >>> np.equal(a, a)
+ array([True, array([ True, True, True])], dtype=object)
+
+The old behaviour, which will raise a ``ValueError`` in this case, is still
+available by specifying a dtype as ``np.equal(a, a, dtype=bool)``.
+