Hi @empet how to apply colors to values of a dataframe like below:
d = {‘col1’: [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’],
‘col2’: [’’, ‘+1%’, ‘+4%’, ‘-6%’, ‘’, ‘+0%’, ‘+5%’],
‘col3’: [’’ , ‘-2%’, ‘+0%’, ‘+9%’, ‘’, ‘-1%’, ‘+6%’],
‘col4’: [’’, ‘-7.5%’, ‘+3.75%’, ‘+5.2%’, ‘’, ‘-2.34%’, ‘-3.17%’]}
df = pd.DataFrame(d)
I want to color values with ‘-’ as green and others as red apart from first column. I tried solutions mentioned above, but it is randomly coloring the values, not the way I want. Could you please help.