Closed
Description
Timestamp
comparisons raise TypeError in some cases where datetime
s do not:
ts = pd.Timestamp.now()
ts2 = ts.tz_localize("UTC")
dt = ts.to_pydatetime()
dt2 = ts2.to_pydatetime()
>>> ts == ts2 # <-- TypeError
>>> dt == dt2
False
The datetime comparison will raise for inequalities, just not ==
or !=
.
Changing this behavior would be an API change, but it would likely simplify a bunch of headaches (including a bug in array_equivalent)