question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: repurpose `Styler` as a general display tool and not an HTML-CSS tool

See original GitHub issue

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/pandas-docs/dev/user_guide/style.html

Documentation problem

When Styler was originally designed and released, its aim was to display HTML in a Jupyter Notebook, that could be manipulated and conditionally formatted. The user guide and documentation over the years has therefore focused on the HTML side of things, and the more recent display and general formatting features are seen as extras to suit that environment, and patchwork included in the documentation.

This issue probably targets pandas 2.0 where I am suggesting that the Table Visualization part of the user guide pushes Styler as a generalist DataFrame formatter, describing the generic functionality it has, and also expanding the conditional aspects which can now be output to HTML, LaTeX and Excel.

My philosophy with the development I put into Styler was for it to be;

  • First and foremost a formatting tool to display data in any way the user wants, without changing the underlying data, with outputs to String (i.e. CSV), HTML, LaTeX, Excel, and (ultimately) JSON.
  • Provide extra conditional formatting features that suit the environment, e.g. HTML-CSS, LaTeX commands, Excel colors, etc.

Any comments welcome, but I think moving forward having a variety of easily accessible, configurable display representations is a great tool for data science.

Comments very welcome.

Suggested fix for documentation

.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tehuntercommented, Oct 4, 2022

My two cents as a Styler.to_excel “power user”, I like the idea of separating the Styler into a separate package within the pandas environment. I currently have an internal package to export DataFrames to Excel using Styler as a backend, following an extensive set of formatting rules for a consistent design in line with our style guide regardless of DataFrame. I see one benefit of separating the Styler package to be allowing the possible growth a more vibrant Theming and Plugins community.

Also, I’ve had to do some overriding of Styler class functions to get certain behavior I need. Some of these bug fixes and enhancements I’ve submitted as pull requests, but since they’re subject to Pandas’ release tempo, I’ve had to maintain a duplicate set of overrides to access these features in between Pandas releases. Having a separate package would allow the features of Styler to advance at its own pace.

1reaction
datapythonistacommented, Jul 28, 2022

Once there is agreement, I’m happy to help with this. I think it should be quite quick. In Ibis I moved several parts to third-party repos, and the only tricky part is defining the API among the components. Which I think in this case it’s trivial, as I guess the styler is mostly using the pandas public API, and pandas itself doesn’t know anything about the styler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google HTML/CSS Style Guide
This document defines formatting and style rules for HTML and CSS. ... Tools are free to obfuscate, minify, and compile as long as...
Read more >
HTML5 Reset Stylesheet
HTML 5 Reset Stylesheet | HTML5 Doctor | Webmaster Tools says: ... In general, I don't like the idea of CSS Reset cleaning...
Read more >
HTML Tutorial for Beginners: HTML Crash Course - YouTube
HTML Tutorial for Beginners - Learn HTML for a career in web development. This HTML tutorial teaches you everything you need to get...
Read more >
Using the Chrome web developer tools, Part 1: The Elements ...
You can go the other way as well; if you right-click on any element in any HTML view, whether the debugger is open...
Read more >
How to Style Your React App – 5 Ways to Write CSS in 2021
There is no #1 way to approach to writing styles in. ... normal CSS can be more verbose and repetitive than newer tools...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found