(self, pos, mti)
return newmat
Insert one or more rows at the given row position.

        Examples
        ========

        >>> from sympy import zeros, ones
        >>> M = zeros(3)
        >>> V = ones(1, 3)
        >>> M.row_insert(1, V)
        Matrix([
        [0, 0, 0],
        [1, 1, 1],
        [0, 0, 0],
        [0, 0, 0]])

        See Also
        ========

        row
        col_insert
Insert one or more rows at the given row position.
Insert one or more rows at the given row position .
def row_insert(self, pos, mti):
        """Insert one or more rows at the given row position.

        Examples
        ========

        >>> from sympy import zeros, ones
        >>> M = zeros(3)
        >>> V = ones(1, 3)
        >>> M.row_insert(1, V)
        Matrix([
        [0, 0, 0],
        [1, 1, 1],
        [0, 0, 0],
        [0, 0, 0]])

        See Also
        ========

        row
        col_insert
        """
        if pos == 0:
            return mti.col_join(self)
        elif pos < 0:
            pos = self.rows + pos
        if pos < 0:
            pos = 0
        elif pos > self.rows:
            pos = self.rows

        if self.cols != mti.cols:
            raise ShapeError(
                "`self` and `mti` must have the same number of columns.")

        newmat = self.zeros(self.rows + mti.rows, self.cols)
        i, j = pos, pos + mti.rows
        newmat[:i, :] = self[:i, :]
        newmat[i: j, :] = mti
        newmat[j:, :] = self[i:, :]
        return newmat
def row_insert ( self , pos , mti ) : if pos == 0 : return mti . col_join ( self ) elif pos < 0 : pos = self . rows + pos if pos < 0 : pos = 0 elif pos > self . rows : pos = self . rows if self . cols != mti . cols : raise ShapeError ( "`self` and `mti` must have the same number of columns." ) newmat = self . zeros ( self . rows + mti . rows , self . cols ) i , j = pos , pos + mti . rows newmat [ : i , : ] = self [ : i , : ] newmat [ i : j , : ] = mti newmat [ j : , : ] = self [ i : , : ] return newmat