expanding (adding a row or column) a scipy.sparse matrix
Scipy doesn’t have a way to do this without copying the data but you can do it yourself by changing the attributes that define the sparse matrix. There are 4 attributes that make up the csr_matrix: data: An array containing the actual values in the matrix indices: An array containing the column index corresponding to … Read more