I have a dataframe with the following general layout:
id,ind_1,ind_2_ind_3
1,0,1,0
1,1,0,0
2,0,1,0
2,0,0,1
3,0,0,1
3,1,0,0
I would like to add an additional column whose values are the original indicator names when they are '1' which should look like this:
id,ind_1,ind_2,ind_3,ind_all
1,0,1,0,ind_2
1,1,0,0,ind_1
2,0,1,0,ind_2
2,0,0,1,ind_3
3,0,0,1,ind_3
3,1,0,0,ind_1
Any tips welcome!