Python Program to multiply two matrices (vectorized implementation)

Published: 05 November 2022
on channel: Tech Tips
64
0

Program to multiply two matrices (vectorized implementation)

Program to multiply two matrices (vectorized implementation)
import numpy as np
take a 3x3 matrix
A = [[12, 7, 3],
[4, 5, 6],
[7, 8, 9]]

take a 3x4 matrix
B = [[5, 8, 1, 2],
[6, 7, 3, 0],
[4, 5, 9, 1]]

result will be 3x4

result= [[0,0,0,0],
[0,0,0,0],
[0,0,0,0]]

result = np.dot(A,B)

for r in result:
print(r)
Output:

[114, 160, 60, 27]
[74, 97, 73, 14]
[119, 157, 112, 23]


On this page of the site you can watch the video online Python Program to multiply two matrices (vectorized implementation) with a duration of hours minute second in good quality, which was uploaded by the user Tech Tips 05 November 2022, share the link with friends and acquaintances, this video has already been watched 64 times on youtube and it was liked by 0 viewers. Enjoy your viewing!