Skip to content
Advertisement

Pandas Style Bar converts my data into 6 decimals

when using pd.Style.Bar, pandas converts my data to 6 decimals. Can anybody help me ?

Example :

JavaScript

or even trying :

JavaScript

Both give me the following output (with the column bars – sorry I can’t copy here) :

JavaScript

Advertisement

Answer

If you just want to ensure that the precision of a is 2, you could call pandas.io.formats.style.Styler.set_precision when defining a.

Example

JavaScript

a

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement