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
- Dot and Cross
- Discussions
Dot and Cross
Dot and Cross
Sort by
recency
|
352 Discussions
|
Please Login in order to post a comment
Here is HackerRank Dot and Cross in Python solution - https://programmingoneonone.com/hackerrank-dot-and-cross-problem-solution-in-python.html
Not sure why they want you to do dot and cross when numpy has a matrix multiplication method.
print(np.matmul(a, b))
import numpy n = int(input()) A = [list(map(int, input().split()))for _ in range (n)] B = [list(map(int, input().split()))for _ in range (n)] A = numpy.array(A) B = numpy.array(B) print(numpy.dot(A,B))