A simple merge using df.merge
does this:
df1.merge(df2, on=['A'])
A B_x B_y
0 a 1 3
1 a 1 4
2 a 2 3
3 a 2 4
4 b 1 3
5 b 2 3
2
solved Merging two dataframes in python pandas [duplicate]
A simple merge using df.merge
does this:
df1.merge(df2, on=['A'])
A B_x B_y
0 a 1 3
1 a 1 4
2 a 2 3
3 a 2 4
4 b 1 3
5 b 2 3
2
solved Merging two dataframes in python pandas [duplicate]