I need to style a Dataframe:
df = DataFrame({'A':['Bob','Rob','Dob'],'B':['Bob', 'Rob','Dob'],'C':['Bob','Dob','Dob'],'D':['Ben','Ten','Zen'],'E':['Ben','Ten','Zu']})
df
A B C D E
0 Bob Bob Bob Ben Ben
1 Rob Rob Dob Ten Ten
2 Dob Dob Dob Zen Zu
I need to compare columns - A,B, C at once to check if they are equal and then apply a highlight/color to unequal values. Then I need to compare columns D,E to check if they are equal and then apply a highlight/color to unequal values
like:
df[['A','B','C']].eq(df.iloc[:, 0], axis=0)
A B C
0 True True True
1 True True False
2 True True True
I am unable to apply df.style with a subset of df and then concat.