[Numpy-discussion] Why arange has no stop-point opt-in?

K.-Michael Aye kmichael.aye at gmail.com
Thu Dec 30 09:57:50 EST 2010


On 2010-12-30 16:43:12 +0200, josef.pktd at gmail.com said:

> 
> Since linspace exists, I don't see much point in adding the stop point
> in arange. I use arange mainly for integers as numpy equivalent of
> python's range. And I often need arange(n+1) which is less writing
> than arange(n, include_end_point=True)

I agree with the point of writing gets more in some cases.
But arange(a, n+1, 0.1) would of course fail in this case.
And the big difference is, that I need to calculate first how many 
steps it is for linspace to achieve what I believe is a frequent user 
case.
As we already have the 'convenience' of both linspace and arange, which 
in principle could be done by one function alone if we'd precalculate 
all required information ourselves, why not go the full way, and take 
all overhead away from the user?

Michael

> 
> Josef
> 
>> 
>> Friedrich
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion






More information about the NumPy-Discussion mailing list