Skip to content

Commit 4b74fef

Browse files
Update matrix_inversion.py
1 parent 9cea0be commit 4b74fef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: linear_algebra/matrix_inversion.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ def invert_matrix(matrix: list[list[float]]) -> list[list[float]]:
1414
>>> invert_matrix([[4.0, 7.0], [2.0, 6.0]])
1515
[[0.6000000000000001, -0.7000000000000001], [-0.2, 0.4]]
1616
>>> invert_matrix([[1.0, 2.0], [0.0, 0.0]])
17-
[[1.0, 2.0], [0.0, 0.0]]
17+
Traceback (most recent call last):
18+
...
19+
ValueError: Matrix is not invertible
1820
"""
1921
np_matrix = np.array(matrix)
2022

0 commit comments

Comments
 (0)