Here is what my data frame looks like
id name val weight
1 x 10 0.3
1 y 5 0.1
1 z 6 -0.7
1 q 7 -0.3
2 t 3 0.5
2 m 2 0.1
2 s 8 -0.8
2 b 9 -0.2
And here is how I would like to look:
id name_pos val_pos weight_pos name_neg val_neg weight_neg
1 x 10 0.3 z 6 -0.7
1 y 5 0.1 q 7 -0.3
2 t 3 0.5 s 8 -0.8
2 m 2 0.1 b 9 -0.2
I can't think of an elegant solution for completing this. My only thoughts are brute force methods.
Any help would be much appreciated.