We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Linear Algebra
- Discussions
Linear Algebra
Linear Algebra
Sort by
recency
|
298 Discussions
|
Please Login in order to post a comment
Here is HackerRank Linear Algebra in Python solution - https://programmingoneonone.com/hackerrank-linear-algebra-problem-solution-in-python.html
import numpy as np N = int(input()) matrix = [] for _ in range(N): row = list(map(float, input().split()) matrix.append(row)
A = np.array(matrix) det = np.linalg.det(A) print(round(det, 2))
# Enter your code here. Read input from STDIN. Print output to STDOUT
import numpy as np n = int(input()) matrix = [list(map(float, input().split())) for _ in range(n)]
np_matrix = np.array(matrix)
det = np.linalg.det(np_matrix)
print(round(det,2))
For Python3 Platform