I have a dataframe with some column containing comma separated strings:
colA colB
1 a,b,c,ñ d,b,e
2 f,g,h f,g,m,p
3 i,j,k f,o,j
I would like to get common elements between both columns corresponding to the same row. So my desired output is:
colA colB
1 b b
2 f,g f,g
3 j j
I was trying to transform this columns to lists of lists to perform an intersection after that, but I am having some problems, so I would like to know if there is something easier. How can I get this?