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 @@ -4131,16 +4131,24 @@ def combine_first(self, other):
41314131 ----------
41324132 other : DataFrame
41334133
4134+ Returns
4135+ -------
4136+ combined : DataFrame
4137+
41344138 Examples
41354139 --------
4136- a's values prioritized, use values from b to fill holes:
4137-
4138- >>> a.combine_first(b)
4140+ df1's values prioritized, use values from df2 to fill holes:
41394141
4142+ >>> df1 = pd.DataFrame([[1, np.nan]])
4143+ >>> df2 = pd.DataFrame([[3, 4]])
4144+ >>> df1.combine_first(df2)
4145+ 0 1
4146+ 0 1 4.0
41404147
4141- Returns
4142- -------
4143- combined : DataFrame
4148+ See Also
4149+ --------
4150+ DataFrame.combine : Perform series-wise operation on two DataFrames
4151+ using a given function
41444152 """
41454153 import pandas .core .computation .expressions as expressions
41464154
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