2017-10-05 296 views

回答

1

使用append這樣做即

df2.append(df1) 

輸出:

 
    name surname 
0 james  NaN 
0 jane  doe 
1 john  doe 

爲了您預期的輸出,你可以做

df2.append(df).apply(sorted,key=pd.isnull).fillna('') 
 
    name surname 
0 james  doe 
0 jane  doe 
1 john