我正在将大型Excel文件读入case类,每个类中的黑白6-12个字段,是否有比以下更好的方法来处理openpyxl中的空单元格:
from openpyxl import load_workbook
from datetime import date
wb = load_workbook('report.xlsx')
ws = wb['data']
for row in ws.iter_rows():
id1= row[0].value if row[0].value is not None else 0
id2 = row[1].value if row[1].value is not None else 0.0
id3 = row[2].value if row[2].value is not None else ""
谢谢