Skip to content

Commit 7416a59

Browse files
DOC: fix ES01,SA01 for pandas.MultiIndex.levshape (#59365)
DOC: fix SA01 for pandas.MultiIndex.levshape
1 parent 8456ead commit 7416a59

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
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" \
7474
-i "pandas.MultiIndex.get_loc_level PR07" \
75-
-i "pandas.MultiIndex.levshape SA01" \
7675
-i "pandas.MultiIndex.names SA01" \
7776
-i "pandas.MultiIndex.remove_unused_levels RT03,SA01" \
7877
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \

pandas/core/indexes/multi.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,19 @@ def nlevels(self) -> int:
10511051
@property
10521052
def levshape(self) -> Shape:
10531053
"""
1054-
A tuple with the length of each level.
1054+
A tuple representing the length of each level in the MultiIndex.
1055+
1056+
In a `MultiIndex`, each level can contain multiple unique values. The
1057+
`levshape` property provides a quick way to assess the size of each
1058+
level by returning a tuple where each entry represents the number of
1059+
unique values in that specific level. This is particularly useful in
1060+
scenarios where you need to understand the structure and distribution
1061+
of your index levels, such as when working with multidimensional data.
1062+
1063+
See Also
1064+
--------
1065+
MultiIndex.shape : Return a tuple of the shape of the MultiIndex.
1066+
MultiIndex.levels : Returns the levels of the MultiIndex.
10551067
10561068
Examples
10571069
--------

0 commit comments

Comments
 (0)