Int64Dtype conversion seems to casts to double first in the Series constructor #25880
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
ExtensionArray
Extending pandas with custom dtypes or arrays.
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Constructing a
Series
withdtype=Int64Dtype()
suggests that there can be an intermiediate conversion to double if the input containsNaN
s:In both latter cases we end up with a
Series
withdtype=Int64
containing integer NaNs. However, in the penultimate case we get the int-float-int converted value ofn
(4611686018427387904), and we only get the exactInt64
result (4611686018427387909) if we instantiate theSeries
withdtype=object
and convert afterward.This doesn't happen if the input doesn't contain any
NaN
s:Expected output is
4611686018427387909
inside theSeries
constructed withdtype=Int64Dtype()
.Issue is there in master.
The text was updated successfully, but these errors were encountered: