-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
INT: include NA values in Categorical.categories #37930
Comments
we don't allow na values in the constructor by definition so this should be unambiguous |
which constructor doesnt allow NA values? I can do
|
check the categories |
When Categorical was originally added, it did support missing values in its categories (which means there are basically two ways to have missing values: a -1 in the codes, or a missing value in the categories). But shortly after, we changed that only allow a single way, i.e -1 in the codes, and thus disallow missing values in the categories. General constructors like
|
There's another issue somewhere discussing this, but I can't find it right now. At the time, we (I?) decided against including NA-like values in the categories. |
I'm not finding it either, but i think there was something about trying to a specific NA value or possibly multiple distinct NA types. |
There are a bunch of places in CategoricalIndex where we check something like:
This leads to ambiguity, as a -1 code can indicate an NA value that is present, or a non-NA value that is not among self.categories. Having to sort out which we're looking at is a hassle which we should try to avoid.
The text was updated successfully, but these errors were encountered: