Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 workStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started