I have a case where I have label names as columns of a DataFrame with value 0 or more like below.
.net 2007 actionscript-3 activerecord air ajax
0 0 0 0 1 1 1
1 0 0 0 1 1 1
2 0 0 0 1 1 1
3 2 2 2 2 0 0
4 2 2 2 2 0 0
5 2 2 2 2 0 0
My requirement is to put those column names whose value is more than zero, in a single column seperated by space for each row like below :
0 activerecord air ajax
1 activerecord air ajax
2 activerecord air ajax
3 .net 2007 actionscript-3 activerecord
4 .net 2007 actionscript-3 activerecord
5 .net 2007 actionscript-3 activerecord
Example : values in columns activerecord, air, ajax has value of 1 in first row so these 3 should appear in one column of the dataframe separated by space.
This is an example of multi-label classification.