[Numpy-discussion] step paramter for linspace
sebastian at sipsolutions.net
Fri Mar 1 11:29:57 EST 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.
> Alan Isaac
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
More information about the NumPy-Discussion