I have a sparse matrix in the form of (inl, outl, 1) that I want to convert into a nxn matrix (value is 1 if there is a link between a and b).
However there are multiple b values for each a, which I believe is why the ValueError message is popping up. I've tried csr, coo, csc, bsr matrixes, to no avail...
M = coo_matrix( (yn, (inl,outl)), shape=(n,n) ).toarray()
ValueError: 'row index exceeds matrix dimensions'
Any help is greatly appreciated. Thanks!
max(inl)to see if you have a row index that's bigger thann.n = max(inl), your error is becauserange(n)goes from0ton-1. That one max data point is out of range. setn = max(inl) + 1