Suppose I have a dataframe that looks like the following:
df = pd.DataFrame(
{ 'id': [1,2,3,4,5],
'actual':[10,20,30,15,25],
'predicted':[8.9, 17.2, 25.7, 12.3, 21.1]
}
)
df
id actual predicted
0 1 10 8.9
1 2 20 17.2
2 3 30 25.7
3 4 15 12.3
4 5 25 21.1
But I want to transform it to this:
id value status
1 10 actual
1 8.9 predicted
2 20 actual
2 17.2 predicted
3 30 actual
3 25.7 predicted
4 15 actual
4 12.3 predicted
5 25 actual
5 21.1 predicted
Could that be done?