fastexcel
fastexcel copied to clipboard
header_row does not work as expected if there are blank rows
If I put expect the header on e.g. row index 15, but there are blank rows (at least at the beginning of the sheet), I cannot do header_row=15
. It looks like they are ignored, so I have to put in a lower index.
Hello! can you please provide an excel sheet example?
I will try to create a basic sheet to reproduce. It seems the issue is not actually with blank rows, but there is some other reason I am having to put in a much lower index than I expect.
It looks like it does have to do with empty rows in some case.. not exactly clear to me, but it's very easy to reproduce with this file:
I have the header row on row 8 (0-based; 9 in excel) but have to specify it as 6. You can also remove that "Note 1" cell to change things.
def test_row_issue():
reader = read_excel("...TestFastExcelRead.xlsx")
ws = reader.load_sheet("Sheet1", header_row=6)
df = ws.to_pandas()
I'll try to dig into it this weekend
seem related to #209
see https://github.com/ToucanToco/fastexcel/issues/209#issuecomment-2239211891