我想创造这样的东西:
import numpy as np M=np.matrix([[1,2],[3,4]]) A=np.matrix([[M,M],[M,M]]) print(A)
但没用
这有点棘手,必须分别构造每个列,然后组合这些列:
A = np.concatenate([np.concatenate([M, M]), np.concatenate([M, M])], axis=1) #matrix([[1, 2, 1, 2], # [3, 4, 3, 4], # [1, 2, 1, 2], # [3, 4, 3, 4]])