You could use scipy.sparse.diags
:
Input:
diags([1, 2, 3], [0, 1, 2], shape=(3,5)).toarray()
Output:
array([[ 1., 2., 3., 0., 0.],
[ 0., 1., 2., 3., 0.],
[ 0., 0., 1., 2., 3.]])
The second list, [0, 1, 2], is an offset list. It tells how offset from the diagonal you want a certain element to be.