ENH: Styler.to_string by attack68 · Pull Request #44502 · pandas-dev/pandas (original) (raw)
Adds a basic method for writing Styler to string using the mechanics already in place and a simplified jinja2 template.
With the development of Styler in the last 18 months it has moved away from being purely a tool for adding styles and colors to HTML.
The methods: .hide, .format, .format_index, and the planned set_descriptors and aliases kwarg for format_index, allow one to fully customise the displayed items of row and column indexes, index names, levels, and the data values themselves, for output to any file-format.
This is now used for output to LaTeX as well as HTML, and it seems to be a minimal addition to add a to_string function giving users even further capability. (e.g. #45177)