I have a lab report in excel which contain multiple level of header and multiple variables as well,
enter image description here
I'd like to unpivot it to a flat table with pandas into the format shown as in the picture below, can someone help?
I have a lab report in excel which contain multiple level of header and multiple variables as well,
enter image description here
I'd like to unpivot it to a flat table with pandas into the format shown as in the picture below, can someone help?
You can read it into a dataframe, see exactly how in this answer: reading excel sheet as multiindex dataframe through pd.read_excel()
And then stack your dataframe with df.stack()
.