I want to change the background styling color of the pandas table.
Example:
df = pd.DataFrame({
'group': ['A','B','C','D'],
'var1': [38, 1.5, 30, 4],
'var2': [29, 10, 9, 34],
'var3': [8, 39, 23, 24],
'var4': [7, 31, 33, 14],
'var5': [28, 15, 32, 14]
})
df.set_index('group', inplace=True)
I want the background color of the index cell (and just the index cell) A,C in blue and B,D in red.
I looked at the styling documentation but I could not find an example that matches this case.


