[SciPy-User] How to get the index iterator of a scipy sparse matrix?

Pengkui Luo pengkui.luo@gmail....
Sun Mar 25 17:47:40 CDT 2012


e.g. suppose A is a scipy lil sparse matrix, and the result of print(A) is:

  (0, 1) 1.0
  (0, 2) -1.0
  (1, 0) 1.0
  (1, 2) -1.0
  (2, 1) 2.0

How can I get an iterator (or at least a list) of these (i, j) index pairs?

Thanks!

--
Pengkui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120325/9ff04632/attachment.html 


More information about the SciPy-User mailing list