Skip to content

DOC: Edit MultiIndex.set_levels() docstring to clarify that set_levels() interprets passed values as new components of the .levels attribute (#28294) #29143

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

Merged
Merged
Prev Previous commit
Next Next commit
update set_levels docstrings for clarity
  • Loading branch information
hweecat committed Nov 19, 2019
commit f29a9b837ef56d9f317f373bc94dcc9f746fc4da
3 changes: 2 additions & 1 deletion pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ def set_levels(self, levels, level=None, inplace=False, verify_integrity=True):

If any of the levels passed to ``set_levels()`` exceeds the
existing length, all of the values from that argument will
be stored though truncated in the MultiIndex output.
be stored in the MultiIndex levels, though the values will
be truncated in the MultiIndex output.

>>> idx.set_levels([['a', 'b', 'c'], [1, 2, 3, 4]], level=[0, 1])
MultiIndex([('a', 1),
Expand Down