BUG: DataFrame float reductions with object input #49618
Labels
Closing Candidate
May be closeable, needs more eyeballs
DataFrame
DataFrame data structure
Dtype Conversions
Unexpected or buggy dtype conversions
Needs Discussion
Requires discussion from core team before further action
Reduction Operations
sum, mean, min, max, etc.
By "float reduction", I mean any reduction that would coerce bool or int to float - e.g. mean, std, skew, kurt.
Along with bool and int, we also coerce object to float:
The reason we cast bool / int to float is to make the resulting dtype not value-dependent. However it's not clear to me if this is the correct thing to do with object. I think I would have expected to get object dtype back.
This was noticed because of the following inconsistency:
In the case of an empty frame with columns, we do end up with object dtype.
The text was updated successfully, but these errors were encountered: