I am formatting a pandas dataframe with styler to highlight columns and format numbers. I also want to apply multi-index for more clear, pleasant and easy to read. Since I a
Here, is another way:
data.style.background_gradient(cmap=cm, subset=data.columns.get_loc_level('A', level=1)[0])
Output: