Skip to content

Commit 926723a

Browse files
committed
fixes the issue pandas-dev#22953
1 parent 4976ee1 commit 926723a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/series.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,10 @@ def combine(self, other, func, fill_value=None):
23102310
lv = self.get(idx, fill_value)
23112311
rv = other.get(idx, fill_value)
23122312
with np.errstate(all='ignore'):
2313-
new_values.append(func(lv, rv))
2313+
if(np.isnan(func(lv, rv))):
2314+
new_values.append(fill_value)
2315+
else:
2316+
new_values.append(func(lv, rv))
23142317
else:
23152318
# Assume that other is a scalar, so apply the function for
23162319
# each element in the Series

0 commit comments

Comments
 (0)