I have a dataset with unique ID with columns which have several bool values for each ID. Therefore, I need to convert these columns into a single categorical variables concatenating multiple true bool values. And if out of mentioned bool ID have 3 true values we assign to categories as "Win"
ID | BoolCol_1 | BoolCol_2 | BoolCol_3 | BoolCol_4 | Other Col 1 | Other Col 2 |
---|---|---|---|---|---|---|
1 | 1 | 2 | 2 | 1 | x | Y |
2 | 2 | 1 | 1 | 1 | A | b |
1 -> True 2 -> False
ID are unique.
I am not able to think in my head how to solve this puzzle
Use the following approach:
Now
cat_col
is categorical column with fixed valuesW
(win),L
(lose)