Skip to content

Commit

Permalink
DOC: fix ES01,SA01 for pandas.MultiIndex.levshape (#59365)
Browse files Browse the repository at this point in the history
DOC: fix SA01 for pandas.MultiIndex.levshape
  • Loading branch information
tuhinsharma121 authored Jul 31, 2024
1 parent 8456ead commit 7416a59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
-i "pandas.MultiIndex.get_level_values SA01" \
-i "pandas.MultiIndex.get_loc_level PR07" \
-i "pandas.MultiIndex.levshape SA01" \
-i "pandas.MultiIndex.names SA01" \
-i "pandas.MultiIndex.remove_unused_levels RT03,SA01" \
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
Expand Down
14 changes: 13 additions & 1 deletion pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,19 @@ def nlevels(self) -> int:
@property
def levshape(self) -> Shape:
"""
A tuple with the length of each level.
A tuple representing the length of each level in the MultiIndex.
In a `MultiIndex`, each level can contain multiple unique values. The
`levshape` property provides a quick way to assess the size of each
level by returning a tuple where each entry represents the number of
unique values in that specific level. This is particularly useful in
scenarios where you need to understand the structure and distribution
of your index levels, such as when working with multidimensional data.
See Also
--------
MultiIndex.shape : Return a tuple of the shape of the MultiIndex.
MultiIndex.levels : Returns the levels of the MultiIndex.
Examples
--------
Expand Down

0 comments on commit 7416a59

Please sign in to comment.