I have to create numbers for an x axis, first number equaling the minimum of my data set, and after that the numbers should increment by 0.001, until it equals the maximum of my data set. for some reason the numbers change in an unexpected way at the 15th decimal and I don't understand why.
def define_grid(data):
j = float(min(data))
xgrid = np.empty([0, 1])
while j < max(data):
xgrid = np.append(xgrid, j)
j = j + 0.001
else:
xgrid = np.append(xgrid, j)
return xgrid
for i in grid1:
print(i)
-21.74107816833327 -21.74007816833327 -21.73907816833327 -21.738078168333267 -21.737078168333266 -21.736078168333265