I have some data loaded in python with pandas. I also have the following data frame structure
Country Year Subject Value
‘USA’ 1991 ‘GDP’ NUM1
‘USA’ 1992 ‘GDP’ NUM2
‘USA’ 1993 ‘GDP’ NUM3
‘USA’ 1991 ‘INV’ NUM4
‘USA’ 1992 ‘INV’ NUM5
‘USA’ 1993 ‘INV’ NUM6
I want to turn this format into this more standard panel data structure
Country Year GDP INV
‘USA’ 1991 NUM1 NUM4
‘USA’ 1992 NUM2 NUM5
‘USA’ 1993 NUM3 NUM6
Can anybody help me?
Thank you in advance