df1 = pd.DataFrame({'a':['abc','def'], 'b': [10,20]})
df2 = pd.DataFrame({'a':['def','ghi'], 'c': [10,20], 'd': [10,20], 'e': [10,20]})
pd.concat([df1,df2])
我有两个数据集,想要合并它们,以便“ def”行将不为null的值合并为一行。像这样-
df3 = pd.DataFrame({'a':['abc','def','ghi'], 'b': [10,20,'NaN'],'c': ['NaN',10,20], 'd': ['NaN',10,20], 'e': ['NaN',10,20]})