-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Index._id #37321
BUG: Index._id #37321
Conversation
pandas/core/indexes/base.py
Outdated
if self is other: | ||
return True | ||
else: | ||
return self._id is not None and self._id is getattr(other, "_id", Ellipsis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm how is this equal to Ellipsis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used Ellipsis instead of None, because self._id
might be None, triggering a false Positive.
It's probably still too obscure, so I've made a more explicit version in a new commit.
5c88cf6
to
677910d
Compare
thanks @topper-123 |
Indeed thanks @topper-123! |
This might have resulted in a slowdown, see https://pandas.pydata.org/speed/pandas/#multiindex_object.Equals.time_equals_non_object_index?commits=f162aacc-4f5e0e06&Cython=0.29.21&python=3.8 (this commits looks most related in the relevant commit range). Now, the benchmark is only about small numbers though, so it is still fast. It's only a microbenchmark. From a quick profile, it might be that in this case the |
Fixes #37213.