human
What is a the Python program you requested given the following:
I am working on the file "3LinearAlgebra/project3/linear_regression_project.ipynb".
The first task is:
请按照算法的步骤3，逐步推演奇异矩阵的变换。
在下面列出每一次循环体执行之后的增广矩阵。
要求：
1. 做分数运算
2. 使用\frac{n}{m}来渲染分数，如下：
 - $\frac{n}{m}$
 - $-\frac{a}{b}$
$ Ab = \begin{bmatrix}
    0 & 0 & 0 & 0 \
    0 & 0 & 0 & 0 \
    0 & 0 & 0 & 0 \end{bmatrix}$
$ --> \begin{bmatrix}
    0 & 0 & 0 & 0 \
    0 & 0 & 0 & 0 \
    0 & 0 & 0 & 0 \end{bmatrix}$
$ --> \begin{bmatrix}
    0 & 0 & 0 & 0 \
    0 & 0 & 0 & 0 \
    0 & 0 & 0 & 0 \end{bmatrix}$
$...$
2.3.3 实现 Gaussian Jordan 消元法
Can you write Python program for it?
assistant
#Here is the Python program you requested.

# TODO 实现 Gaussain Jordan 方法求解 Ax = b

""" Gaussian Jordan 方法求解 Ax = b.
    参数
        A: 方阵 
        b: 列向量
        decPts: 四舍五入位数，默认为4
        epsilon: 判读是否为0的阈值，默认 1.0e-16
        
    返回列向量 x 使得 Ax = b 
    返回None，如果 A，b 高度不同
    返回None，如果 A 为奇异矩阵
"""
from fractions import Fraction
def gj_Solve(A, b, decPts=4, epsilon = 1.0e-16):
    def max_idx(list):
        if max(list)<=epsilon:
            raise ValueError
        return 0 if len(list)<=0 else list.index(max(list))

    if not shape(A)[0] == shape(b)[0]:
        return None
    
    Ab = augmentMatrix(A, b)
    for i in range(shape(A)[1]):
        col_i = [abs(Ab[row_num][i]) for row_num in range(i, shape(Ab)[0])]
        try:
            idx = max_idx(col_i) + i
            swapRows(Ab, i, idx)
            scaleRow(Ab, i, 1.0/Ab[i][i])
            for j in range(shape(Ab)[0]):
                if j != i:
                    addScaledRow(Ab, j, i, Fraction(-Ab[j][i]))
        except ValueError:
            return None
    result = [[0] * 1 for row in range(shape(Ab)[0])]
    
    for i in range(shape(Ab)[0]):
        result[i][0]=Ab[i][-1]
    
    return result

# 运行以下代码测试你的 gj_Solve 函数
%run -i -e test.py LinearRegressionTestCase.test_gj_Solve