[Numpy-discussion] arange including stop value?

Tom K. tpk at kraussfamily.org
Thu Mar 11 19:30:53 EST 2010




davefallest wrote:
> 
> ...
> In [3]: np.arange(1.01, 1.1, 0.01)
> Out[3]: array([ 1.01,  1.02,  1.03,  1.04,  1.05,  1.06,  1.07,  1.08, 
> 1.09,  1.1 ])
> 
> Why does the ... np.arange command end up including my stop value?
> 
>From the help for arange:

        For floating point arguments, the length of the result is
        ``ceil((stop - start)/step)``.  Because of floating point overflow,
        this rule may result in the last element of `out` being greater
        than `stop`.

-- 
View this message in context: http://old.nabble.com/arange-including-stop-value--tp27866607p27872069.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.




More information about the NumPy-Discussion mailing list