I want to change below dataframe to dataframe that remarks some pairs like this: Is that possible? if so, could you share how I can make this or which concept do I need to find.
Thanks in advance
From :
x a b c d e f g label
1 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
2 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0
3 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0
To :
x tag label
1 a 0.0
2 f 0.0
3 d 1.0