Skip to content

DOC: clarify that value_counts, sort_values, sort_index etc. are deterministic #63154

@cmp0xff

Description

@cmp0xff

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.sort_values.html

Documentation problem

In the current dev documentation, it is not clear whether value_counts, sort_values, sort_index etc. give the same result in case of ties. It turns out the underlying sorting function is numpy.sort, and the answer is positive for quick sort, when one checkes the source.

Suggested fix for documentation

Since quicksort is the default sorting algorithm, we can clarify that the sorting is deterministic. Other algorithms might be clarified if numpy/numpy#30262 is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsSortinge.g. sort_index, sort_values

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions