Question: (a) Use numpy's array tools to create a 3 x 3 identity matrix called I. I= 6:9) Manipulate the matrix entries such that afterwards, your

(a) Use numpy's array tools to create a 3 x 3 identity matrix called I. I= 6:9) Manipulate the matrix entries such that afterwards, your matrix reads 0 3 I = 0 1 0 3 0 1 (ii) numpy includes the array creation function "linspace". Usage is: >>>x = np.linspace(a, b, n) Such a call creates an array of n equidistant points in the interval [a,b], both bounds included. The result is stored as x (or any other variable name of your own choice.) Task: Create numpy array x of 11 equidistant points in the interval (-2,3]. Next replace the entries 2 to 4 (both included) in this array with zeros and print the array. The final array should be [-2.0, -1.5, 0.0, 0.0,0.0,0.5, 1.0, 1.5, 2.0, 2.5, 3.0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
