I have a dataframe in set up in this way:
depth | val1 | val2 |
---|---|---|
1 | 0.5 | 0.6 |
2 | 0.4 | 0.7 |
3 | 0.3 | 0.8 |
and I want to get it into this layout:
depth | y | category |
---|---|---|
1 | 0.5 | val1 |
1 | 0.6 | val2 |
2 | 0.4 | val1 |
2 | 0.7 | val2 |
3 | 0.3 | val1 |
3 | 0.8 | val2 |
What's the most efficient way to do this?