[Numpy-discussion] step paramter for linspace

Sebastian Berg sebastian@sipsolutions....
Fri Mar 1 10:29:57 CST 2013


On Fri, 2013-03-01 at 10:49 -0500, Alan G Isaac wrote:
> One motivation of this thread was that
> adding a step parameter to linspace might make
> things easier for beginners.
> 
> I claim this thread has put the lie to that,
> starting with the initial post.  So what is the
> persuasive case for the change?
> 
> Imo, the current situation is good:
> use arange if you want to specify the stepsize,
> or use linspace if you want to specify the
> number of points.  Nice and clean.
> 

Maybe you are right, and it is not easier. But there was a "please
include an end_point=True/False option to arange" request, and that does
not sense by arange logic.

The fact that the initial example was overly strict is something that
can be relaxed quite a bit I am sure, though I guess you may always have
an odd case here or there with floats.

I agree the difference is nice and clean right now, but I disagree that
this would change much. Arange guarantees the step size. Linspace the
end point. There is a bit of a shift, but if I thought it was less clean
I would not have asked if it is deemed useful :).

At this time it seems there is more sentiment against it and that is
fine with me. I thought it might be useful for some who normally want
the linspace behavior, but do not want to worry about the right num in
some cases. Someone who actually wants an error if the step they put in
quickly (and which they would have used to calculate num) was wrong.

> Cheers,
> Alan Isaac
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
> 




More information about the NumPy-Discussion mailing list