-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG+DOC: Recent Styler Enhancements #39317
Conversation
bug: set_td_classes loop ignored entries bug: tooltips indexing was dropped doc: added documentation for methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some comments
"- ``Styler.apply``: column-/row-/table-wise\n", | ||
"\n", | ||
"Both of those methods take a function (and some other keyword arguments) and applies your function to the DataFrame in a certain way.\n", | ||
"`Styler.applymap` works through the DataFrame elementwise.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how easy this is to link to the actual docs for these but would be great if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried. i think it is possible but the relative path structure is quite complicated and i couldn't get it to work. never done it before so I have left out.
@attack68 can you also add tests for the bugs you have fixed (e.g. simply a check on the generated html might be fine), just to lock down these cases. |
@jreback think this is ready now.. |
thanks @attack68 pls check the rendered docs when they build: https://pandas.pydata.org/docs/dev/ |
DOC: this edits the
style.ipynb
file to include examples of the 3 recent enhancements toStyler
:It also addresses 3 minor bugs that I detected when wirting the documentation:
BUG1 (lines 696-703):
set_td_classes
only attached classes to 'diagonal elements' of the DataFrame due a misaligned comprehension loop:replaces:
BUG2 (lines 513 to 537): external css class names from the set_td_classes were appended to the HTML id tag, as well as the HTML class tag, due to a premature variable update relating to the
row_dict
. The solution was to re-order so that 'id' tags were generated first and then 'class' was updated with information from the new methods.BUG3 (lines 1920-1925): Tooltips were generated for the wrong indexes/columns, since the null rows/columns were dropped and then the interger locations of rows/columns was mapped. The solution was to avoid dropping null rows/columns.