-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ENH: Implement PeriodIndex.intersection without object-dtype cast #30666
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
Conversation
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.
LGTM. How does the ASV for period.Indexing.time_intersection
look?
For the length=1000 index in the benchmark we take a hit of about 37%. When I change the benchmark to be length=10**5 it is no change. |
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.
lgtm. some comments for followon.
@@ -799,6 +803,30 @@ def _wrap_setop_result(self, other, result): | |||
result.name = name | |||
return result | |||
|
|||
def intersection(self, other, sort=False): |
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.
type at some point
self._assert_can_do_setop(other) | ||
res_name = get_op_result_name(self, other) | ||
other = ensure_index(other) | ||
|
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.
can this code be shared with superclasses?
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 think so, its going to be a few steps before we get there
interesting, i though this would be faster. ok |
PeriodIndex._simple_new is not as simple as it should be. In order to get it to have the appropriate signature we need to implement some of the set methods correctly. This is the first of those.