-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
PERF: slicing #52183
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
PERF: slicing #52183
Conversation
jbrockmendel
commented
Mar 24, 2023
pandas/core/generic.py
Outdated
@@ -6009,10 +6009,10 @@ def __finalize__(self, other, method: str | None = None, **kwargs) -> Self: | |||
stable across pandas releases. | |||
""" | |||
if isinstance(other, NDFrame): | |||
for name in other.attrs: |
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.
Are these changes supposed to be in this PR?
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.
Yes. __finalize__
adds up.
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.
It looks like .attrs
and .flags
just call ._attrs
and ._flags
respectively? Did the attribute call significantly impact the slicing benchmark?
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'm not seeing much difference, will revert.
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.
reverted+greenish
Thanks @jbrockmendel |
Interesting, why is the df faster than the series? |
Further investigation welcome. |