I am trying to make a numpy array that looks like this:
[a b c ]
[ a b c ]
[ a b c ]
[ a b c ]
So this involves updat
I can't comment yet, but I want to bump that ali_m's answer is by far the most efficient as scipy takes care of things for you.
For example, with a matrix of size n,m = 1200, repeatedly adding np.diag() calls takes ~6.14s, Saullo G. P. Castro's answer takes ~7.7s, and scipy.linalg.toeplitz(np.arange(N), np.arange(N)) takes 1.57ms.