Is there a way to step between 0 and 1 by 0.1?
I thought I could do it like the following, but it failed:
for i in range(0, 1, 0.1): print i
The trick to avoid round-off problem is to use a separate number to move through the range, that starts and half the step ahead of start.
# floating point range def frange(a, b, stp=1.0): i = a+stp/2.0 while i
Alternatively, numpy.arange can be used.
numpy.arange