章节总览

本章介绍 DataFrame.style 返回的 Styler 对象,涵盖 格式化方法 与 样式函数,以及最终的 导出 能力。

目录

笔记内容
22.4 DataFrame.styleStyler 对象概述
22.2 格式化方法format / hide / set_properties / apply 等
22.3 样式函数highlight_null / bar / background_gradient 等
22.1 导出to_html / to_excel / to_latex / to_string

核心速览

  • df.style 返回 Styler 对象,所有方法返回自身,支持链式调用
  • format() 控制单元格显示格式,不改动底层数据
  • apply() / map() 支持自定义样式函数
  • 导出时可保留样式(HTML / Excel / LaTeX)

相关章节

4 items under this folder.