excel_file = 'testfile.xlsx'
sheet_name = 'Sheet1'
writer = pd.ExcelWriter(excel_file, engine='xlsxwriter')
df.to_excel(writer, sheet_name=sheet_name)
workbook = writer.book
worksheet = writer.sheets[sheet_name]
worksheet.conditional_format('B2:B8', {'type': '3_color_scale'})
writer.save()
Самый простой способ создать цветовой градиент в excel с помощью python/pandas?