How to Transpose dataframe with custom output? I have a data like this:

I want to transpose it like this in python:
df.pivot_table(values='Confirmed',index['state','State_name'],columns='date',aggfunc='sum')