Can someone give me a hint if I have an precission issue with floating points as stated here: Hist Precission with floats or do I miss something here??
import numpy
import matplotlib.pyplot as plt
frame = numpy.array([0.9, 0.99, 1, 1.9, 1.99, 2])
MyBins = numpy.linspace(0, 100, 1000, endpoint=False)
(counts, bins, bars) = plt.hist(frame, bins = MyBins)
Output counts:
0
... ...
8 0.0
9 2.0
10 1.0
... ...
18 1.0
19 1.0
20 1.0
The counts of 0.9 and 0.99 should be 2 as well as for 1.9 and 1.99. However, 1.9 is counted as an 1.8 value... If this an floating precission issue, what can I do to fix it?
Thank you!