diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 1101374f94b8c..46ef05ff0df41 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -4989,8 +4989,9 @@ def sort_index( and 1 identifies the columns. level : int or level name or list of ints or list of level names If not None, sort on values in specified index level(s). - ascending : bool, default True - Sort ascending vs. descending. + ascending : bool or list of bools, default True + Sort ascending vs. descending. When the index is a MultiIndex the + sort direction can be controlled for each level individually. inplace : bool, default False If True, perform operation in-place. kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort' diff --git a/pandas/core/series.py b/pandas/core/series.py index 7d74d32bf5e14..eab2bfca635f2 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2981,11 +2981,11 @@ def sort_index( self, axis=0, level=None, - ascending=True, - inplace=False, - kind="quicksort", - na_position="last", - sort_remaining=True, + ascending: bool = True, + inplace: bool = False, + kind: str = "quicksort", + na_position: str = "last", + sort_remaining: bool = True, ignore_index: bool = False, ): """ @@ -3000,8 +3000,9 @@ def sort_index( Axis to direct sorting. This can only be 0 for Series. level : int, optional If not None, sort on values in specified index level(s). - ascending : bool, default true - Sort ascending vs. descending. + ascending : bool or list of bools, default True + Sort ascending vs. descending. When the index is a MultiIndex the + sort direction can be controlled for each level individually. inplace : bool, default False If True, perform operation in-place. kind : {'quicksort', 'mergesort', 'heapsort'}, default 'quicksort'