BUG:Getting KeyError when saving style multiindex pandas to excel

When saving a `df` that has been style into excel, compiler return

> KeyError: "['A'] not in index"


    import pandas as pd
    import numpy as np
    
    
    def color_negative_red(value):
      if value < 0:
        color = 'red'
      elif value > 0:
        color = 'green'
      else:
        color = 'black'
    
      return 'color: %s' % color
    
    np.random.seed(0)
    arrays = [np.hstack([['One']*2, ['Two']*2]) , ['A', 'B', 'A', 'B']]
    columns = pd.MultiIndex.from_arrays(arrays)
    df=  pd.DataFrame(np.random.randn(5, 4), columns=list('ABCD'))
    df.columns = columns
    data=df.style.applymap(color_negative_red, subset=['A'])
    
    data.to_excel('test.xlsx')


Expected output

[![enter image description here][1]][1]

p.s. similar post has been post at SO: https://stackoverflow.com/questions/68670375/getting-keyerror-when-saving-style-multiindex-pandas-to-excel


  [1]: https://i.stack.imgur.com/WafAy.png