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

ENH: Should pandas.CategoricalDtype use pandas.NA as the sentinel value instead of float('nan') ? #43836

Closed
randolf-scholz opened this issue Oct 1, 2021 · 2 comments
Labels
Categorical Categorical Data Type Enhancement NA - MaskedArrays Related to pd.NA and nullable extension arrays Needs Discussion Requires discussion from core team before further action

Comments

@randolf-scholz
Copy link
Contributor

randolf-scholz commented Oct 1, 2021

Almost all of the the new nullable data types (which are incredibly useful btw.) seem to use pd.NA as the null-value.
However, I noticed that pandas.CategoricalDtype still uses float('nan'), which I suppose is for historical reasons.

Are there any plans - for the sake of consistency - to switch CategoricalDtype's sentinel value to pandas.NA in the future?

@randolf-scholz randolf-scholz added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 1, 2021
@randolf-scholz randolf-scholz changed the title ENH: Should pandas.CategoricalDtype use pandas.NA as the sentinel value instead of float('nan') ? ENH: Should pandas.CategoricalDtype use pandas.NA as the sentinel value instead of float('nan') ? Oct 1, 2021
@debnathshoham debnathshoham added the NA - MaskedArrays Related to pd.NA and nullable extension arrays label Oct 1, 2021
@mroeschke mroeschke added Needs Discussion Requires discussion from core team before further action and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 2, 2021
@jbrockmendel
Copy link
Member

Are there any plans - for the sake of consistency - to switch CategoricalDtype's sentinel value to pandas.NA in the future?

No. I think it's more likely we'll go the opposite direction with #29962

@phofl
Copy link
Member

phofl commented Jan 15, 2023

closing in favour of #50711

@phofl phofl closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Enhancement NA - MaskedArrays Related to pd.NA and nullable extension arrays Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

No branches or pull requests

5 participants