I have the following list:
var_list = ["Apple", "Banana", "Orange"]
I also have a dataframe that looks like the following:
id var
0 H1 010
1 H2 110
2 H3 111
...
4443 H4443 101
I would like my new data to look like:
id var
0 H1 Banana
1 H2 Apple;Banana
2 H3 Apple;Banana;Orange
...
4443 H4443 Apple;Orange
Note my dataframe has about 4000 rows and the only solution I can think of so far involves iterating through a loop 4000 times which I would like to avoid, if possible :-/
Similar concept of getting the same original dataframe to look like this
id apple banana orange
0 H1 No Yes No
1 H2 Yes Yes No
2 H3 Yes Yes Yes
...
4443 H4443 Yes No Yes
EDIT: var is a FLOAT not a binary string.