BUG: .map
& .apply
would convert element type for extension array.
#60766
Labels
Apply
Apply, Aggregate, Transform, Map
Bug
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
s
has dtypeInt32Dtype
which can encode nullable integersHowever, when we use
.apply(f)
or.map(f)
, the element passed tof
becomes float, andpd.NA
becomesnp.nan
Expected Behavior
f
should receive unconverted value, as if we are doingf(s.iloc[0])
,f(s.iloc[1])
, ...Installed Versions
tested with Pandas 2.2.3
The text was updated successfully, but these errors were encountered: