<p dir="ltr">We already use the word "stack" in lots of function names to refer to something different from what bmat does. So while I definitely agree we should have something like bmat for ndarrays, it would be better all the to just pick a different name. np.block, even, might do the job.</p>
<p dir="ltr">On Mar 16, 2015 1:50 AM, "Stefan Otte" <<a href="mailto:stefan.otte@gmail.com">stefan.otte@gmail.com</a>> wrote:<br>
><br>
> Hey,<br>
><br>
> > 1. np.stack for stacking like np.asarray(np.bmat(...))<br>
> > <a href="http://thread.gmane.org/gmane.comp.python.numeric.general/58748/">http://thread.gmane.org/gmane.comp.python.numeric.general/58748/</a><br>
> > <a href="https://github.com/numpy/numpy/pull/5057">https://github.com/numpy/numpy/pull/5057</a><br>
><br>
> I'm the author of this proposal. I'll just give some context real quickly.<br>
><br>
> "My stack" started really simple, basically allowing a Matlab-like<br>
> notation for stacking:<br>
><br>
> matlab: [ a b; c d ]<br>
> numpy: stack([[a, b], [c, d]]) or even stack([a, b], [c, d])<br>
><br>
> where a, b, c, and d a arrays.<br>
><br>
> During the discussion people asked for fancier stacking and auto<br>
> filling of non explicitly set blocks (think of an "eye" matrix where<br>
> only certain blocks are set).<br>
><br>
> Alternatively, we thought of refactoring the core of bmat [2] so that<br>
> it can be used with arrays and matrices. This would allow stack("a b;<br>
> c d") where a, b, c, and d are the names of arrays/matrices. (Also<br>
> bmat would get better documentation during the refactoring :)).<br>
><br>
> Summarizing, my proposal is mostly concerned how to create block<br>
> arrays from given arrays. I don't care about the name "stack". I just<br>
> used "stack" because it replaced hstack/vstack for me. Maybe "bstack"<br>
> for block stack, or "barray" for block array?<br>
><br>
> I have the feeling [1] that my use case is more common, but I like the<br>
> second proposal.<br>
><br>
><br>
> Cheers,<br>
>  Stefan<br>
><br>
><br>
> [1] Everybody generalizes from oneself. At least I do.<br>
> [2] <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.bmat.html">http://docs.scipy.org/doc/numpy/reference/generated/numpy.bmat.html</a><br>
> _______________________________________________<br>
> NumPy-Discussion mailing list<br>
> <a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</p>