Skip to content

Commit 0c107bd

Browse files
authored
DOC: Update sort_index docs (#31898)
1 parent aa1089f commit 0c107bd

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Diff for: pandas/core/frame.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4732,8 +4732,9 @@ def sort_index(
47324732
and 1 identifies the columns.
47334733
level : int or level name or list of ints or list of level names
47344734
If not None, sort on values in specified index level(s).
4735-
ascending : bool, default True
4736-
Sort ascending vs. descending.
4735+
ascending : bool or list of bools, default True
4736+
Sort ascending vs. descending. When the index is a MultiIndex the
4737+
sort direction can be controlled for each level individually.
47374738
inplace : bool, default False
47384739
If True, perform operation in-place.
47394740
kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort'

Diff for: pandas/core/series.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -2950,11 +2950,11 @@ def sort_index(
29502950
self,
29512951
axis=0,
29522952
level=None,
2953-
ascending=True,
2954-
inplace=False,
2955-
kind="quicksort",
2956-
na_position="last",
2957-
sort_remaining=True,
2953+
ascending: bool = True,
2954+
inplace: bool = False,
2955+
kind: str = "quicksort",
2956+
na_position: str = "last",
2957+
sort_remaining: bool = True,
29582958
ignore_index: bool = False,
29592959
):
29602960
"""
@@ -2969,8 +2969,9 @@ def sort_index(
29692969
Axis to direct sorting. This can only be 0 for Series.
29702970
level : int, optional
29712971
If not None, sort on values in specified index level(s).
2972-
ascending : bool, default true
2973-
Sort ascending vs. descending.
2972+
ascending : bool or list of bools, default True
2973+
Sort ascending vs. descending. When the index is a MultiIndex the
2974+
sort direction can be controlled for each level individually.
29742975
inplace : bool, default False
29752976
If True, perform operation in-place.
29762977
kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort'

0 commit comments

Comments
 (0)