-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: Remove BlockManager.rename_axis #32349
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
pandas/core/indexes/api.py
Outdated
@@ -311,3 +311,24 @@ def all_indexes_same(indexes): | |||
if not first.equals(index): | |||
return False | |||
return True | |||
|
|||
|
|||
def transform_index(index: Index, func, level=None) -> Index: |
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.
how is this different from .map?
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.
Looks like the main difference is in the MultiIndex case passing level makes this operate on just that levle
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.
k, it would be better to use map then than duplicating this code
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.
or at least co-locate as a private function for future de-duplication
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.
Updated
k thanks, with the followon comments about deduplicating (I see you made a comment) |
Better to do it using NDFrame methods
cc @toobaz I know you're on board for getting index/axis stuff out of BlockManager.