import seaborn
import pandas
excel=pandas.read_excel(r'E:\pandas练习\成绩单.xlsx')
color_map=seaborn.light_palette('green',as_cmap=True)
a=excel.style.background_gradient(color_map,subset=['test_1','test_2','test_3'])
a.to_excel()
来源:oschina
链接:https://my.oschina.net/u/4356468/blog/4357977