I have rather unusual request, but I hope someone might be able to help.
I am appending floats as values to numpy array. I would like to make sure that float does not get rounded when its decimal part ends in 0. For example: I would like float 31.30 to stay 31.30 in the array, but what I am experiencing now is that it gets set to 31.3.
The reason why I want to make sure float does not change is that later on I am splitting it to two integers(31.30 to 31 and 30) and it is of critical importance for me that both integers have the 'complete' values.
Is there any way to get around this? I tried with making these floats strings, but my problem is that I need to compare the arrays with these floats and numpy.array_equal() does not seem to work for arrays of strings...
Any help will be greatly appreciated,
Best wishes
31.3and31.30are exactly identical numbers. How do you expect them to differ in any way?31.3 == 31.30, they are just two different ways of representing the same value. It's not much different from the fact that the3you get from writingx = 3is the same as the3you get from writingx = 1 + 2.