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

No way to control display format when exporting to excel #22027

Closed
marknsikora opened this issue Jul 23, 2018 · 0 comments · Fixed by #22015
Closed

No way to control display format when exporting to excel #22027

marknsikora opened this issue Jul 23, 2018 · 0 comments · Fixed by #22015
Labels
Enhancement IO Excel read_excel, to_excel

Comments

@marknsikora
Copy link
Contributor

Code Sample, a copy-pastable example if possible

# format call does nothing
df.style.format("{:.2%}").to_excel('styled.xlsx')

Problem description

The current excel styler doesn't implement anything for the styler format method. To get number format there are two possible options. First is to connect this method to something. Second is to allow some way to set the number_format attribute on excel cells. The second option is a bit cleaner IMHO since data conversion like truncating decimal places can result in loss of information and number_format is also sort of how excel declares data types eg. displaying a number as a time.

@WillAyd WillAyd added the IO Excel read_excel, to_excel label Jul 23, 2018
@WillAyd WillAyd added this to the Contributions Welcome milestone Jul 23, 2018
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants