I have the following sample DataFrame (wherein the real data set, the pattern repeats for many rows). I wish to move the 'Category' 'Section' 'Level' 'Result' from rows to column labels.
The row following are the features of the above, and are
Input Code is representative of the following:
df = pd.DataFrame({'name': ['Joe Bloggs', 'Category',
... 'A', 'Jane Doe', 'Category',
... 'B'],
... 'Date': ['2020-06-19' , 'Section', '1', '2020-06-19',
... 'Section', '2'],
... 'Time': ["09:00:00", "Level", "First", "16:30:06",
... "Level", "Third"],
... 'type': ["Login", "Result",
... "Pass", "Logout",
... "Result", "Fail"]})
Desired Output is as follows:
Many thanks
