Skip to content

Commit 957f38f

Browse files
committed
BUG: fix pandas-dev#60128 BUG: Series.combine_first loss of precision
- Issue: There was int64->float64->int64 conversions - Fix: Carry out the operation without passing through float64
1 parent 5829e3e commit 957f38f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/frame.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8640,7 +8640,10 @@ def combine(
86408640
"""
86418641
other_idxlen = len(other.index) # save for compare
86428642

8643-
this, other = self.align(other)
8643+
fill_value_for_align = None
8644+
if all(self.dtypes.eq(np.int64)) and all(other.dtypes.eq(np.int64)):
8645+
fill_value_for_align = 0
8646+
this, other = self.align(other, fill_value=fill_value_for_align)
86448647
new_index = this.index
86458648

86468649
if other.empty and len(new_index) == len(self.index):

0 commit comments

Comments
 (0)