I have data in a pandas DataFrame as shown in Format 1 in the attached image.
I would like to change the layout to Format 2 as specified.
My first thought was to use the pandas pivot_table function but I realize it wouldn't work here because it requires you to specify an aggfunc. In the case of my request, I do not want to aggregate. Instead I want discrete values arranged similar to Format 2.
Any suggestions?
Thanks!