I have a pandas df with the columns "Item","Year","Value" which has 708 rows. I want to reshape this into a df with 59 rows and 12 columns. This is what it looks like now (simplified):
Item, Year, Value
Apple, 2001, 5
Apple, 2002, 4
Apple, 2003, 7
Apple, 2004, 2
Orange, 2001, 1
Orange, 2002, 5
Orange, 2003, 2
Orange, 2004, 3
And the result I need is:
Year, Apple, Orange
2001, 5, 1
2002, 4, 5
2003, 7, 2
2004, 2, 3
How can I go about achieving this? Thank you!