[Numpy-discussion] np.vstack vs. np.stack

Allan Haldane allanhaldane at gmail.com
Thu Nov 9 17:49:34 EST 2017

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:


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.


More information about the NumPy-Discussion mailing list