使用条件格式pd.xlsxwriter比较两个日期

时间:2019-05-03 14:14:16

标签: python-3.x xlsxwriter

我有一个如下数据框。现在,如果到期日期<今天的日期,我需要使用条件格式来用红色突出显示整个行。

我尝试了以下代码,但出现错误,提示未定义“ TODAY”。

date = TODAY()

worksheet.conditional_format('C1:C6', {'type':     'date',
                                   'criteria': 'less than',
                                   'value':    date,
                                   'format':   red})

enter image description here

0 个答案:

没有答案