I have a csv file like so:
Id col1 col2 col3
a 7.04 0.3 1.2
b 0.3 1.7 .1
c 0.34 0.05 1.3
d 0.4 1.60 3.1
I want to convert it to a data frame thresholding on 0.5 . If the values is greater than or equal to 0.5 then the column is counted , otherwise it is not counted.
Id classes
a col1,col3
b col2
c col3
d col2,col3
The closest solution I found is this one. However it deals with single rows, not multiple rows. For multiple rows, the best I have is iterate through all the rows. I need a succinct expression without for loop.