Dataframe 样式未导出到 excel

问题描述 投票:0回答:0

我尝试设计我的数据框

df.style\
    .applymap(add_color,\
             subset=[column names])\
    .format('{0:,.0f}',na_rep='-')

我尝试将此样式存储到 excel 后导出,但未应用任何样式。但是,样式在 jupyter 中有效。

我有一个这样的df

enter image description here

我想要enter image description here

另外,如何在 stackoverflow 中将其复制粘贴为表格而不是图像?

我试图寻找解决方案,但都失败了。

python-3.x dataframe xlsxwriter
© www.soinside.com 2019 - 2024. All rights reserved.