I have a pandas dataframe like this where head wise amounts are available for all categories:
Table depicting category wise head wise values where the heads are in the columns
Now, I want a pandas function to return a dataframe like the image below where the head wise values will appear as rows for each category:
Table where all the heads for a particular category appears as a separate row instead of column