I have a data frame with the following columns
col1 col2 col3
a b b
c d e
e a b
I need to make a new data frame with the unique values and corresponding column names (keep set(list) of column names where value occurs in multiple columns). So output would be:
name col_name
a [col1, col2]
b [col2, col3]
c [col1]
d [col2]
e [col1, col3]
How can I construct this from the given data frame?