I have this scipy csr_matrix:
(0, 12114) 0.272571581001
(0, 12001) 0.0598986479579
(0, 11998) 0.137415042369
(0, 11132) 0.0681428952502
(0, 10412) 0.0681428952502
(1, 10096) 0.0990242494495
(1, 10085) 0.216197045661
(1, 9105) 0.1362857905
(1, 8925) 0.042670696769
(1, 8660) 0.0598986479579
(2, 6577) 0.119797295916
(2, 6491) 0.0985172979468
(3, 6178) 0.1362857905
(3, 5286) 0.119797295916
(3, 5147) 0.270246307076
(3, 4466) 0.0540492614153
(4, 3810) 0.0540492614153
(4, 3773) 0.0495121247248
and I would like to find a way to create (in this case 4) dictionaries where each dictionary contains the 2 biggest values for each row..
So for example, for row 0 my dictionary would be:
dict0 = {12114: '0.27257158100111998', 11998: '0.137415042369'}
and for row 1:
dict1 = {10085: '0.216197045661', 9105: '0.1362857905'}