How can I specify a line in a csr_matrix ? This error returns: Q [middle ,:] = new_q Q The result of csr_matrix , and new_q is Q.getrow (i) . I am using the latest version of Scipy. Am I using the correct matrix type? I want to show the correct matrix type for using two matrix: Q and b . I am amending a line of the matrix cue at a time, and am amending one's columns at a time. It seems that I should make a Q as a lil_matrix or csr_matrix . What type of matrix should be B ? A csc_matrix ? This works fine in 13.2: & gt; & Gt; & Gt; Sp .__ version__ '0.13.2' & gt; & Gt; & Gt; Imported Sps as SPS & gt; & Gt; & Gt; A = sps.csr_matrix (np.arange (25) .reshap (5, 5)) & gt; & Gt; & Gt; AA array ([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 1] 9], [20, 21, 22, 23, 24]]))); & Gt; & Gt; A [3] = a.getrow (0)> gt; & Gt; & Gt; AA array ([[0, 1, 2,...