I am trying to take the dot product of a row in a sparse matrix with transposing that row using Python. I have a huge sparse matrix X2. And I save the results (which should be a single number) in a list called Njc.
X2 = X.transpose() for row in X2: Njc.append(dot(row,row.transpose()))
However, when I run my program, the results are not single. They are similar: (0, 0) 355
(0, 0) 295
(0, 0) 15
(0, 0) 204
(0, 0) 66
....
Unfortunately, my sparse matrix is โโso large that I cannot turn it into a dense matrix (my memory will explode). Is there a way to get only numbers on the right without pairs on the left?
source share