I'm trying to use advanced indexing to modify a big sparse matrix. Say you have the following code:
import numpy as np
import scipy.sparse as sp
A = sp.lil_matrix((10, 10))
a = np.array([[1,2],[3,4]])
idx = [1,4]
A[idx, idx] += a
Why this code doesn't work? It gives me the error
ValueError: shape mismatch in assignment