1

Why this

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

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

  • Also related: https://stackoverflow.com/questions/1089018/why-cant-decimal-numbers-be-represented-exactly-in-binary and https://docs.python.org/3/tutorial/floatingpoint.html –  Aug 29 '17 at 01:28

1 Answers1

0

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.

Daniyal Ahmed
  • 715
  • 5
  • 11
  • " to convert it to a more interpret able you might wand to use round function": just use proper (print) formatting instead. Rounding it just turns it into another/the same floating point number that still can't be represented correctly. –  Aug 29 '17 at 01:32