File tree Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -4125,16 +4125,24 @@ def combine_first(self, other):
41254125 ----------
41264126 other : DataFrame
41274127
4128+ Returns
4129+ -------
4130+ combined : DataFrame
4131+
41284132 Examples
41294133 --------
4130- a's values prioritized, use values from b to fill holes:
4131-
4132- >>> a.combine_first(b)
4134+ df1's values prioritized, use values from df2 to fill holes:
41334135
4136+ >>> df1 = pd.DataFrame([[1, np.nan]])
4137+ >>> df2 = pd.DataFrame([[3, 4]])
4138+ >>> df1.combine_first(df2)
4139+ 0 1
4140+ 0 1 4.0
41344141
4135- Returns
4136- -------
4137- combined : DataFrame
4142+ See Also
4143+ --------
4144+ DataFrame.combine : Perform series-wise operation on two DataFrames
4145+ using a given function
41384146 """
41394147 import pandas .core .computation .expressions as expressions
41404148
Original file line number Diff line number Diff line change @@ -1764,7 +1764,21 @@ def combine_first(self, other):
17641764
17651765 Returns
17661766 -------
1767- y : Series
1767+ combined : Series
1768+
1769+ Examples
1770+ --------
1771+ >>> s1 = pd.Series([1, np.nan])
1772+ >>> s2 = pd.Series([3, 4])
1773+ >>> s1.combine_first(s2)
1774+ 0 1.0
1775+ 1 4.0
1776+ dtype: float64
1777+
1778+ See Also
1779+ --------
1780+ Series.combine : Perform elementwise operation on two Series
1781+ using a given function
17681782 """
17691783 new_index = self .index .union (other .index )
17701784 this = self .reindex (new_index , copy = False )
You can’t perform that action at this time.
0 commit comments