I have two data sets df1,df2
> df1
x1 y1
1 5
1 2
1 3
1 10
> df2
x2 y2
4 8
4 7
4 9
4 3
I want to match y1
in df1
with y2
in df2
,if there are shared values between them ,I will merge the two data sets
in my EX ,y1
contains 3
and y2
contains 3
, so the result will be :
> df3
x1 y1
1 5
1 2
1 3
1 10
4 8
4 7
4 9
4 3
the merger should be based the condition (shared values only) between y1&y2
, otherwise no