0

Could you please advise how to transpose this kind of pandas dataframe

enter image description here

to the following

enter image description here

Thank you

I tried to df.groupby(['time', 'labels', 'agg']).sum().transpose().stack(0).reset_index() but it does not give what's needed

Ynjxsjmh
  • 28,441
  • 6
  • 34
  • 52

0 Answers0