-
[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.
-
[ ] I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
>>>pd.Series([pd.NA, 1, pd.NA]).interpolate()
0 <NA>
1 1
2 <NA>
dtype: object
>>>pd.Series([np.nan, 1, np.nan]).interpolate()
0 NaN
1 1.0
2 1.0
dtype: float64
Issue Description
pd.NA results in wrong interpolation result, which is incompatible with the np.nan result.
Expected Behavior
>>>pd.Series([pd.NA, 1, pd.NA]).interpolate()
0 <NA>
1 1
2 1
dtype: Int64
Installed Versions
1.3.4
Comment From: phofl
Hm this looks correct to me. Your series has object dtype, this is consistent with
ser = pd.Series([np.nan, 1, np.nan], dtype=object).interpolate()
If you set the dtype to Int64, this raises as well, because linear is not supported there.