File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
70
70
--format=actions \
71
71
-i ES01 ` # For now it is ok if docstrings are missing the extended summary` \
72
72
-i " pandas.Series.dt PR01" ` # Accessors are implemented as classes, but we do not document the Parameters section` \
73
- -i " pandas.MultiIndex.reorder_levels RT03,SA01" \
74
73
-i " pandas.NA SA01" \
75
74
-i " pandas.NaT SA01" \
76
75
-i " pandas.Period.freq GL08" \
Original file line number Diff line number Diff line change @@ -2604,6 +2604,13 @@ def reorder_levels(self, order) -> MultiIndex:
2604
2604
"""
2605
2605
Rearrange levels using input order. May not drop or duplicate levels.
2606
2606
2607
+ `reorder_levels` is useful when you need to change the order of levels in
2608
+ a MultiIndex, such as when reordering levels for hierarchical indexing. It
2609
+ maintains the integrity of the MultiIndex, ensuring that all existing levels
2610
+ are present and no levels are duplicated. This method is helpful for aligning
2611
+ the index structure with other data structures or for optimizing the order
2612
+ for specific data operations.
2613
+
2607
2614
Parameters
2608
2615
----------
2609
2616
order : list of int or list of str
@@ -2613,6 +2620,13 @@ def reorder_levels(self, order) -> MultiIndex:
2613
2620
Returns
2614
2621
-------
2615
2622
MultiIndex
2623
+ A new MultiIndex with levels rearranged according to the specified order.
2624
+
2625
+ See Also
2626
+ --------
2627
+ MultiIndex.swaplevel : Swap two levels of the MultiIndex.
2628
+ MultiIndex.set_names : Set names for the MultiIndex levels.
2629
+ DataFrame.reorder_levels : Reorder levels in a DataFrame with a MultiIndex.
2616
2630
2617
2631
Examples
2618
2632
--------
You can’t perform that action at this time.
0 commit comments