-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: CategoricalDtype str, repr #17782
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
Comments
hmm, I only think you do do that for a |
Any reason you would do it just for when categories is None categories? To be clear, in most places like the output in the console, in the Series / DataFrame repr, you'll still have the informative CategoricalDtype(categories=...) repr. It's only when you call |
Possible option is also to only change |
Ah, I see that is what you have done in the PR (and stated in the top post)! :-) Should have looked there first and read better. |
I think that
str(cat.dtype)
should be changed back to always being 'category'. I've seen several places where people usestr(thing.dtype) == 'category'
as a way to check for Categoricals. Even subtle things like this arrow PR would break.So instead of
it would be
We can leave
__repr__
to be unambiguous.The text was updated successfully, but these errors were encountered: