I think that this also works and can be a bit simpler.
df1 = pd.DataFrame({'A':[1, 3], 'B':[2, 4]}) df2 = pd.DataFrame({'C':[5, 7, 9], 'D':[6, 8, 10]}) pd.merge(df1, df2, left_index=True, right_index=True, how='outer')