my data frame looks like:
| categoryName | catA | catB |
|---|---|---|
| catA | 0.25 | 0.75 |
| catB | 0.5 | 0.5 |
Where categoryName has String type, and cat* are Double. I would like to add column that will contain value from column which name is in the categoryName column:
| categoryName | catA | catB | score |
|---|---|---|---|
| catA | 0.25 | 0.75 | 0.25 |
| catB | 0.5 | 0.7 | 0.7 |
in the first row 'score' has value from column name 'catA' in the second row 'score' value from column name 'catB' Thank you