Python TypeError: range() integer end argument expected, got float
Question: I apologize in advance, I saw the answers already given for a similar kind of
error but I couldn't make out anything out of it for my case. My python is
quite basic and 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,


Answer: You're looking for arange, which can be found in numpy (or pylab).

    
    
    import numpy
    ...
    yValue = numpy.arange(yMin, yMax, 30.0)
    

