<jupyter_start><jupyter_text>RREF CalculationUsing the `SymPy` library (Symbolic Python), we can obtain the exact unique RREF of any matrix easily. With the help of `sympy.Matrix().rref()` method, we can put a matrix into Reduced Row Echelon Form. `Matrix().rref()` returns a tuple of two elements. The first is the Reduced Row Echelon Form (RREF), and the second is a tuple of indices of the pivot columns (columns with leading 1s).<jupyter_code>import sympy as sp
from sympy import Matrix, linsolve, symbols
sp.init_printing(use_unicode=True)<jupyter_output><empty_output><jupyter_text>ExampleSolve the following system of linear equations:$\left\{\begin{aligned} x+3y+5z &=8 \\-2x+4y+9z &=3 \\-x+7y+14z &=11 \end{aligned}\right.$<jupyter_code>A = sp.Matrix([[1,3,5,8],[-2,4,9,3],[-1,7,14,11]])
A
#get the exact RREF of A with the pivot columns identified
B = A.rref()
B 
# reduced matrix only
B[0]
# pivot columns only
B[1]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12761506276150628, 'fraction_numerical': 0.030334728033472803, 'mean_word_length': 5.73943661971831, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '607429', 'license': 'CC0-1.0', 'n_tokens_mistral': 346, 'n_tokens_neox': 333, 'n_words': 113, 'path': 'RREF_Gaussian_Elimination.ipynb', 'repo_name': 'tofighi/Linear-Algebra', 'size': '956'}