Skip to content
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

ENH: styler.to_excel to support excel notes as implementation of tooltips #58070

Open
1 of 3 tasks
sdementen opened this issue Mar 29, 2024 · 5 comments
Open
1 of 3 tasks
Assignees
Labels
Enhancement IO Excel read_excel, to_excel Styler conditional formatting using DataFrame.style

Comments

@sdementen
Copy link
Contributor

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

I wish I could use set_tooltips in the styler to generate notes in an excel workbook (via the to_excel)

Feature Description

No real API change, but have the ExcelFormatter use the information set by styler.set_tooltips to create not on the cells with a tooltip

Alternative Solutions

No idea for an alternative except the statu quo...

Additional Context

No response

@sdementen sdementen added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 29, 2024
@rhshadrach
Copy link
Member

Thanks for the request. The proposed behavior here seems intuitive to me, I'm supportive of this as long as the implementation is reasonable.

cc @attack68 for thoughts.

@rhshadrach rhshadrach added Needs Discussion Requires discussion from core team before further action IO Excel read_excel, to_excel Styler conditional formatting using DataFrame.style and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 31, 2024
@rhshadrach
Copy link
Member

One difficulty I've encountered in the past is getting the comment size correct. If you do not set the size of a long comment (at least, using xlsxwriter), the comment is very difficult to read without resizing in Excel.

@attack68
Copy link
Contributor

attack68 commented Apr 1, 2024

I think the implementation would not be too complicated.

The Styler Tooltips object contains a DataFrame of strings that would serve as the data to the written excel cells.

I expect that xlswriter procedure could check for the existence of a Tooltips object. If none writing to excel is unchanged and performance identical. If it exists then the yielded excel cells would have an extended routine to write the comment as provided by the tooltips string.

Not sure that Tooltips is a widely used feature, however, but if someone was willing to explore this implementation I would help review.

@rhshadrach rhshadrach removed the Needs Discussion Requires discussion from core team before further action label Apr 14, 2024
@Dacops
Copy link

Dacops commented Apr 25, 2024

Hi, this seems like an interesting issue that me and my colleague @diogomsmiranda would like to tackle. If we have any doubt about it we'll reply on this thread

@Dacops
Copy link

Dacops commented Apr 25, 2024

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO Excel read_excel, to_excel Styler conditional formatting using DataFrame.style
Projects
None yet
Development

No branches or pull requests

4 participants