-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Open
Labels
AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffEnhancementSortinge.g. sort_index, sort_valuese.g. sort_index, sort_values
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
In the dev documentation, it is not clear which sorting algorithm is used by value_counts, which is also fixed.
It would be helpful to make such an option and record it in the docs.
Feature Description
We can follow the example of sort_values, adding the parameter kind:
import pandas as pd
s = pd.Series([1, 1, 1, 2, 2, 2]).value_counts(kind="stable")Alternative Solutions
We can just record in the docs that the algo is fixed to quicksort.
Additional Context
Related to #63154 and numpy/numpy#30262. As a user I would like to know that the sorting result is deterministic and optionally stable.
Metadata
Metadata
Assignees
Labels
AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffEnhancementSortinge.g. sort_index, sort_valuese.g. sort_index, sort_values