Question: PYTHON QUESTION: Assume that a is a 2-dimensional NumPy array of shape (4,2) and that b is a 2-dimensional NumPy of shape (2,3). Write a

PYTHON QUESTION:

Assume that a is a 2-dimensional NumPy array of shape (4,2) and that b is a 2-dimensional NumPy of shape (2,3). Write a statement that creates a 2-dimensional NumPy array c of shape (4,3) that is equal to the product of a and b, considered as matrices.

You may assume that numpy has been imported as np.

So, if a is a 4x2 NumPy array [[1,2],[3,4],[5,6],[7,8]] and b is a 2x3 NumPy array [[0,1,2],[3,4,5]], then c will be the 4x3 NumPy array [[6,9,12],[12,19,26],[18,29,40],[24,39,54]].

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!