I have a data frame with one column. Each value in this column is a list. For example,
A
0 [1, 3, 4]
1 [43, 1, 42]
2 [50, 3]
I want to perform the set intersection operation between each list to find common elements and produce a data frame as below.
0 1 2
0 [1, 2, 3] [1] [3]
1 [1] [43, 1, 42] []
2 [3] [] [50, 3]
Is there an elegant way of doing this rather than looping over?