Open carlocastoldi opened 1 month ago
Thanks for the report! It looks like we should be overriding the _reduce
method in FloatingArray to properly handle this case. Further investigations and PRs to fix are welcome!
As I checked, the issue occurs only if isinstance(delegate, ExtensionArray) case of Series::_reduce. Despite the skipna is passed to _reductions, it is not applied to mask.
So, to apply skipna=True, the 'isna' need to be applied to 'mask'. So I suggested a PR fixing that.
When I first triaged this issue, I was not aware of #53887. Since pd.isna
does not pick up on the NaN
values, I am wondering if skipna=True
should skip them. Do we think this should wait for #58988?
cc @jorisvandenbossche
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Following #59961, I understand that series/dataframes of FloatingArrays cointaing
np.NaN
values are possible and meant to exists. These very same dataframes/series, however, fail to skipNaN
values when asked to. The above examples outputs:Expected Behavior
Installed Versions