Pandas data precision [duplicate]

No, 34.98774564765 is merely being printed by default with six decimal places:

>>> pandas.DataFrame([34.98774564765])
           0
0  34.987746

The data itself has more precision:

>>> pandas.DataFrame([34.98774564765])[0].data[0]
34.98774564765

You can change the default used for printing frames by altering pandas.options.display.precision.

For example:

>>> pandas.set_option("display.precision", 8)
>>> pandas.DataFrame([34.98774564765])
                0
0  34.98774564765

Leave a Comment