The inputs are a little unclear ( I think you've mixed up 0 based indexing a little), but you can probably coerce them into this form and get what you're after.
import numpy as np
from scipy.sparse import coo_matrix
row = np.array([0, 1, 2, 1])
col = np.array([0, 1, 1, 3])
data = np.array([1, 2, 0.5, 3])
coo_matrix((data, (row, col)), shape=(4, 4)).toarray()
array([[1. , 0. , 0. , 0. ],
[0. , 2. , 0. , 3. ],
[0. , 0.5, 0. , 0. ],
[0. , 0. , 0. , 0. ]])
See https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.coo_matrix.html#scipy.sparse.coo_matrix for more examples
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…