我需要从manualy制作的excel中读几张表。在这里,我找到了一个解决方案:
pandas read_excel multiple tables on the same sheet
但它并没有解决我的整个问题,因为我的一些表有多索引列名。我试过这种方式:excel example
nrows = excel_file.book.sheet_by_index(0).nrows
table2 = excel_file.parse(0, skiprows=6, skip_footer=nrows - 11, header=[0,1,2]).dropna(axis=1, how='all')
在这种情况下,我有" ValueError:新名称的长度必须为1,得到3"
我发现如果我的excel文件看起来像这样:modified excel file (没有其他表中的列比我读的表长),那么它的工作原理!我该如何解决这个问题?