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 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
Get step-by-step solutions from verified subject matter experts
