Skip to content

Commit 5c945e1

Browse files
committed
BUG: fill_value not being applied for mixed type frame #2191
1 parent cc099d6 commit 5c945e1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3320,7 +3320,7 @@ def _arith_op(left, right):
33203320
# XXX no good for duplicate columns
33213321
result = {}
33223322
for col in this:
3323-
result[col] = func(this[col].values, other[col].values)
3323+
result[col] = _arith_op(this[col].values, other[col].values)
33243324
else:
33253325
result = _arith_op(this.values, other.values)
33263326

pandas/tests/test_frame.py

+7
Original file line numberDiff line numberDiff line change
@@ -6086,6 +6086,13 @@ def test_combineAdd(self):
60866086
comb = df1.combineAdd(df2)
60876087
assert_frame_equal(comb, df3)
60886088

6089+
# mixed type GH2191
6090+
df1 = DataFrame({'A' : [1, 2], 'B' : [3, 4]})
6091+
df2 = DataFrame({'A' : [1, 2], 'C' : [5, 6]})
6092+
rs = df1.combineAdd(df2)
6093+
xp = DataFrame({'A' : [2, 4], 'B' : [3, 4.], 'C' : [5, 6.]})
6094+
assert_frame_equal(xp, rs)
6095+
60896096
# TODO: test integer fill corner?
60906097

60916098
def test_combineMult(self):

0 commit comments

Comments
 (0)