-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: pivot changing index name of input object #52630
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
@@ -519,6 +519,8 @@ def pivot( | |||
# If columns is None we will create a MultiIndex level with None as name | |||
# which might cause duplicated names because None is the default for | |||
# level names | |||
data = data.copy(deep=False) | |||
data.index = data.index.copy() | |||
data.index.names = [ |
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.
Is there an opportunity to defer doing this (and avoiding the copy) if we push this to the if/else
branches below?
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.
Both are shallow copies and should take any time compared to the actual pivot op?
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.
That's fair. Might be a cleanup opportunity in the future but ok as it fixes the regression
Thanks @phofl |
…f input object) (#52636) Backport PR #52630: REGR: pivot changing index name of input object Co-authored-by: Patrick Hoefler <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.