def addvec(mat, vec):
    Mc = mat.tocsc()
for i in vec.nonzero()[1]:
    Mc[:, (i)] = sparse.csc_matrix(Mc[:, (i)].todense() + vec[0, i])
return Mc
Elementwise addition of sparse scipy matrix vector with broadcasting