I'm having a hard time understanding why this behaviour is happening.
I have a scipy sparse csr matrix. The first ten elements are:
print my_mat[0:10,]
(0, 31) 1
(0, 33) 1
(1, 36) 1
(1, 40) 1
(2, 47) 1
(2, 48) 1
(3, 50) 1
(3, 53) 1
(4, 58) 1
(4, 60) 1
(5, 66) 1
(5, 68) 1
(6, 73) 1
(6, 75) 1
(7, 77) 1
(7, 82) 1
(8, 30) 1
(8, 32) 1
(9, 37) 1
(9, 40) 1
When I call indptr
, I get:
m1 = my_mat[0:10,]
print m1.indptr
[ 0 2 4 6 8 10 12 14 16 18 20]
Why don't the values of indptr
equal:
0 0 1 1 2 2 3 3, etc (the first column of my_mat, which is what is implied from the accepted answer to this question)? How can I access those values?