Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC:clarify deterministic behavior of sort in ties
  • Loading branch information
Aditi4275 committed Dec 14, 2025
commit 379e6f4f1dbfeedf9ee200a0aa0e34a894b7cf32
2 changes: 1 addition & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ def value_counts(
Prior to 3.0.0, the sort was unstable.

.. versionchanged:: 2.2.0
The default sort kind 'quicksort' is now stable and deterministic,
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
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7340,7 +7340,7 @@ def sort_values(

.. versionchanged:: 2.2.0

The default sort kind 'quicksort' is now stable and deterministic,
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
Expand Down Expand Up @@ -7665,7 +7665,7 @@ def sort_index(

.. versionchanged:: 2.2.0

The default sort kind 'quicksort' is now stable and deterministic,
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.
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3496,9 +3496,9 @@ def sort_values(
information. 'mergesort' and 'stable' are the only stable algorithms.

.. versionchanged:: 2.2.0

The default sort kind 'quicksort' is now stable and deterministic,
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.
Expand Down Expand Up @@ -3748,7 +3748,7 @@ def sort_index(

.. versionchanged:: 2.2.0

The default sort kind 'quicksort' is now stable and deterministic,
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.
Expand Down