dexplo / dataframe_image

A python package for embedding pandas DataFrames as images into pdf and markdown documents
https://dexplo.org/dataframe_image
MIT License
282 stars 41 forks source link

df.style.background_gradient() changes display of float value #104

Closed yazhinia closed 1 year ago

yazhinia commented 1 year ago

Hi, Thanks for creating a useful package. I wanted to save a table content as an image. The table contains float values for example 0.2 which changes to 0.200000 upon using style.background_gradient(). This is not technically wrong but for visual image, the simple form of 0.2 looks better. Any effort on this aspect is much appreciated.

Thank you.

PaleNeutron commented 1 year ago

Please review your dataframe in notebook. It should have 0.200000 in notebook display.

image

If you want less 0, you could try:

image

Or other methods to modify pandas styler.