AttributeError: 'Styler' object has no attribute 'merge'

AttributeError: 'Styler' object has no attribute 'merge'

我有这样的问题,当我使用 pandas 设置数据(条件格式)的样式时,我无法合并该数据。您可以在下面找到我的代码和错误, 谁能给我一个建议?

代码:

cm = sns.diverging_palette(10, 140, s=99, l=50,
                              n=9, center="light", as_cmap=True)

df_style1 = df_b.style.background_gradient(cmap=cm)
df_style2 = df_c.style.background_gradient(cmap=cm)
df_last = df_style1.merge(df_style2, on= 'EKSPER_ADI', how='left')

错误:

AttributeError                            Traceback (most recent call last)
 <ipython-input-148-d1b2ae3dc7a6> in <module>
  4 df_style1 = df_b.style.background_gradient(cmap=cm)
  5 df_style2 = df_c.style.background_gradient(cmap=cm)
  ----> 6 df_last = df_style1.merge(df_style1, on= 'EKSPER_ADI', how='left')

 AttributeError: 'Styler' object has no attribute 'merge'

我觉得不行,先用merge再用styles:

df = df_b.merge(df_c, on= 'EKSPER_ADI', how='left')
df_style2 = df.style.background_gradient(cmap=cm)