Question: Create a 2D NumPy array (that is a matrix): M = np. array ([[1,2],[3,7],[-1,5]]) print (M) Verify the number of dimensions, shape of the array

Create a 2D NumPy array (that is a matrix): M = np. array ([[1,2],[3,7],[-1,5]]) print (M) Verify the number of dimensions, shape of the array and size: M. ndim M. shape M. size Select a row or column from a 2D NumPy array and we get a 1D array: col = M[:,1] print (col ) Verify the number of dimensions, shape and size of the slice: col . ndim col . shape col . size Page

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 Accounting Questions!