(self)
return [[self[i, j] for j in range(J)] for i in range(I)]
Convert this sparse matrix into a list of nested Python lists.

        Examples
        ========

        >>> from sympy.matrices import SparseMatrix, ones
        >>> a = SparseMatrix(((1, 2), (3, 4)))
        >>> a.tolist()
        [[1, 2], [3, 4]]

        When there are no rows then it will not be possible to tell how
        many columns were in the original matrix:

        >>> SparseMatrix(ones(0, 3)).tolist()
        []
Convert this sparse matrix into a list of nested Python lists.
Convert this sparse matrix into a list of nested Python lists .
def tolist(self):
        """Convert this sparse matrix into a list of nested Python lists.

        Examples
        ========

        >>> from sympy.matrices import SparseMatrix, ones
        >>> a = SparseMatrix(((1, 2), (3, 4)))
        >>> a.tolist()
        [[1, 2], [3, 4]]

        When there are no rows then it will not be possible to tell how
        many columns were in the original matrix:

        >>> SparseMatrix(ones(0, 3)).tolist()
        []

        """
        if not self.rows:
            return []
        if not self.cols:
            return [[] for i in range(self.rows)]
        I, J = self.shape
        return [[self[i, j] for j in range(J)] for i in range(I)]
def tolist ( self ) : if not self . rows : return [ ] if not self . cols : return [ [ ] for i in range ( self . rows ) ] I , J = self . shape return [ [ self [ i , j ] for j in range ( J ) ] for i in range ( I ) ]