Open
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
I wanted to make a function to create and format a table with experiment results. However I am facing some problems due to the way Pandas actually works:
- It is impossible to actually return an styled
DataFrame
as far as I know, one must return aStyler
object instead. Thus, users must know about theStyler
class, and it also has a bad text representation in terminal. - The most flexible approach to styling is to set CSS classes (for example, a class for a significant result) and then add styling to the classes. This is again problematic for several reasons:
- There is no analog of
set_td_classes
for index and column titles, that is, aset_th_classes
or something like that. - Although the classes with a posterior call to
set_table_styles
work well for HTML output, when a user has to format the table for a publication (withto_latex
), the style for the classes is not applied. Instead the CSS selector and properties are prepended to the Latex output. This occurs even when usingconvert_css
and we restrict ourselves to the supported CSS conversions.
- There is no analog of
- I wanted to append an asterisk to cells of some class, but I was unable to do it. I tried both of the ways here but they did not work (or I did it wrong somehow).
Feature Description
- (Optional): Allow to set the styler object for a particular
DataFrame
. - Improve
Styler
text representation. - Allow to set per-CSS-class styles that work for
Latex
output (ideally, also allow for styles that work for both HTML and Latex). - Allow to append/prepend text (or maybe something more general) to both HTML and Latex outputs based on the CSS class.
Alternative Solutions
The only "solution" I was able to implement was to include the desired output as a parameter and doing things differently for each, without using CSS classes in the Latex case, and even manually changing the text of cells (which is not ideal).
Additional Context
No response