w3resource
Pandas Tutorial

Pandas Series: combine() function

Combine the Series with a Series in Pandas

The combine() function is used to combine the Series with a Series or scalar according to func.

Combine the Series and other using func to perform elementwise selection for combined Series. fill_value is assumed when value is missing at some index from one of the two objects being combined.

Syntax:

Series.combine(self, other, func, fill_value=None)

Parameters:

Name Description Type/Default Value Required / Optional
other The value(s) to be combined with the Series.
Series or scalar value Required
func  Function that takes two scalars as inputs and returns an element. function Required
fill_value The value to assume when an index is missing from one Series or the other. The default specifies to use the appropriate NaN value for the underlying dtype of the Series. scalar optional

Returns: Series
The result of combining the Series with the other object.

Example:


Download the above Notebook from here.