Issue
I am trying run that little piece of code:
mybox = (17.0, -13.0, 489.0644700903291, 566.0)
# this 'box' is my input so these values will vary
xMin, yMin, xMax, yMax = mybox
yValue = range(yMin, yMax, 30)
running it, I get an error:
TypeError: range() integer end argument expected, got float.
Is there a way to use a float in a range like that?
Thanks,
Solution
You're looking for arange, which can be found in numpy (or pylab).
import numpy
...
yValue = numpy.arange(yMin, yMax, 30.0)
Answered By - chappy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.