Table Of Contents


Enter search terms or a module, class or function name.


Series.combine(other, func, fill_value=None)[source]

Perform elementwise binary operation on two Series using given function with optional fill value when an index is missing from one Series or the other

other : Series or scalar value

func : function

Function that takes two scalars as inputs and return a scalar

fill_value : scalar value

The default specifies to use the appropriate NaN value for the underlying dtype of the Series

result : Series

See also

Combine Series values, choosing the calling Series’s values first


>>> s1 = pd.Series([1, 2])
>>> s2 = pd.Series([0, 3])
>>> s1.combine(s2, lambda x1, x2: x1 if x1 < x2 else x2)
0    0
1    2
dtype: int64
Scroll To Top