
Sept. 8, 2014
8:40 p.m.
Le 08/09/2014 15:29, Stefan Otte a écrit :
Hey,
quite often I work with block matrices. Matlab offers the convenient notation
[ a b; c d ]
to stack matrices. The numpy equivalent is kinda clumsy:
vstack([hstack([a,b]), hstack([c,d])])
I wrote the little function `stack` that does exactly that:
stack([[a, b], [c, d]])
In my case `stack` replaced `hstack` and `vstack` almost completely.
If you're interested in including it in numpy I created a pull request [1]. I'm looking forward to getting some feedback!
Best, Stefan
The outside brackets are redundant, stack([[a, b], [c, d]]) should be stack([a, b], [c, d])