-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: maybe_convert_objects add boolean support with NA #50047
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: maybe_convert_objects add boolean support with NA #50047
Conversation
…ts_nullable_boolean # Conflicts: # pandas/_libs/lib.pyx
encountered, whether to convert and return an IntegerArray. | ||
convert_to_nullable_dtype : bool, default False | ||
If an array-like object contains only integer or boolean values (and NaN) is | ||
encountered, whether to convert and return an Boolean/IntegerArray. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm FloatArray
isn't supported yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I raised in the sql pr as well. Currently, we only use ea, when the regular dtype can’t hold missing values. So there is no real use case for FloatArray.
it would probably make more sense to always convert when this flag is set, but this is out of scope here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I would opt to returning Float64
when people specify use_nullable_dtypes=True
, especially once (hopefully) other core devs find it useful to store NaN
& NA
But sure can be a follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM merge when ready @jbrockmendel
thanks @phofl |
This is necessary for read_sql and nullables.
I could not find a usage of
convert_to_nullable_integer
, so we should be able to repurpose the keyword