Skip to content

DOC: fix ES01,SA01 for pandas.MultiIndex.levshape #59365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.MultiIndex.get_level_values SA01" \
-i "pandas.MultiIndex.get_loc PR07" \
-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
Loading