You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defreorder_levels(self, order):
""" Rearrange index levels using input order. May not drop or duplicate levels Parameters ---------- order : list of int representing new level order. (reference level by number or key) axis : where to reorder levels Returns ------- type of caller (new object) """ifnotisinstance(self.index, MultiIndex): # pragma: no coverraiseException('Can only reorder levels on a hierarchical axis.')
result=self.copy()
result.index=result.index.reorder_levels(order)
returnresult
Problem description
[this should explain why the current behaviour is a problem and why the expected output is a better solution.]
Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
Note: Many problems can be resolved by simply upgrading pandas to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if master addresses this issue, but that is not necessary.
For documentation-related issues, you can check the latest versions of the docs on master here:
We can update the docs, or add an unused axis to Series.reorder_levels.
If we decide to add axis to Series.reorder_levels, it'll probably be easiest to just move the implementation to NDFrame.reorder_levels and use self._get_axis(axis)
Code Sample, a copy-pastable example if possible
Problem description
[this should explain why the current behaviour is a problem and why the expected output is a better solution.]
Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
Note: Many problems can be resolved by simply upgrading
pandas
to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check ifmaster
addresses this issue, but that is not necessary.For documentation-related issues, you can check the latest versions of the docs on
master
here:https://pandas-docs.github.io/pandas-docs-travis/
If the issue has not been resolved there, go ahead and file it in the issue tracker.
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]The text was updated successfully, but these errors were encountered: