pandas to excel 填充色彩 datasave = dataFrame.style.background_gradient(cmap=‘RdBu’,low=1,high=1,axis=0) datasave.to_excel(‘name.xlsx’) RdBu是样式,具体看https://matplotlib.org/examples/color/colormaps_reference.html low和high控制色彩条的使用范围,取正值。low是色彩条中心位置往左的偏移量,high往右 axis=0为按列填充, 1为按行填充