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.
-
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
ser = pd.Series([i / 10 for i in range(1, 20)]).astype(pd.Float64Dtype())
ser.rolling(2).mean().dtype # dtype('float64')
Issue Description
#Rolling.mean
prematurely downcast from extension-array type dtypes
Expected Behavior
That (in this example) the Float64Dtype
is preserved
Installed Versions
Comment From: phofl
Hi, thanks for your report. This is already known and on our list. Rolling does not support extension arrays yet, hence we have to cast to numpy dtypes
Comment From: bollard
Ah understood, thanks. Is there anywhere I can track this?
Comment From: phofl
Not sure, if we have an appropriate issue about this. If not, a tracker issue like ENH: Add masked support for rolling operations would be welcome
Comment From: bollard
Done https://github.com/pandas-dev/pandas/issues/50449. Thanks!
Comment From: phofl
Thx, this is more helpful than a couple of different issues where every one of them lists a different method