Skip to content
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

Empty Categorical has float dtype for .categories #17248

Closed
TomAugspurger opened this issue Aug 14, 2017 · 0 comments
Closed

Empty Categorical has float dtype for .categories #17248

TomAugspurger opened this issue Aug 14, 2017 · 0 comments
Labels
Categorical Categorical Data Type Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Aug 14, 2017

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).

@TomAugspurger TomAugspurger added Categorical Categorical Data Type Dtype Conversions Unexpected or buggy dtype conversions labels Aug 14, 2017
@jreback jreback added this to the 0.21.0 milestone Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

No branches or pull requests

2 participants