Question: Modify the code below to resize the array into (1, 27) and (3, 9). Then set the element [0,0,1]=1, [1,1,2]=2 and [2,1,1]=3. Run the

Modify the code below to resize the array into (1, 27) and


Modify the code below to resize the array into (1, 27) and (3, 9). Then set the element [0,0,1]=1, [1,1,2]=2 and [2,1,1]=3. Run the code and display the results. (Submit separately as a python file) ## zeros.py -creating and resizing an array# import numpy as np print("INZERO ARRAY ') zeroarray = np.zeros((3,3,3)) print('Zero array size: , np.size(zeroarray)) print(Zero arrayshape: ', np.shape(zeroarray), "In') print(zeroarray) !! b) (5 marks) Modify to the following code to shift, rotate and crop the image. You can choose the coordinates of shifting yourself. (Submit separately as a python file) ## prettyface.py #import matplotlib.pyplot as plt from scipy import ndimage from scipy import miscface = misc.face(gray=True) pit.imshow(face) plt.imshow(face, cmap%3plt.cm.gray) plt.show() c) (10 marks) Write Linux commands for the following: To Change the name of the existing file. (2) To show the current working directory. (2) To go two levels up in the directory structure. (2) To change directory to GURRENTDIR. (2) To accept parameters at the command line rather than hard coding them within the program. (2) i. iv. V.

Step by Step Solution

3.54 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

PART A The modified code for the given problem is given below with the output import numpy as np pri... View full answer

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!