convert dict to xlxs

This commit is contained in:
daovietanh99 2024-01-30 16:34:30 +07:00
parent cd88f3b959
commit 75819d9780

View File

@ -419,7 +419,6 @@ def dict2xlsx(input: json):
for key in mapping.keys(): for key in mapping.keys():
value = get_value(record, mapping[key]) value = get_value(record, mapping[key])
ws[key + str(start_index)] = value ws[key + str(start_index)] = value
print(type(value))
if 'average_accuracy_rate' in mapping[key] and type(value) in [int, float] and value < 95: if 'average_accuracy_rate' in mapping[key] and type(value) in [int, float] and value < 95:
ws[key + str(start_index)].style = normal_cell_red ws[key + str(start_index)].style = normal_cell_red
elif 'average_processing_time' in mapping[key] and type(value) in [int, float] and value > 2.0: elif 'average_processing_time' in mapping[key] and type(value) in [int, float] and value > 2.0: