Style#

通过 pandas.DataFrame.style 返回 Styler 对象。

Styler 构造函数#

Styler(data[, precision, table_styles, ...])

使用 HTML 和 CSS 根据数据对 DataFrame 或 Series 进行样式设置。

Styler.from_custom_template(searchpath[, ...])

用于创建 Styler 子类的工厂函数。

Styler 属性#

样式应用#

Styler.apply(func[, axis, subset])

逐列、逐行或逐表应用 CSS 样式函数。

Styler.map(func[, subset])

逐元素应用 CSS 样式函数。

Styler.apply_index(func[, axis, level])

逐级别地将 CSS 样式函数应用于索引或列标题。

Styler.map_index(func[, axis, level])

逐元素地将 CSS 样式函数应用于索引或列标题。

Styler.format([formatter, subset, na_rep, ...])

格式化单元格的文本显示值。

Styler.format_index([formatter, axis, ...])

格式化索引标签或列标题的文本显示值。

Styler.format_index_names([formatter, axis, ...])

格式化索引名称或列名称的文本显示值。

Styler.relabel_index(labels[, axis, level])

重新标记索引或列标题键,以显示一组指定的数值。

Styler.hide([subset, axis, level, names])

从显示中隐藏整个索引/列标题,或隐藏特定的行/列。

Styler.concat(other)

附加另一个 Styler 以将输出合并到一个表中。

Styler.set_td_classes(classes)

设置 <td> HTML 元素的 class 属性。

Styler.set_table_styles([table_styles, ...])

设置包含在 `