diff --git a/pandas/core/base.py b/pandas/core/base.py index 200b16b4b6b1a..afa2c687da61e 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -997,8 +997,12 @@ def value_counts( when False. .. versionchanged:: 3.0.0 - Prior to 3.0.0, the sort was unstable. + + .. versionchanged:: 2.2.0 + The default sort kind 'quicksort' is deterministic, + i.e. it produces the same result for the same input on each run. + ascending : bool, default False Sort in ascending order. bins : int, optional diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 9d6af3c7b9917..c91a456ce4430 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -7337,6 +7337,11 @@ def sort_values( information. `mergesort` and `stable` are the only stable algorithms. For DataFrames, this option is only applied when sorting on a single column or label. + + .. versionchanged:: 2.2.0 + + The default sort kind 'quicksort' is deterministic, + i.e. it produces the same result for the same input on each run. na_position : {'first', 'last'}, default 'last' Puts NaNs at the beginning if `first`; `last` puts NaNs at the end. @@ -7657,6 +7662,11 @@ def sort_index( information. `mergesort` and `stable` are the only stable algorithms. For DataFrames, this option is only applied when sorting on a single column or label. + + .. versionchanged:: 2.2.0 + + The default sort kind 'quicksort' is deterministic, + i.e. it produces the same result for the same input on each run. na_position : {'first', 'last'}, default 'last' Puts NaNs at the beginning if `first`; `last` puts NaNs at the end. Not implemented for MultiIndex. diff --git a/pandas/core/series.py b/pandas/core/series.py index 7c949952801ca..79e43f5f18ec8 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -3500,6 +3500,11 @@ def sort_values( kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, default 'quicksort' Choice of sorting algorithm. See also :func:`numpy.sort` for more information. 'mergesort' and 'stable' are the only stable algorithms. + + .. versionchanged:: 2.2.0 + The default sort kind 'quicksort' is deterministic, + i.e. it produces the same result for the same input on each run. + na_position : {'first' or 'last'}, default 'last' Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at the end. @@ -3746,6 +3751,11 @@ def sort_index( information. 'mergesort' and 'stable' are the only stable algorithms. For DataFrames, this option is only applied when sorting on a single column or label. + + .. versionchanged:: 2.2.0 + + The default sort kind 'quicksort' is deterministic, + i.e. it produces the same result for the same input on each run. na_position : {'first', 'last'}, default 'last' If 'first' puts NaNs at the beginning, 'last' puts NaNs at the end. Not implemented for MultiIndex.