Suppose I have this df:
col1 col2 col3 col4
A B B A
B C C D
D null D null
And a list
list1 = ["A","B","C","D"]
How do I create a new df with the boolean representation of the values of the list as first column if the value is in the old df columns?
Expected output:
list1 col1 col2 col3 col4
A 1 0 0 1
B 1 1 1 0
C 0 1 1 0
D 1 0 1 1