I want to collapse some variables into a single variable if the variable value is True
Eg: Data set
- A B C D E F
- F T F F...
- F F T F..
- F F F T..
- T F F F..
- F F F F....
The output I am looking for
- New_variable
- B
- C
- D
- A
- .
As you can see if the row value is true I would like to replace it with its corresponding column value.
Thank you,