I have a dataframe as below:
ID match set
1 [1,2]
2 [1,2,3]
3 [2,3]
4 [4]
I want to compare between rows and add the missing value if any one of the value in list is present in another list
example - in first row since the values [1,2] is present in second row [1,2,3], get the missing value and add to list in first row
output
ID match set
1 [1,2,3]
2 [1,2,3]
3 [1,2,3]
4 [4]