You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use pandas_loader.to_dataframe with an incompletely filled sheet, I get a IndexError: list index out of range . This is because a Cell perhaps with values of row start and end being 1, and column of 1 will only have one value in the value list, but when calling that value the extract_cell_data goes to value[1]. This only happens (I think) because when defining the sheet, I defined my first row as a list and then defined the other cells via the column.
I modified my code with the following replacement to extract_cell_data to partially fix this.
def extract_cell_data_new(cell, data):
value = cell.value
if cell.row_start == cell.row_end:
col = cell.column_start
row = cell.row_start
for v in value:
data[row][col]['value'] = v
data[row][col]['options']['type'] = cell.type
col = col+1
else:
row = cell.row_start
col = cell.column_start
for v in value:
data[row][col]['value'] = v
data[row][col]['options']['type'] = cell.type
row = row+1
The text was updated successfully, but these errors were encountered:
Exactly the same problem. Just using an intuitive way to create a sheet, populate first row with headers then fill with data.
Toggle the commented line to replicate the error.
When trying to use pandas_loader.to_dataframe with an incompletely filled sheet, I get a
IndexError: list index out of range
. This is because aCell
perhaps with values of row start and end being 1, and column of 1 will only have one value in thevalue
list, but when calling that value theextract_cell_data
goes to value[1]. This only happens (I think) because when defining the sheet, I defined my first row as a list and then defined the other cells via the column.I modified my code with the following replacement to
extract_cell_data
to partially fix this.The text was updated successfully, but these errors were encountered: