
Learn how to do matrix multiplication in Python using@
operator.
@
operator is supported in Python version 3.5 and above. The operator works on ndarrays
# Matrix multiplication using @importnumpyasnpimportrandom# Generate a listX=[[iforiinrandom.sample(range(0,10),3)]foriinrange(3)]Y=[[iforiinrandom.sample(range(0,10),3)]foriinrange(3)]# You can use numpyX=np.array(X)Y=np.array(Y)Z=X@Yprint(Z)
@vidyasagar Machupalli
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse