用法:
Styler.set_properties(self, subset=None, **kwargs)
设置一个或多个非数据相关属性或每个单元格的方法。
参数:
- subset:IndexSlice
的有效切片
data
限制样式应用程序。- **kwargs:dict
属性字典,为每个单元格设置值对。
返回值:
- self:造型器
例子:
>>> df = pd.DataFrame(np.random.randn(10, 4)) >>> df.style.set_properties(color="white", align="right") >>> df.style.set_properties(**{'background-color': 'yellow'})
源码:
pandas.io.formats.style.Styler.set_properties的API实现见:[源代码]
注:本文由纯净天空筛选整理自 pandas.io.formats.style.Styler.set_properties。非经特殊声明,原始代码版权归原作者所有,本译文的传播和使用请遵循“署名-相同方式共享 4.0 国际 (CC BY-SA 4.0)”协议。