It contains four to five merged blank cells. They must be formatted so that a column is formed for each merged cell.
Please find the link for the Sample file and also the output required below
Code so far:
dfs = pd.read_excel('/Users/john/Desktop/Internal/Raw Files/Med/TVS/sample.xlsx',sheet_name=None, header=[0,4], index_col=[0,1])
df_2 = (pd.concat([df.stack(0).assign(name=n) for n,df in dfs.items()])
How do I create multiple columns in the above code? Right now i'm getting the below error:
ValueError: Length of names must match number of levels in MultiIndex.