Question: 39. Write a Python function that takes in as parameters two numpy arrays A and B, checks that the inner dimensions of A and B

 39. Write a Python function that takes in as parameters two

39. Write a Python function that takes in as parameters two numpy arrays A and B, checks that the inner dimensions of A and B match, and if they do calculate and return C=AB (matrix multiplication (not by-element)). If they don't match, have your function return an empty numpy array. The inner dimensions of two matrices multiplied together are the two interior numbers. For matrices with dimensions 23 and 34, the inner dimensions match (both 3). For matrices with dimensions 32 and 34, the inner dimensions do not match (2 and 3)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!