[英]How can I bold just one column in my dataframe so I can export to an excel?
I have been reading documentation and some questions here, but I only found solutions with conditions, I have some columns in my dataframe that I want to bold and then concatenate.我一直在这里阅读文档和一些问题,但我只找到了有条件的解决方案,我的数据框中有一些列我想加粗然后连接。
My dataframe it´s like this:我的数据框是这样的:
Name姓名 | Product产品 |
---|---|
Paul保罗 | Produc1产品1 |
Jhon琼 | product2产品2 |
I want all the values in my column(Paul, Jhon) to be bold so I can export that to an excel.我希望我的列(Paul,Jhon)中的所有值都是粗体,以便我可以将其导出到 Excel。
Let's try我们试试看
df.style.applymap(lambda x: 'font-weight: bold;', subset='Name')\
.to_excel('output.xlsx')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.