I’ve got some radar data that’s in a bit of an odd format, and I can’t figure out how to correctly pivot it using the pandas library.
My data:
speed time
loc
A 63 0000
B 61 0000
C 63 0000
D 65 0000
A 73 0005
B 71 0005
C 73 0005
D 75 0005
I’d like to turn that into a DataFrame that looks like this:
0000 0005
loc
A 63 73
B 61 71
C 63 73
D 65 75
I’ve done a lot of fiddling around but can’t seem to get the syntax correct. Can anyone please help?
Thanks!
You can use the pivot method here: