API: fix corner cases of lib.infer_dtype #23421
Labels
Dtype Conversions
Unexpected or buggy dtype conversions
Internals
Related to non-user accessible pandas implementation
Milestone
Encountering this while working on #23167
There a few inconsistencies in
pandas._libs.lib.infer_dtype
, e.g.and similarly for
In the context of object columns, an all-NA column with
skipna=True
should definitely not return'floating'
(imagine a column of strings where all values happen to be missing for a given selection / after a join / whatever). I'd argue that'empty'
all-NA for float-type should also infer to'empty'
in case ofskipna=True
.The
skipna
parameter was introduced in #17066 in v.0.21. As a side note, this also promised that the default will be changed fromFalse
toTrue
. I wonder if this even needs a deprecation cycle as this is explicitly private by being in_libs.lib
.The text was updated successfully, but these errors were encountered: