DEPR: DataFrame.value_counts(sort=False) sorts #56007
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Deprecate
Functionality to remove in pandas
Needs Discussion
Requires discussion from core team before further action
I noticed this oddity while working on #55951. There is a subtle difference in the docstrings for the
sort
argument:DataFrame.value_counts
:DataFrameGroupBy.value_counts
:It seems surprising to me that
DataFrame.value_counts(sort=False)
still sorts:whereas my expected result would be to keep the same order as the input.
I propose we deprecate this behavior and not sort at all when
sort=False
.The text was updated successfully, but these errors were encountered: