Question: Problem 9 (7 points) Given a 1-d array and two digits: i andj, set all values between i andj to .inpace. Use NumPy indexing to

Problem 9 (7 points) Given a 1-d array and two digits: i andj, set all values between i andj to .inpace. Use NumPy indexing to solve this problem. No for loops, please. Have fun with it! You can solve this in one line In : def np5(a, i, j): raise NotImple entedError) Expected output: npS(np.arange(11), 3, 8) Use the cell below to test your function In [ : nps np.arange(1,5), 2, 4) In []: "Check that method returns the correct output for several inputs"" #assert np.testig.assert_allclose np5 np.arange (1,5), 2, 4), np . array([ 1, 2, e, e])) np.testing.assert_allclose(np5 np.arange (11), 3, 8), 3, np.array(e, 1, 2, e, o, , o, e, 9,10))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
