I want to create a matrix that contains matrix elements. So I did the obvious thing and made this:
import numpy as np
A = np.array([1,2,3,1],[3,1,5,1])
B = np.array([1,6,8,9],[9,2,7,1])
E = np.array([A, B],[B, A])
But the compiler returns: TypeError: data type not understood
What can I do to create such a matrix, because I have really huge matrices and I dont have the time to explicitly write everyone down ?
* Edit 1: *
Additional problem that occurred:
Instead of getting a 14x14 matrix, I am getting a multidimensional (2,2,7,7) matrix. Where in the simplified version that was my original question , everything is sound. Any ideas why this occurs now?
In this case I have the Amat 7x7, Bmat 7x7 , Emat 14x14, Smat 14x14
Edit 2
Ok I solved the problem using the np.block() as it was stated in the comments below. Thank you very much.

A=line, didn't you? It didn't even get to theEstep. In other words, it's a basic problem with usingnp.array.np.arraysyntax, there's still some ambiguity as to what you want. One answer produces a (4,8) array, another (2,2,2,4).ndarray) rather than a matrix. The distinction is important: NumPy does have a matrix type, but it can be awkward to use and isn't always well-integrated with the rest of NumPy or with other NumPy-using libraries. With the@operator for matrix-style multiplication available in recent times, there aren't very many good reasons for using the matrix type.