When I'm trying to access a specific value in my pandas dataframe, the output provides me with a tiny number (0.0000000000000001) adding to my original value. Why is this happening and how can I stop it?
The data is read in from a csv to a pandas dataframe, which has the value 1.009 contained in it (the csv is exactly 1.009), but when I try and access the value from it, specifying the column, then it gives me 1.0090000000000001. I don't want to simply round the number to x decimal places as my values have varying amounts of decimal places.
print(data_final.iloc[328])
# gives:
# independent 1.009
# dependent 7.757
# Name: 328, dtype: float64
print(data_final.iloc[328,0])
#gives: 1.0090000000000001
print(data_final['independent'].iloc[328])
#gives: 1.0090000000000001
I expected the output to be 1.009 however it is 1.0090000000000001!