Question: Write a Python function that takes in a NumPy array (of arbitrary dimension), changes all of the entries on the border to 0s, and returns
Write a Python function that takes in a NumPy array (of arbitrary dimension), changes all of the entries on the border to 0s, and returns the resulting array. For example, if you run your function on the array np.ones([3,3,3]), there should only be one non-zero entry in the output: the element in the center of the array.
Using np.ndenumerate
multidimensional
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
