I just tried this and it seems to work for your sample data:
all_data = []
excel = xlrd.open_workbook(excel_dir+ excel_file)
sheet_0 = excel.sheet_by_index(0)
prev_row = [None for i in range(sheet_0.ncols)]
for row_index in range(sheet_0.nrows):
row= []
for col_index in range(sheet_0.ncols):
value = sheet_0.cell(rowx=row_index,colx=col_index).value
if len(value) == 0:
value = prev_row[col_index]
row.append(value)
prev_row = row
all_data.append(row)
return
[['2', '0', '30'], ['2', '1', '20'], ['2', '5', '52']]
It keeps track of the values ββfrom the previous row and uses them if the corresponding value from the current row is empty.
, , , , . , .
:
, merged_cells, , . , " 0.6.1", xlrd-0.9.3, pip,
NotImplementedError: formatting_info =
xlrd, merged_cells, , , , , , formatting_info=True.