'In-place operation on col j using two-arg functor whose args are
interpreted as (self[i, j], i) for i in range(self.rows).
Examples
>>> from sympy.matrices import SparseMatrix
>>> M = SparseMatrix.eye(3)*2
>>> M[1, 0] = -1
>>> M.col_op(1, lambda v, i: v + 2*M[i, 0]); M
Matrix([
[ 2, 4, 0],
[-1, 0, 0],
[ 0, 0, 2]])'

def col_op(self, j, f):

    for i in range(self.rows):
        v = self._smat.get((i, j), S.Zero)
        fv = f(v, i)
        if fv:
            self._smat[(i, j)] = fv
        elif v:
            self._smat.pop((i, j))
