Question

I have a data like this:

enter image description here

I want to transpose it like this in python:

enter image description here

Was it helpful?

Solution

df.pivot_table(values='Confirmed',index['state','State_name'],columns='date',aggfunc='sum')
Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange
scroll top