[Numpy-discussion] Vectorized version of numpy.linspace
lagru at mailbox.org
Wed Nov 14 13:20:33 EST 2018
On 14.11.18 17:57, Stephan Hoyer wrote:
> It recently came up on GitHub (at part of the discussion
> in https://github.com/numpy/numpy/issues/12379) that numpy.linspace
> could, at least in principle, be modified to support array inputs:
> It looks like this has been requested on StackOverflow, too:
> My tentative proposal:
> - "start" and "stop" are broadcast against each other to form start/stop
> arrays. (Or we could require that start/stop have matching shape.)
> - A new dimension of size "num" is inserted into the result, either
> along the first or last axis.
> - A new keyword argument "axis" could control where the axis is inserted
> in the result.
> - Vectorization support should be added in the same way to geomspace and
This reminds me of a function  I wrote which I think has a lot of
similarities to what Stephan describes here. It is currently part of a
PR to rewrite numpy.pad .
Maybe that's helpful to know depending on how this discussion resolves. :)
More information about the NumPy-Discussion