I am trying to color values of one column in my df based on its values. I tried with only one value but I don't get any colored result. Here is my code
writer = pd.ExcelWriter('resultcolored.xlsx', engine='xlsxwriter')
df.to_excel(writer, sheet_name='Sheet')
workbook = writer.book
worksheet = writer.sheets["Sheet"]
format = workbook.add_format({'bg_color': '#C6EFCE',
'font_color': '#006100'})
worksheet.conditional_format( 'AJ1:AJ10',
{ 'type': 'text',
'criteria': 'containing',
'value': 'Direct',
'format': format
}
)
writer.save()
It saves the file, but doesn't colot any of the values. Can you please help me out?
