Pandas version checks
- [X] I have checked that the issue still exists on the latest versions of the docs on
main
here
Location of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.Series.fillna.html?highlight=fillna#pandas.Series.fillna
https://pandas.pydata.org/docs/reference/api/pandas.Int32Dtype.html?highlight=int32#pandas.Int32Dtype
Documentation problem
version 1.3.5: cannot safely cast non-equivalent float64 to Int32
version 1.5.2 : Invalid value '1.1' for dtype Int32
Suggested fix for documentation
IntDtype automatically converts to float
Comment From: phofl
Hi, thanks for your report. Do you wish for this to work or should we adjust the documentation?
This errors on purpose, so is not considered a bug.
Comment From: rhshadrach
There is an inconsistency here with other dtypes; float64 will coerce to object:
ser = Series([1, 2, np.nan])
print(ser.fillna('x'))
# 0 1.0
# 1 2.0
# 2 x
# dtype: object
Comment From: phofl
Numpy dtypes upcast while our own nullable dtypes raise when setting incompatible values
Comment From: phofl
Duplicate of #44289