Skip to content

Commit 82bb42d

Browse files
authored
DOC: updated multi.py docstring for SS06 errors (#34775)
1 parent 9dca069 commit 82bb42d

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

pandas/core/indexes/multi.py

+18-15
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,7 @@ def _set_codes(
898898

899899
def set_codes(self, codes, level=None, inplace=False, verify_integrity=True):
900900
"""
901-
Set new codes on MultiIndex. Defaults to returning
902-
new index.
901+
Set new codes on MultiIndex. Defaults to returning new index.
903902
904903
.. versionadded:: 0.24.0
905904
@@ -1536,8 +1535,9 @@ def _get_level_values(self, level, unique=False):
15361535

15371536
def get_level_values(self, level):
15381537
"""
1539-
Return vector of label values for requested level,
1540-
equal to the length of the index.
1538+
Return vector of label values for requested level.
1539+
1540+
Length of returned vector is equal to the length of the index.
15411541
15421542
Parameters
15431543
----------
@@ -1792,12 +1792,12 @@ def _sort_levels_monotonic(self):
17921792

17931793
def remove_unused_levels(self):
17941794
"""
1795-
Create a new MultiIndex from the current that removes
1796-
unused levels, meaning that they are not expressed in the labels.
1795+
Create new MultiIndex from current that removes unused levels.
17971796
1798-
The resulting MultiIndex will have the same outward
1799-
appearance, meaning the same .values and ordering. It will also
1800-
be .equals() to the original.
1797+
Unused level(s) means levels that are not expressed in the
1798+
labels. The resulting MultiIndex will have the same outward
1799+
appearance, meaning the same .values and ordering. It will
1800+
also be .equals() to the original.
18011801
18021802
Returns
18031803
-------
@@ -2190,8 +2190,10 @@ def cats(level_codes):
21902190

21912191
def sortlevel(self, level=0, ascending=True, sort_remaining=True):
21922192
"""
2193-
Sort MultiIndex at the requested level. The result will respect the
2194-
original ordering of the associated factor at that level.
2193+
Sort MultiIndex at the requested level.
2194+
2195+
The result will respect the original ordering of the associated
2196+
factor at that level.
21952197
21962198
Parameters
21972199
----------
@@ -2629,8 +2631,10 @@ def _get_loc_single_level_index(self, level_index: Index, key: Hashable) -> int:
26292631

26302632
def get_loc(self, key, method=None):
26312633
"""
2632-
Get location for a label or a tuple of labels as an integer, slice or
2633-
boolean mask.
2634+
Get location for a label or a tuple of labels.
2635+
2636+
The location is returned as an integer/slice or boolean
2637+
mask.
26342638
26352639
Parameters
26362640
----------
@@ -2738,8 +2742,7 @@ def _maybe_to_slice(loc):
27382742

27392743
def get_loc_level(self, key, level=0, drop_level: bool = True):
27402744
"""
2741-
Get both the location for the requested label(s) and the
2742-
resulting sliced index.
2745+
Get location and sliced index for requested label(s)/level(s).
27432746
27442747
Parameters
27452748
----------

0 commit comments

Comments
 (0)