from sympy import *
from IPython.display import display
init_printing(use_latex='mathjax')
A=Matrix([[1,3,5,0,0,3],[0,0,2,1,2,1],[2,6,12,1,2,7]])
display(A)
A.rref()
B=Matrix([[1,3,5,0,0,3,0],[0,0,2,1,2,1,0],[2,6,12,1,2,7,0]])
display(B)
display(B.rref())