风格#

Styler 对象由返回 pandas.DataFrame.style

Styler构造函数#

Styler \(数据[, precision, table_styles, ...] )

使用HTML和CSS根据数据帮助设置DataFrame或Series的样式。

Styler.from_custom_template \(搜索路径[, ...] )

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

样式器属性#

Styler.env 

Styler.template_html 

Styler.template_html_style 

Styler.template_html_table 

Styler.template_latex 

Styler.template_string 

Styler.loader 

风格应用#

Styler.apply \(函数[, axis, subset] )

按列、按行或按表应用css样式函数。

Styler.applymap \(函数[, subset] )

以元素方式应用一个css样式函数。

Styler.apply_index \(函数[, axis, level] )

对索引或列标题逐级应用css样式函数。

Styler.applymap_index \(函数[, axis, level] )

对索引或列标题按元素应用css样式函数。

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

设置单元格的文本显示值的格式。

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

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

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

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

Styler.concat \(其他)

追加另一个样式器以将输出合并到单个表中。

Styler.set_td_classes \(类)

设置添加到 class 的属性 <td> Html元素。

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

设置包含在 <style> Html元素。

Styler.set_table_attributes \(属性)

设置添加到 <table> Html元素。

Styler.set_tooltips \(tTips[, props, css_class] )

将字符串的DataFrame设置为 Styler 生成 :hover 工具提示。

Styler.set_caption \(标题)

设置添加到 <caption> Html元素。

Styler.set_sticky \([axis, pixel_size, levels] )

添加css以在滚动框架中永久显示索引或列标题。

Styler.set_properties \([subset] )

将定义的css属性设置为 <td> 给定子集中的HTML元素。

Styler.set_uuid \(UUID)

设置应用于的UUID id HTML元素的属性。

Styler.clear \()

重置 Styler ,删除以前应用的所有样式。

Styler.pipe \(函数,*args, * *kwargs)

应用 func(self, *args, **kwargs) ,并返回结果。

内置样式#

Styler.highlight_null \([color, subset, ...] )

使用样式突出显示缺少的值。

Styler.highlight_max \([subset, color, axis, ...] )

突出显示样式的最大值。

Styler.highlight_min \([subset, color, axis, ...] )

用一种样式突出最小值。

Styler.highlight_between \([subset, color, ...] )

使用样式亮显已定义的范围。

Styler.highlight_quantile \([subset, color, ...] )

使用样式高亮显示由分位数定义的值。

Styler.background_gradient \([cmap, low, ...] )

以渐变样式为背景上色。

Styler.text_gradient \([cmap, low, high, ...] )

以渐变样式为文本上色。

Styler.bar \([subset, axis, color, cmap, ...] )

在单元格背景中绘制条形图。

样式导出和导入#

Styler.to_html \([buf, table_uuid, ...] )

将Styler写入HTML-CSS格式的文件、缓冲区或字符串。

Styler.to_latex \([buf, column_format, ...] )

将Styler写入LaTeX格式的文件、缓冲区或字符串。

Styler.to_excel \(EXCEL_编写器[, sheet_name, ...] )

将Styler写入Excel工作表。

Styler.to_string \([buf, encoding, ...] )

以文本格式将Styler写入文件、缓冲区或字符串。

Styler.export \()

导出应用于当前样式器的样式。

Styler.use \(样式)

设置当前样式器上的样式。