@@ -898,8 +898,7 @@ def _set_codes(
898
898
899
899
def set_codes (self , codes , level = None , inplace = False , verify_integrity = True ):
900
900
"""
901
- Set new codes on MultiIndex. Defaults to returning
902
- new index.
901
+ Set new codes on MultiIndex. Defaults to returning new index.
903
902
904
903
.. versionadded:: 0.24.0
905
904
@@ -1536,8 +1535,9 @@ def _get_level_values(self, level, unique=False):
1536
1535
1537
1536
def get_level_values (self , level ):
1538
1537
"""
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.
1541
1541
1542
1542
Parameters
1543
1543
----------
@@ -1792,12 +1792,12 @@ def _sort_levels_monotonic(self):
1792
1792
1793
1793
def remove_unused_levels (self ):
1794
1794
"""
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.
1797
1796
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.
1801
1801
1802
1802
Returns
1803
1803
-------
@@ -2190,8 +2190,10 @@ def cats(level_codes):
2190
2190
2191
2191
def sortlevel (self , level = 0 , ascending = True , sort_remaining = True ):
2192
2192
"""
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.
2195
2197
2196
2198
Parameters
2197
2199
----------
@@ -2629,8 +2631,10 @@ def _get_loc_single_level_index(self, level_index: Index, key: Hashable) -> int:
2629
2631
2630
2632
def get_loc (self , key , method = None ):
2631
2633
"""
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.
2634
2638
2635
2639
Parameters
2636
2640
----------
@@ -2738,8 +2742,7 @@ def _maybe_to_slice(loc):
2738
2742
2739
2743
def get_loc_level (self , key , level = 0 , drop_level : bool = True ):
2740
2744
"""
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).
2743
2746
2744
2747
Parameters
2745
2748
----------
0 commit comments