Open simonjayhawkins opened 4 years ago
I am able to reproduce this bug, so I believe this bug has not been solved. Can you share more thoughts on this? Do you think only the documentation need to be updated, or should the code updated as well to remove the bug altogether?
@nurakmal920207 hence the open label on the issue
anyone in the community can submit a PR
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of pandas.
[x] (optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
from docs
Index.rename(self, name, inplace=False)
Undocumented behaviour arising from
https://github.com/pandas-dev/pandas/blob/73fd8a797dc45ab1ced1c1712e04852d8d4a7d09/pandas/core/indexes/multi.py#L247
This allows passing a level to rename since MultiIndex.rename is an alias for MutliIndex.set_names
https://pandas.pydata.org/docs/dev/reference/api/pandas.Index.set_names.html
there is no documentation for MultiIndex.rename, the documentation for Index.rename includes examples for MutliIndex
so the second argument is interpreted as
level
, but from the docs should beinplace
https://pandas.pydata.org/docs/dev/reference/api/pandas.Index.rename.html
Expected Output
Output of
pd.show_versions()