-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
ENH: Allow rename_axis to specify index and columns arguments #20046
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 1 commit
bb12644
99011df
4b45493
5ff65a6
36e5412
a14e6a1
c8d6604
5806d9a
f28246f
2f53685
5fd1ddf
3e8aaf3
5ec7748
5c9c3ce
0542cf0
39938a1
65e3733
e965c5b
1263a47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -751,6 +751,10 @@ def swaplevel(self, i=-2, j=-1, axis=0): | |
|
||
# renamer function if passed a dict | ||
def _get_rename_function(self, mapper): | ||
""" | ||
Returns a function that will map names/labels, dependent if mapper | ||
is a dict, Series or just a function. | ||
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 doesn't need to be here (in the class). is it used in more than 1 place? 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. Yes, it is used in both 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. right, but it doesn't need self right? can you move to pandas/core/common.py i think is ok for this 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. I have moved it and removed leading underscore |
||
""" | ||
if isinstance(mapper, (dict, ABCSeries)): | ||
|
||
def f(x): | ||
|
@@ -913,8 +917,7 @@ def rename(self, *args, **kwargs): | |
rename.__doc__ = _shared_docs['rename'] | ||
|
||
def rename_axis(self, mapper=None, **kwargs): | ||
TomAugspurger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"""Alter the name of the index or name of index backing the | ||
columns. | ||
"""Alter the name of the index or name of index backing the columns. | ||
|
||
Parameters | ||
---------- | ||
|
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 know you just moved the function, but let's take this opportunity to write a brief docstring.