Another fairly common situation is to have two like-indexed (or similarly indexed) Series or DataFrame objects and wanting to “patch” values in one object from values for matching indices in the other. Here is an example:
In [133]: result = df1.combine_first(df2)

可見,combine_first() 方法能夠?qū)崿F(xiàn)數(shù)兩張表的填充,實際使用中非常方便。
Note that this method only takes values from the right DataFrame if they are missing in the left DataFrame. A related method, update(), alters non-NA values in place:
In [134]: df1.update(df2)
