Skip to content

Commit

Permalink
Numpy!
Browse files Browse the repository at this point in the history
  • Loading branch information
snehalmastud authored Feb 23, 2020
1 parent 9b282a1 commit c7c21ad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Numpy/Dot and Cross/Solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import numpy

N = int(input())

A = numpy.array([list(map(int, input().split())) for n in range(N)])
B = numpy.transpose(numpy.array([list(map(int, input().split())) for n in range(N)]))

AB = numpy.array([[numpy.dot(A[i], B[j]) for j in range(N)] for i in range(N)])

print (AB)

0 comments on commit c7c21ad

Please sign in to comment.