Skip to content

Commit e83ee58

Browse files
committed
DOC: mention implicit sorting in docstrings
1 parent bc61010 commit e83ee58

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas/core/frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,6 +3278,7 @@ def stack(self, level=-1, dropna=True):
32783278
DataFrame (or Series in the case of an object with a single level of
32793279
column labels) having a hierarchical index with a new inner-most level
32803280
of row labels.
3281+
The level involved will automatically get sorted.
32813282
32823283
Parameters
32833284
----------
@@ -3317,7 +3318,8 @@ def unstack(self, level=-1):
33173318
a DataFrame having a new level of column labels whose inner-most level
33183319
consists of the pivoted index labels. If the index is not a MultiIndex,
33193320
the output will be a Series (the analogue of stack when the columns are
3320-
not a MultiIndex)
3321+
not a MultiIndex).
3322+
The level involved will automatically get sorted.
33213323
33223324
Parameters
33233325
----------

pandas/core/series.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,8 @@ def reorder_levels(self, order):
18841884

18851885
def unstack(self, level=-1):
18861886
"""
1887-
Unstack, a.k.a. pivot, Series with MultiIndex to produce DataFrame
1887+
Unstack, a.k.a. pivot, Series with MultiIndex to produce DataFrame.
1888+
The level involved will automatically get sorted.
18881889
18891890
Parameters
18901891
----------

0 commit comments

Comments
 (0)