Pandas long to wide reshape, by two variables
A simple pivot might be sufficient for your needs but this is what I did to reproduce your desired output: Just adding a within group counter/index will get you most of the way there but the column labels will not be as you desired: To get closer to your desired output I added the following: … Read more