Skip to content

ENH: Add observed keyword to value_counts #43498

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

Closed
jseabold opened this issue Sep 10, 2021 · 2 comments
Closed

ENH: Add observed keyword to value_counts #43498

jseabold opened this issue Sep 10, 2021 · 2 comments
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Categorical Categorical Data Type Enhancement

Comments

@jseabold
Copy link
Contributor

Is your feature request related to a problem?

If you do value_counts on a categorical there's no way to suppress unobserved categories.

Describe the solution you'd like

Add an observed keyword to value_counts.

API breaking implications

None, unless we want to revisit the default in light of #35967.

@jseabold jseabold added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 10, 2021
@usersblock
Copy link
Contributor

Hello, is there a code sample you want to add to testing?

@mroeschke mroeschke added Categorical Categorical Data Type and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 30, 2021
@simonjayhawkins simonjayhawkins added the Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff label Jun 11, 2022
@jbrockmendel
Copy link
Member

closing as duplicate of #46486 (even though this came first, there is more discussion there)

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 Categorical Categorical Data Type Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants