pandas.Series.combine_first¶
-
Series.
combine_first
(other)[source]¶ Combine Series values, choosing the calling Series’s values first. Result index will be the union of the two indexes
Parameters: other : Series Returns: combined : Series See also
Series.combine
- Perform elementwise operation on two Series using a given function
Examples
>>> s1 = pd.Series([1, np.nan]) >>> s2 = pd.Series([3, 4]) >>> s1.combine_first(s2) 0 1.0 1 4.0 dtype: float64