I have a dataframe with 1's and 0's which looks like:
Index Variable_1 Variable_2 Variable_3
A 1 0 1
B 0 1 1
C 0 0 1
I also have a list which looks like: {'X','Y','Z'}
I want to replace all '1's in the dataframe with values from the list at random. So the output could look like:
Index Variable_1 Variable_2 Variable_3
A Y 0 X
B 0 Z Y
C 0 0 Z
How can I achieve this?