Is that an easier way to fill a matrix diagonal element by another whole matrix?
b = [1,2,3,4,5,6,7,8,9]
a = np.zeros((9, 9), int)
np.fill_diagonal(a, b)
I expect the result will be
[[1. 0 0 ...........0 0]
[0. 2. 0 ...........0 0]
[0. 0. 3. ... 0 0 0 0]
[0. 0. 0. 4 0 0 0 0 0]
[0. 0. 0. 0 5 0 0 0 0]
[0. 0. 0. ... 6 0 0 0]
[0. 0. 0. ... 0 7 0 0]
[0. 0. 0. ... 0 0 8 0]
[0. 0. 0. ... 0 0 0 9]]