First time here? Check out the FAQ!
answered 9 years ago
def insert_row(M,k,row): return matrix(M.rows()[:k]+[row]+M.rows()[k:])