Skip to content

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

Merged
merged 4 commits into from
Mar 11, 2020

Conversation

jbrockmendel
Copy link
Member

Better to do it using NDFrame methods

cc @toobaz I know you're on board for getting index/axis stuff out of BlockManager.

@jbrockmendel jbrockmendel added Clean Internals Related to non-user accessible pandas implementation labels Feb 29, 2020
@@ -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:
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@jreback jreback added this to the 1.1 milestone Mar 11, 2020
@jreback jreback merged commit 4867415 into pandas-dev:master Mar 11, 2020
@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

k thanks, with the followon comments about deduplicating (I see you made a comment)

@jbrockmendel jbrockmendel deleted the rename_axis branch March 11, 2020 02:41
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants