Rounding Error in pandas

895 views Asked by At

Why this

>>> pd.Series(94.175).values[0]
>>> 94.174999999999997

I'm using python3.5 and pandas0.20 under jupyter notebook.

1

There are 1 answers

1
Daniyal Ahmed On

This is because some numbers cannot be exactly represented as decimal points.To find the exact value of decimal point you may like to use .hex operator. And to convert it to a more interpret able you might wand to use round function.