Skip to content

Commit 93198fb

Browse files
DOC: fix ES01,PR07 for pandas.MultiIndex.get_loc_level (pandas-dev#59450)
1 parent 3182e9b commit 93198fb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.MultiIndex.get_loc_level PR07" \
7473
-i "pandas.MultiIndex.names SA01" \
7574
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
7675
-i "pandas.MultiIndex.sortlevel PR07,SA01" \

pandas/core/indexes/multi.py

+11
Original file line numberDiff line numberDiff line change
@@ -3178,10 +3178,21 @@ def get_loc_level(self, key, level: IndexLabel = 0, drop_level: bool = True):
31783178
"""
31793179
Get location and sliced index for requested label(s)/level(s).
31803180
3181+
The `get_loc_level` method is a more advanced form of `get_loc`, allowing
3182+
users to specify not just a label or sequence of labels, but also the level(s)
3183+
in which to search. This method is useful when you need to isolate particular
3184+
sections of a MultiIndex, either for further analysis or for slicing and
3185+
dicing the data. The method provides flexibility in terms of maintaining
3186+
or dropping levels from the resulting index based on the `drop_level`
3187+
parameter.
3188+
31813189
Parameters
31823190
----------
31833191
key : label or sequence of labels
3192+
The label(s) for which to get the location.
31843193
level : int/level name or list thereof, optional
3194+
The level(s) in the MultiIndex to consider. If not provided, defaults
3195+
to the first level.
31853196
drop_level : bool, default True
31863197
If ``False``, the resulting index will not drop any level.
31873198

0 commit comments

Comments
 (0)