Pandas: join DataFrames on field with different names?
Solution 1:
I think what you want is possible using merge
. Pass in the keyword arguments for left_on
and right_on
to tell Pandas which column(s) from each DataFrame to use as keys:
pandas.merge(df1, df2, how='left', left_on=['id_key'], right_on=['fk_key'])
The documentation describes this in more detail on this page.