Question: 1 . Design a 1 - line code that creates a numpy array variable mat and assigns it to the following 1 0 x 1

1. Design a 1-line code that creates a numpy array variable mat and
assigns it to the following 10x10 matrix filled with numbers from
1 to 100:
12...10
1112...20
: : : :
9091...100
2. Design functions num_elements(m), num_rows(m), and
num_columns(m) that return correspondingly the number of
elements, rows, and columns in a given matrix (numpy array) m.
3. Design functions row_means(m) and column_means(m) that
compute the array of means of the rows and columns for a
matrix m, respectively. Compute row_means(mat) and
column_means(mat) for the matrix mat constructed above.
1
4.[extra-credit] Create an array b with exactly 50 points equally
spaced in the range from 11 to 23. Using list comprehension and
built-in sum() function, compute the sum of squares of elements

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