Q:

Write a NumPy program to generate a matrix product of two arrays

0

Write a NumPy program to generate a matrix product of two arrays.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = [[1, 0], [1, 1]]
y = [[3, 1], [2, 2]]
print("Matrices and vectors.")
print("x:")
print(x)
print("y:")
print(y)
print("Matrix product of above two arrays:")
print(np.matmul(x, y))

Sample Output:

Matrices and vectors.                                                  
x:                                                                     
[[1, 0], [1, 1]]                                                       
y:                                                                     
[[3, 1], [2, 2]]                                                       
Matrix product of above two arrays:                                    
[[3 1]                                                                 
 [5 3]]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now