I have the data in the Pandas DataFrame in the below format:

Now I want to convert it into the below format with pandas:

Can someone please help.
The data should be for all the Referrer Type with the count and Device Type will contain the Column headers.