join two df in pandas based on column code example Example: merge two dataframes based on column df_outer = pd.merge(df1, df2, on='id', how='outer') df_outer