-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
COMPAT-18589: Supporting axis in Series.rename #18923
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
Changes from 2 commits
a51336d
24edb55
da45cf7
5f5df4e
1794b98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,3 +278,9 @@ def test_set_axis_prior_to_deprecation_signature(self): | |
with tm.assert_produces_warning(FutureWarning): | ||
result = s.set_axis(0, list('abcd'), inplace=False) | ||
tm.assert_series_equal(result, expected) | ||
|
||
def test_rename_axis_supported(self): | ||
# Supporting axis for compatibility, detailed in GH-18589 | ||
s = Series(range(5)) | ||
s.rename({}, axis=0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you move this after other rename tests? |
||
s.rename({}, axis=5) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should raise |
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 think there is an issue about explicity listing the signatures in pandas/core/series and pandas/core/frame, for rename. would take that in this PR as well.
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.
Sure, happy to do so, just to clarify, you'd like to me to implement them as specific kwargs rather than **kwargs, and default them to None?
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.
defaults should be to what they actually default now, these are passed as kwargs to the generic routine, this is mainly to have a nice signature.