Question: This question contains (a) (b) question. Write a function to create a 2D array of arbitrary shape. This array should have all zero values, except

This question contains (a) (b) question. Write a function to create a2D array of arbitrary shape. This array should have all zero values,This question contains (a) (b) question.

Write a function to create a 2D array of arbitrary shape. This array should have all zero values, except for the elements around the border (i.e., the first and last rows, and the first and last columns), which should have a value of one. def border (n, m): "Creates an array with shape (n, m) that is all zeros except for the border (i. e., the first and last rows and columns), which should be filled with ones. Hint: you should be able to do this in three lines (including the return statement) Parameters n, m: int Number of rows and number of columns Returns numpy array with shape (n, m # YOUR CODE HERE # Show work Below a 2D array, A88 is created that reshapes the integers 1 through 64 into an 8 X 8 array. Create a new 1-D array that only contains the last column of a8 e.g. [8, 16, 24, 32, 40, 48, 56, 64] . A88 = np. arange (1, 65). reshape (8,8) #a8 = your work

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!