From 926723aa4f78625bb56fa2e520be7882fb3b3d2d Mon Sep 17 00:00:00 2001 From: vvyomjjain Date: Fri, 5 Oct 2018 12:30:52 +0530 Subject: [PATCH] fixes the issue #22953 --- pandas/core/series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index a613b22ea9046..16a49ec970e80 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2310,7 +2310,10 @@ def combine(self, other, func, fill_value=None): lv = self.get(idx, fill_value) rv = other.get(idx, fill_value) with np.errstate(all='ignore'): - new_values.append(func(lv, rv)) + if(np.isnan(func(lv, rv))): + new_values.append(fill_value) + else: + new_values.append(func(lv, rv)) else: # Assume that other is a scalar, so apply the function for # each element in the Series