-
Notifications
You must be signed in to change notification settings - Fork 590
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
Implement pandas like rename #1135
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for your first-time contribution! I like the idea of this, but I'm not sure of the method name. @JovanVeljanoski what do you think. Should we mayne rename the existing rename, or have 1 rename method that takes a dict or two arguments? Regards, Maarten |
Hi @maartenbreddels, Thank you for this marvelous library. |
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.
I wonder if the current rename
and pandas_rename
can be refactored to be a single function.
For example, if the name
argument is collections.Mapping
instance, than do what pandas_mapping
does, otherwise assume the current rename
method's functionality.
Also, would be nice if this branch were rebased on master, lots of changes in the meantime, would help with the CI.
"""Rename columns like pandas. Mappings should contain a dict like object""" | ||
if not isinstance(mappings, collections.Mapping): | ||
raise TypeError('Mappings object is not a dict like object') | ||
df = self.copy() |
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 a reason to do df = self.copy()
instead of just doing the rename on self
directly (like the existing rename
method is doing? (Maybe @maartenbreddels knows).
369423b
to
6927b35
Compare
Intended to fix #80