Should NA equals NA in comparison? #2787
Replies: 2 comments 5 replies
-
@zhangyingmath , this is just a guess, but it seems |
Beta Was this translation helpful? Give feedback.
-
Well, this is a rather philosophical question. On one hand, the axiom of reflexivity postulates that every value is equal to itself. This implies that Now, as you correctly pointed out, some people reject full reflexivity and postulate that
We may also mention another special number here: infinity. Well, technically it's not a number, it's a symbol. But in numpy it can indicate either the value that is truly infinite, or merely large enough to not fit into float64. Even though they are not numbers, they compare as equal:
This is despite the fact that those infinities can represent demonstrably unequal quantities:
We use the same approach with NAs as with infinities: each value is equal to itself. This just seems more consistent and easier to reason about. |
Beta Was this translation helpful? Give feedback.
-
Here is what I see:
I believe the issue is rooted in the python behavior that
I am curious if the datatable behavior above is a conscious choice, or not. Being a long-time pandas user, I personally think the pandas/numpy behavior (NA does not equal NA) acceptable. I am curious what the datatable team thinks of this.
Beta Was this translation helpful? Give feedback.
All reactions