Skip to content

PERF: rendering of large number of categories #11305

Closed
@jreback

Description

@jreback

xref #11304

items = [str(i) for i in range(40000)]
s = pd.Series(items, dtype='category')
df = pd.DataFrame({'C':s, 'data':np.random.randn(40000)})
data = df[df.C=='20']
str(data.C)

This renders the string of all of the categories before chopping them, see here

This should check for a large number of categories first, then render the chopped portions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CategoricalCategorical Data TypeOutput-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions