Skip to content

Commit 8456ead

Browse files
DOC: fix ES01,PR07 for pandas.MultiIndex.get_loc (#59364)
1 parent 70c7aca commit 8456ead

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
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` \
7373
-i "pandas.MultiIndex.get_level_values SA01" \
74-
-i "pandas.MultiIndex.get_loc PR07" \
7574
-i "pandas.MultiIndex.get_loc_level PR07" \
7675
-i "pandas.MultiIndex.levshape SA01" \
7776
-i "pandas.MultiIndex.names SA01" \

pandas/core/indexes/multi.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -2985,14 +2985,19 @@ def _get_loc_single_level_index(self, level_index: Index, key: Hashable) -> int:
29852985

29862986
def get_loc(self, key):
29872987
"""
2988-
Get location for a label or a tuple of labels.
2988+
Get location for a label or a tuple of labels. The location is returned \
2989+
as an integer/slice or boolean mask.
29892990
2990-
The location is returned as an integer/slice or boolean
2991-
mask.
2991+
This method returns the integer location, slice object, or boolean mask
2992+
corresponding to the specified key, which can be a single label or a tuple
2993+
of labels. The key represents a position in the MultiIndex, and the location
2994+
indicates where the key is found within the index.
29922995
29932996
Parameters
29942997
----------
29952998
key : label or tuple of labels (one for each level)
2999+
A label or tuple of labels that correspond to the levels of the MultiIndex.
3000+
The key must match the structure of the MultiIndex.
29963001
29973002
Returns
29983003
-------

0 commit comments

Comments
 (0)