Create a larger matrix from smaller matrices in numpy

numpy, python

Solution

This:

numpy.bmat([[numpy.zeros(appropriate_shape), A], [B, C]])

works, but I'm not sure how to avoid the creation of that big, useless array of zeros. Also, it returns a matrix instead of an array, so make sure to call `asarray` on it if you want an array.

Problem

I have 3 matrices `A,B,C`. I wish to create a larger matrix of the form ``` D = | 0 A | | B C | ``` How to do this in Numpy ?

Original source