I have data that looks like the following Pandas datafame:
residue aa residue
L37 N 2.0
L37 A 3.0
L37 M 4.0
L37 R 5.0
L38 N 12.0
L39 A 13.0
L40 M 14.0
L41 R 15.0
...
I am trying to re-orient the data such that it looks more like a 2D matrix:
N A M R
L37 2.0 3.0 4.0 5.0
L38 12.0 13.0 14.0 15.0
...
The only way I can think to to this is to create a 2D array a loop over each line. It seems like Pandas might have a better way though, so I am looking for any pointers that someone could help me with.
Can anyone point me in the correct direction for using Pandas to convert the "row-based" data to "matrix-based" data?