Hi Matti,

data, i and j are all 1d arrays of matching length. The order of data doesn't matter because the corresponding entries in i and j indicate the row and column indices where the data is stored within the sparse MxN matrix.

A minimal example that reversing the order of data, i and j gives the same matrix:

from scipy.sparse import coo_matrix

coo_matrix(([2, 3], ([0, 1], [2, 1])), shape=(3, 3)).todense()

matrix([[0, 0, 2],

[0, 3, 0],

[0, 0, 0]])

coo_matrix(([3, 2], ([1, 0], [1, 2])), shape=(3, 3)).todense()

matrix([[0, 0, 2],

[0, 3, 0],

[0, 0, 0]])

_______________________________________________

SciPy-User mailing list

[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user