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

Rename map #1795

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Rename map #1795

wants to merge 16 commits into from

Conversation

xdssio
Copy link
Collaborator

@xdssio xdssio commented Dec 22, 2021

Rename multiple columns

Simply iterate and rename columns if possible.
returns the new columns which were added.

I have created it on another function to allow backward compatibility.
We can also rename this function to rename_columns for example, or something else, or allow name param to be a dict in rename().

Example:

df.renames({'x': 'x1', 'y': 'y1'})

What do you think?

@JovanVeljanoski
Copy link
Member

Is this the same idea as #1135?

I think we got stuck there on the API name, and whether the current rename should be refactored to support this but not break existing functionality (since it is used heavily internally), or exist as a separate method.

My preference would be for a single rename method that can handle this as well (if that is possible). So less methods for users to need to remember.

What do you think?

@xdssio
Copy link
Collaborator Author

xdssio commented Dec 29, 2021

I have

Is this the same idea as #1135?

I think we got stuck there on the API name, and whether the current rename should be refactored to support this but not break existing functionality (since it is used heavily internally), or exist as a separate method.

My preference would be for a single rename method that can handle this as well (if that is possible). So less methods for users to need to remember.

What do you think?

I initially had the same idea. I can check if name is a dict, and then apply it.
@maartenbreddels What do you think?

@maartenbreddels
Copy link
Member

Yes, let's put it in a single method.

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.

None yet

3 participants