From b71f472ffcfe3a22a3d280008a39c7d0ab67c258 Mon Sep 17 00:00:00 2001 From: Selbl <84146608+Selbl@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:33:40 -0700 Subject: [PATCH] Numpy Solution Added a numpy solution for Problem 8 --- Problems/8_Calculate_2x2_Matrix_Inverse/solution_2.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Problems/8_Calculate_2x2_Matrix_Inverse/solution_2.py diff --git a/Problems/8_Calculate_2x2_Matrix_Inverse/solution_2.py b/Problems/8_Calculate_2x2_Matrix_Inverse/solution_2.py new file mode 100644 index 00000000..f8c78d01 --- /dev/null +++ b/Problems/8_Calculate_2x2_Matrix_Inverse/solution_2.py @@ -0,0 +1,4 @@ +import numpy as np + +def inverse_2x2(matrix: list[list[float]]) -> list[list[float]]: + return np.linalg.inv(np.array(matrix)) \ No newline at end of file