Question: Write a function called reshape_and_multiply that has two inputs called Matrix1 and Matrix2 where each is represented as a numpy array. The function should
Write a function called reshape_and_multiply that has two inputs called Matrix1 and Matrix2 where each is represented as a numpy array. The function should reshape Matrix2 so that the product of Matrix1 and Matrix2 is possible, and then it should return the product. For this question, it will always be possible to reshape Matrix2 so that the product of Matrix1 and Matrix2 is possible. You will not need to slice Matrix1 or Matrix2, and you will not need to reshape Matrix1. For example, if the shape of Matrix1 were (10,8) and the shape of Matrix2 were (14,12), then the shape of the reshaped Matrix2 would be (8,21).
Step by Step Solution
3.38 Rating (148 Votes )
There are 3 Steps involved in it
Here is an example implementation of the reshapeandmultiply function in Pyth... View full answer
Get step-by-step solutions from verified subject matter experts
