0
$\begingroup$

I have a data like this:

enter image description here

I want to transpose it like this in python:

enter image description here

$\endgroup$
1
  • $\begingroup$ I’m voting to close this question because there is no explanation on what the user already tried $\endgroup$ – Donald S Jul 7 '20 at 6:12
0
$\begingroup$
df.pivot_table(values='Confirmed',index['state','State_name'],columns='date',aggfunc='sum')
$\endgroup$
2
  • $\begingroup$ You just missed a '=' after index. It worked. :) $\endgroup$ – Meet Dave Jul 6 '20 at 7:48
  • $\begingroup$ cool, thanks for the update $\endgroup$ – kappil c Jul 6 '20 at 7:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.