Skip to content
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

df.rename works with 'mapper' and 'axis' params #1057

Merged
merged 2 commits into from
Feb 19, 2020

Conversation

k3vob
Copy link
Contributor

@k3vob k3vob commented Feb 6, 2020

DataFrame.rename() will now change column names if mapper and axis=1 are provided as parameters, and axis names of mapper and axis=0 are provided

What do these changes do?

Related issue number

Resolves #1056

  • passes flake8 modin
  • passes black --check modin
  • tests added and passing

Copy link
Collaborator

@devin-petersohn devin-petersohn left a comment

Choose a reason for hiding this comment

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

Thanks @KevOBrien! A couple of comments:

  • With the axis argument we should use the utility self._get_axis_number(axis). If we don't, it will only allow axis=1 or axis=0 and not allow axis="columns", etc. Then we can only check axis=0 or axis=1.
  • We should also add a test to modin/pandas/test/test_dataframe.py to make sure we don't regress on this in the future.

Copy link
Collaborator

@devin-petersohn devin-petersohn left a comment

Choose a reason for hiding this comment

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

I went ahead and fixed the comments I made

@devin-petersohn devin-petersohn merged commit e1ca99c into modin-project:master Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.rename() is failing to rename columns
2 participants