Skip to content

ENH: density of a categorical #10949

Closed
Closed
@jreback

Description

@jreback

I think s.cat.density is appropriate here

In [1]: s = Series(list('aabbcccc')).astype('category')

In [2]: 100*len(s.cat.categories)/len(s)
Out[2]: 37

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions