# Composite matrices in Numpy

Lets say I have four matrices A, B, C and D, and I want to combine them together into one new matrix for computation: $$\left( \begin{matrix} A & B\\ C & D \end{matrix}\right)$$ How can I do this in Numpy? The only thing I can think of now is to loop through each element in every matrix.

They are commonly called block matrices. You can create them with hstack, vstack, and block.