Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified the doc string of value_counts for DataFrame and series when sort arg is set to false #52857

Merged
merged 4 commits into from Apr 25, 2023

Conversation

VomV
Copy link
Contributor

@VomV VomV commented Apr 22, 2023

[ ✓] closes #51420

Added the explanation of 'sort' keyword for pandas.DataFrame.value_counts and pandas.Series.value_counts. When 'sort' is set to False, value_counts method sorts the dataframe by index. For series, it preserves the order of the data.

The doctest fails due to missing explanation of the return value in value_counts. As it is not related to this issue, it should be handled separately.

@VomV VomV closed this Apr 23, 2023
@VomV VomV reopened this Apr 23, 2023
@VomV VomV closed this Apr 23, 2023
@VomV VomV reopened this Apr 23, 2023
@VomV VomV closed this Apr 23, 2023
@VomV VomV reopened this Apr 23, 2023
pandas/core/frame.py Outdated Show resolved Hide resolved
@VomV VomV requested a review from phofl April 23, 2023 21:49
@mroeschke mroeschke added Docs Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff labels Apr 24, 2023
@phofl phofl added this to the 2.1 milestone Apr 25, 2023
@phofl phofl merged commit d182a34 into pandas-dev:main Apr 25, 2023
6 of 11 checks passed
@phofl
Copy link
Member

phofl commented Apr 25, 2023

Thx @VomV

Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: describe any expected ordering of value counts when sort=False
3 participants