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
|
346 Discussions
|
Please Login in order to post a comment
import numpy as np
n = int(input())
A = np.array([list(map(int,input().split(' '))) for _ in range(n)])
B = np.array([list(map(int,input().split(' '))) for _ in range(n)])
print(np.dot(A,B))
import numpy
n = int(input())
A = numpy.array([list(map(int, input().strip().split())) for _ in range(n)]) B = numpy.array([list(map(int, input().strip().split())) for _ in range(n)])
print(numpy.dot(A, B))
For Python3 Platform