File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7373 -i " pandas.MultiIndex.get_level_values SA01" \
7474 -i " pandas.MultiIndex.get_loc_level PR07" \
7575 -i " pandas.MultiIndex.names SA01" \
76- -i " pandas.MultiIndex.remove_unused_levels RT03,SA01" \
7776 -i " pandas.MultiIndex.reorder_levels RT03,SA01" \
7877 -i " pandas.MultiIndex.sortlevel PR07,SA01" \
7978 -i " pandas.MultiIndex.to_frame RT03" \
Original file line number Diff line number Diff line change @@ -2091,9 +2091,22 @@ def remove_unused_levels(self) -> MultiIndex:
20912091 appearance, meaning the same .values and ordering. It will
20922092 also be .equals() to the original.
20932093
2094+ The `remove_unused_levels` method is useful in cases where you have a
2095+ MultiIndex with hierarchical levels, but some of these levels are no
2096+ longer needed due to filtering or subsetting operations. By removing
2097+ the unused levels, the resulting MultiIndex becomes more compact and
2098+ efficient, which can improve performance in subsequent operations.
2099+
20942100 Returns
20952101 -------
20962102 MultiIndex
2103+ A new MultiIndex with unused levels removed.
2104+
2105+ See Also
2106+ --------
2107+ MultiIndex.droplevel : Remove specified levels from a MultiIndex.
2108+ MultiIndex.reorder_levels : Rearrange levels of a MultiIndex.
2109+ MultiIndex.set_levels : Set new levels on a MultiIndex.
20972110
20982111 Examples
20992112 --------
You can’t perform that action at this time.
0 commit comments