我有以下算法来解析整数值的列:
def getddr(ws):
address = []
col_name = 'C'
start_row = 4
end_row = ws.get_highest_row()+1
range_expr = "{col}{start_row}:{col}{end_row}".format(col=col_name, start_row=start_row, end_row=end_row)
for row in ws.iter_rows(range_string=range_expr):
print row
raw_input("enter to continue")
cell = row[0]
if str(cell.value).isdigit:
address.append(cell.value)
else:
continue
return address
这在说“IndexError:元组索引超出范围”时崩溃cell = row[0]
,我不知道这是什么意思。我尝试打印行以查看它包含的内容,但它给我的只是一组空括号。有人知道我错过了什么吗?