Skip to content

ENH: Add observed keyword to value_counts #43498

Closed
@jseabold

Description

@jseabold

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffCategoricalCategorical Data TypeEnhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions