From c14f4f1618462fdd6d5829280e63ad950f948437 Mon Sep 17 00:00:00 2001 From: Will Peppo Date: Sun, 14 Jun 2020 15:26:31 -0400 Subject: [PATCH] DOC: updated multi.py docstring for SS06 errors --- pandas/core/indexes/multi.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index fc2d4cf4621c4..fa35d683101c3 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -903,8 +903,7 @@ def _set_codes( def set_codes(self, codes, level=None, inplace=False, verify_integrity=True): """ - Set new codes on MultiIndex. Defaults to returning - new index. + Set new codes on MultiIndex. Defaults to returning new index. .. versionadded:: 0.24.0 @@ -1541,8 +1540,9 @@ def _get_level_values(self, level, unique=False): def get_level_values(self, level): """ - Return vector of label values for requested level, - equal to the length of the index. + Return vector of label values for requested level. + + Length of returned vector is equal to the length of the index. Parameters ---------- @@ -1797,12 +1797,12 @@ def _sort_levels_monotonic(self): def remove_unused_levels(self): """ - Create a new MultiIndex from the current that removes - unused levels, meaning that they are not expressed in the labels. + Create new MultiIndex from current that removes unused levels. - The resulting MultiIndex will have the same outward - appearance, meaning the same .values and ordering. It will also - be .equals() to the original. + Unused level(s) means levels that are not expressed in the + labels. The resulting MultiIndex will have the same outward + appearance, meaning the same .values and ordering. It will + also be .equals() to the original. Returns ------- @@ -2195,8 +2195,10 @@ def cats(level_codes): def sortlevel(self, level=0, ascending=True, sort_remaining=True): """ - Sort MultiIndex at the requested level. The result will respect the - original ordering of the associated factor at that level. + Sort MultiIndex at the requested level. + + The result will respect the original ordering of the associated + factor at that level. Parameters ---------- @@ -2634,8 +2636,10 @@ def _get_loc_single_level_index(self, level_index: Index, key: Hashable) -> int: def get_loc(self, key, method=None): """ - Get location for a label or a tuple of labels as an integer, slice or - boolean mask. + Get location for a label or a tuple of labels. + + The location is returned as an integer/slice or boolean + mask. Parameters ---------- @@ -2743,8 +2747,7 @@ def _maybe_to_slice(loc): def get_loc_level(self, key, level=0, drop_level: bool = True): """ - Get both the location for the requested label(s) and the - resulting sliced index. + Get location and sliced index for requested label(s)/level(s). Parameters ----------