PERF: avoid casting to float in IntegerArray reducing ops #30436
Labels
ExtensionArray
Extending pandas with custom dtypes or arrays.
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Performance
Memory or execution speed performance
Reduction Operations
sum, mean, min, max, etc.
Currently, we cast to float in the IntegerArray reducing ops:
pandas/pandas/core/arrays/integer.py
Lines 673 to 678 in db62039
However, the
nanops
functions can already handle a mask. So with the appropriate fill_value, there should be no need to cast the integers to float (and check for missing values). At least this is the case forskipna=True
, the case ofskipna=False
might need to be handled separately.The text was updated successfully, but these errors were encountered: