[Numpy-discussion] Vectorized version of numpy.linspace

Eric Wieser wieser.eric+numpy at gmail.com
Wed Nov 14 21:27:22 EST 2018


I too buy into axis=0 being the better default here for broadcasting
reasons. Having it possible to specify explicitly would be handy though,
for something like:

x_ramped = np.linspace(x.min(axis=2), x.max(axis=2), 100, axis=2)

​

On Wed, 14 Nov 2018 at 15:20 Stephan Hoyer <shoyer at gmail.com> wrote:

> On Wed, Nov 14, 2018 at 3:16 PM Marten van Kerkwijk <
> m.h.vankerkwijk at gmail.com> wrote:
>
>> I see the logic in having the linear space be last, but one
>> non-negligible advantage of the default being the first axis is that
>> whatever is produced broadcasts properly against start and stop.
>> -- Marten
>>
>
> Yes, this is exactly why I needed to insert the new axis at the start.
>
> That said, either default axis position is fine by me as long as we have
> the explicit option.
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20181114/1656efe6/attachment-0001.html>


More information about the NumPy-Discussion mailing list