I have two data frames:
df1 =
a b
1 555
2 555
4 555
4 555
5 555
6 555
7 555
8 555
15 555
1 555
And
df2 =
a b
2 666
2 666
3 666
4 666
5 666
2 666
3 666
9 666
I want to find same values of column a between two data frames and put them into new data frame (also with values of other columns. Here is b)
Desired output is:
df3 =
a b
2 555
2 666
2 666
4 555
4 555
4 666
…
And so on.
I have tried:
df3= pd.merge(df1, df2, on=['a'], how='inner')
but it gives me something different