def addvec2(mat, vec):
    Ml = mat.tolil()
vec = vec.tocoo()
for i, v in zip(vec.col, vec.data):
    Ml[:, (i)] = sparse.coo_matrix(Ml[:, (i)].A + v)
return Ml
Elementwise addition of sparse scipy matrix vector with broadcasting