[Numpy-discussion] Vectorized version of numpy.linspace
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion