How to compare awkward arrays for equality #2843
Replies: 1 comment 2 replies
-
The reason you get an error message is because binary operators such as But ak.Array([{"x": 1, "y": 2}, {"x": 3, "y": 4}]) == ak.Array([{"x": 1, "y": 2}, {"x": 3, "y": 4444}]) would result in ak.Array([{"x": True, "y": True}, {"x": True, "y": False}]) rather than ak.Array([True, False]) as you might be expecting. Is that the case—are you expecting @agoose77, this could be implemented as a default behavior for records, for If the two sides of I think it could be implemented in such a way that nested records would perform this operation recursively, so that the boolean result would always come in at the top-most record. I could take a look at implementing that, but first, what do you think? Do you think this sounds reasonable? Since we'd be replacing an error condition with a meaningful result, we could do it without a deprecation cycle. |
Beta Was this translation helpful? Give feedback.
-
Hello, I need help to compare two awkward arrays for equality,
This is the error that I get even when I try to perform equality comparison on the same object
Beta Was this translation helpful? Give feedback.
All reactions