@jnothman  That explains it. Is the current way, the best way of doing it? This method is done throughout the code. Iterate across xrange(indptr, indptr + 1) and update R using the corresponding X.data[X.indices] values. Do you have any suggestions that I could try to possibly speed up the code? I'm thinking but nothings striking me.