Из scipy docs
coo_matrix((data, (i, j)), [shape=(M, N)])
to construct from three arrays:
data[:] the entries of the matrix, in any order
i[:] the row indices of the matrix entries
j[:] the column indices of the matrix entries
Таким образом, целые числа в x1
и x2
, которые вы передаете, являются индексами матрицы. Если максимальные индексы 4000
и 51949
включены для индекса, начинающегося с нуля, то размеры будут (4001, 51950)
.