BUG: The count() API does not consider inf as NA (with pandas.options.mode.use_inf_as_na = True) when dtype is "double[pyarrow]" #52501
Labels
Arrow
pyarrow functionality
Bug
ExtensionArray
Extending pandas with custom dtypes or arrays.
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
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
When create a pandas series with pyarrow type "double[pyarrow]", after setting pd.options.mode.use_inf_as_na = True, the inf values are still counted. Also it returns a numpy int64 type scalar instead of pyarrow double scalar.
Expected Behavior
After setting pd.options.mode.use_inf_as_na = True, above s.count() should return 2 as result.
Installed Versions
Replace this line with the output of pd.show_versions()
The text was updated successfully, but these errors were encountered: