[Numpy-discussion] np.vstack vs. np.stack
Robert Kern
robert.kern at gmail.com
Thu Nov 9 17:53:48 EST 2017
On Thu, Nov 9, 2017 at 2:49 PM, Allan Haldane <allanhaldane at gmail.com>
wrote:
>
> On 11/09/2017 05:39 PM, Robert Kern wrote:
> > On Thu, Nov 9, 2017 at 1:58 PM, Mark Bakker <markbak at gmail.com> wrote:
> >
> >> Can anybody explain why vstack is going the way of the dodo?
> >> Why are stack / concatenate better? What is 'bad' about vstack?
> >
> > As far as I can tell, the discussion happened all on Github, not the
> > mailing list. See here for references:
> >
> > https://github.com/numpy/numpy/pull/7253
> >
> > --
> > Robert Kern
>
> yes, and in particular this linked comment/PR:
>
> https://github.com/numpy/numpy/pull/5605#issuecomment-85180204
>
> Maybe we should reword the vstack docstring so that it doesn't imply
> that vstack is going away. It should say something weaker
> like "the functions np.stack, np.concatenate, and np.block are often
> more general/useful/less confusing alternatives".. or better explain
> what the problem is.
>
> If we limit ourselves to 1d,2d and maybe 3d arrays the vstack behavior
> doesn't seem all that confusing to me.
I concur. Highlighting that the functions are only being retained "for
backward compatibility" does seem to imply to people that they are
deprecated and cannot be relied upon to remain. We *do* break backwards
compatibility from time to time.
--
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20171109/066c6332/attachment.html>
More information about the NumPy-Discussion
mailing list