I am trying to get a multi level index and column pandas data frame from an excel file, but oddly it seems that it is skipping a row. Consider the following:
This is my code
df = pd.read_excel(r"https://buy-and-hold-strategy.s3.eu-central-1.amazonaws.com/example.xls",
skiprows=2,
sheet_name='Sheet1',
index_col=[0, 1],
header=[0, 1])
df.head()
returns
Out[46]:
b 1 2
sub 0 1 0 1
1 1
1 2 value 1.0 NaN NaN
3 NaN NaN NaN NaN
2 1 NaN NaN text 2.0
2 NaN NaN NaN NaN
3 1 NaN NaN NaN NaN
It seems that the first row of data 1.1 is stored as the index name:
df.index.names
Out[49]: FrozenList([1, 1])

