I am trying to highlight cells when a certain criteria is met but if not, I don't want to add any color. If I try with space, I get the aforementioned error. I can't use white as the cell linings in excel vanish.
Code:
def highlight_cells(val):
color = 'yellow' if val==5.1 else " "
return 'background-color: {}'.format(color)
df1 = df1.style.applymap(highlight_cells)