为熊猫数据框添加背景色

时间:2020-01-29 14:13:07

标签: python pandas pivot-table

我有一个使用Pandas创建的数据透视表,如下所示: enter image description here

我该如何实现?

1 个答案:

答案 0 :(得分:1)

您可以使用Styler.apply创建样式的DataFrame,并使用ListingEntry通过索引值设置行:

loc