Say I want to loop from 0 to 100 but with a step of 1/2. If you try
for i in range(0, 100, 0.5): whatever
You have to use integer steps for range() and xrange(). That's why your 0.5 step gets internally converted to 0 and you get that error. Try for i in [j / 2.0 for j in xrange(100 * 2)]:
range
xrange()
for i in [j / 2.0 for j in xrange(100 * 2)]: