How can I merge multiple columns into one column in pandas?
I have this table:
ID | A | B | C | D
1 1 1 0 3
2 1 0 1 2
3 0 0 1 8
I want to get this table:
ID | X | D
1 A 3
1 B 3
2 A 2
2 C 2
3 C 8
I want to merge column A,B,C into column X based on their values. If one id has multiple true (1) values merging columns (A/B/C) there will be a new row copy of that id.