I am currently able to change the background of a cell using the following code:
def my_func_blue(val):
if val in techniques:
color = 'green'
return f'background-color: {color}'
elif val in Fulltechniques:
color = 'red'
return f'background-color: {color}'
s = df1.style.applymap(my_func_blue)
s
I want to be able to add another IF statement into
"if val in techniques"
so if the occurrence is MORE THAN 1 it applies the colour:
DF:
Technique_Name Technique_ID SOC Alarm Occurance
0 Sudo and Sudo Caching T1548.003 002 1
1 Elevated Execution with Prompt T1548.004 003 1
13 Cloud Account T1087.004 015 2
14 Cloud Account T1087.004 032 2
15 Account Manipulation T1098 016 1
So only the cell which contains Cloud Account would have the background colour of Green