Question:
I’d like to groupby pandas dataframe on two different columns on two different axes, however, struggling to figure it out Sample code:.resample
because then I loose all the names:Answer:
You can usedf.pivot
to get this (I have added in a group by following from comments saying pivot causes an error), using the below:To correct this, you can just set all the columns to be ‘numbers’ using the below:
If you have better answer, please add a comment about this, thank you!