Skip to content

Commit 38c0991

Browse files
author
dkane01
committed
DOC: clarify MultiIndex.swaplevel negative index
1 parent d1b10ea commit 38c0991

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/indexes/multi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,10 +2613,12 @@ def swaplevel(self, i=-2, j=-1) -> MultiIndex:
26132613
----------
26142614
i : int, str, default -2
26152615
First level of index to be swapped. Can pass level name as string.
2616-
Type of parameters can be mixed.
2616+
Type of parameters can be mixed. If i is a negative int, the first
2617+
level is indexed relative to the end of the MultiIndex.
26172618
j : int, str, default -1
26182619
Second level of index to be swapped. Can pass level name as string.
2619-
Type of parameters can be mixed.
2620+
Type of parameters can be mixed. If j is a negative int, the second
2621+
level is indexed relative to the end of the MultiIndex.
26202622
26212623
Returns
26222624
-------

0 commit comments

Comments
 (0)