I am constructing a sparse vector using a scipy.sparse.csr_matrix like so:
scipy.sparse.csr_matrix
csr_matrix((values, (np.zeros(len(indices)), indices)), shape = (1, m
The max index you are giving is less than the maximum index of the rows you are supplying.
This sparse.csr_matrix((vals, (np.zeros(10), inds)), shape = (1, np.max(inds)+1)) works fine with me.
sparse.csr_matrix((vals, (np.zeros(10), inds)), shape = (1, np.max(inds)+1))
Although making a .todense() results in memory error for the large size of the matrix