b33 = A[0, 0] * A[1, 1] * A[2, 2] + A[0, 1] * A[1, 2] * A[2, 0] + A[0, 2] * A[
    1, 0] * A[2, 1] - A[0, 0] * A[1, 2] * A[2, 1] - A[0, 1] * A[1, 0] * A[2, 2
    ] - A[0, 2] * A[1, 1] * A[2, 0]
Ainv = np.array([[b00, b01, b02, b03], [b10, b11, b12, b13], [b20, b21, b22,
    b23], [b30, b31, b32, b33]]) / detA
return Ainv
Инверсия матрицы без Numpy