-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: support pd.NA in "category" dtype #47982
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
Hi, thanks for your report. We already have this, through string-dtype:
|
Related to #29962 |
Thanks for your reply @phofl - I didn't quite appreciate how the category "type" sat on top of the actual type of the data. Thanks for linking @mzeitlin11 - good to see I'm not the only one who didn't find this entirely intuitive at first pass. |
This is also a rather interesting problem for discussion under the scope of #58988 Going to reopen to track this - having to go the >>> pd.DataFrame({"A": ["one", "two", pd.NA]}, dtype="category")
A
0 one
1 two
2 NaN |
Uh oh!
There was an error while loading. Please reload this page.
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
I would like to be able to use
pd.NA
for missing data in a column of dtype "category"Currently this:
converts the
pd.NA
tonp.NaN
.Feature Description
I think there should be a "category" dtype that supports
pd.NA
.Alternative Solutions
I don't think there is a current workaround
Additional Context
No response
The text was updated successfully, but these errors were encountered: