Skip to content

Empty Categorical has float dtype for .categories #17248

Closed
@TomAugspurger

Description

It'd be more consistent if this had object dtype (and so an Index([]) instead of a Float64Index([]).

In [4]: pd.Categorical([]).categories.dtype
Out[4]: dtype('float64')

I suspect this is just an implementation detail, not intentional.
Came up in #17236 (my rework to remove the keyword).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    CategoricalCategorical Data TypeDtype ConversionsUnexpected or buggy dtype conversions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions