merged = pd.concat((df1, d_teams), axis=1)
df2i = df2.set_index('team')
merged['win_A'] = df2i.ix[merged.team_A].reset_index().win_A_B
merged['win_B'] = df2i.ix[merged.team_B].reset_index().win_A_B
How to merge 2 complicated data frames in python pandas?