Have a dataframe for which I've created the boolean column 'Late Submission', where 'True' means it was late and 'False' is on-time.
I want to highlight 'True' rows in red and 'False' in green but I can't seem to get it working as I'm still pretty new to Python. I've tried the code below, any ideas why it's not working?
def highlight_late(s):
if s['Late Submission'] == True:
return 'background-color: red'
elif s['Late Submission'] == False:
return 'background-color: green'
df7.style.apply(highlight_late, axis = 1)
The error given is:
Result has shape: (281556,)
Expected shape: (281556, 6)
Thanks in advance

