Skip to content

ENH: Styler.to_string #44502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 66 commits into from
Jan 8, 2022
Merged

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Nov 17, 2021

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)

# Conflicts:
#	pandas/io/formats/templates/html_table.tpl
# Conflicts:
#	pandas/io/formats/style_render.py
# Conflicts:
#	pandas/io/formats/style.py
#	pandas/io/formats/style_render.py
@attack68 attack68 marked this pull request as ready for review November 17, 2021 18:58
@github-actions github-actions bot added the Stale label Jan 1, 2022
@attack68 attack68 removed the Stale label Jan 4, 2022
@pandas-dev pandas-dev deleted a comment from github-actions bot Jan 4, 2022
@attack68 attack68 added IO Data IO issues that don't fit into a more specific label Styler conditional formatting using DataFrame.style Enhancement labels Jan 7, 2022
@attack68 attack68 added this to the 1.5 milestone Jan 7, 2022
@jreback jreback merged commit 7d0fada into pandas-dev:master Jan 8, 2022
@jreback
Copy link
Contributor

jreback commented Jan 8, 2022

this is cool @attack68

@attack68 attack68 deleted the styler_simple_to_string branch January 8, 2022 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO Data IO issues that don't fit into a more specific label Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants