I have a dataframe that looks like this:
Names Company Values Period
HeadCount Google 1000 1
HoursWorked Google 500 1
HeadCount Microsoft 600 1
HoursWorked Microsoft 200 1
HeadCount Google 2000 2
HoursWorked Google 100 2
I'd like to transform this dataframe to something like this:
Company Period HeadCount HoursWorked
Google 1 1000 500
Google 2 2000 100
Microsoft 1 600 200
Is there a way to take the columns pivot them, but also group by the company period and have a dataframe that looks like that?