efficiently set a large number of SciPy sparse matrix entries to zero

Viewed 141

I need to prune a large number of entries from a SciPy sparse matrix. Currently I convert the matrix to the DOK format and individually assign each entry to 0.

m = m.todok()
for i, j in pruneme:
  m[i,j] = 0

This is extremely slow.

Is there a faster way?

1 Answers
Related