我正在使用 df.style.applymap 来呈现熊猫数据框。我选择了样式而不是 to_html,因为我需要根据某些列值应用 css。挑战是我想从显示中排除其中一列。因此,使用以下代码:
html = df.style.applymap(color_cell, subset=['columnName']).render()
with open('output.html', 'w') as f:
f.write(html)
有没有办法可以排除/隐藏我需要为其他列设置样式的列?