1. Engineering
  2. Computer Science
  3. 4 points the indarrayargntino and indarray rgmax methods can only...

Question: 4 points the indarrayargntino and indarray rgmax methods can only...

Question details

4 points) The Indarray.argntinO and Indarray. rgmax methods can only return the index from a flat array, which means they unfold the n-dim array into 1-d array and return the 1-d index. For example, the following code will return 18. Now we want to obtain a tuple of indices which can be used to locate the minimum or maximum. Each element of the tuple is the index of minimum or maximum in the corresponding dimension. In the following example we want to find C4,2), so that array[4,23 will give the.maximum. np random.seed(10) array? - np.random.randn(5,4) print(arrayz) array2.argmax Please write two functions array argnincarr) input arr is an n-dim array, and the functions will return a tuple of n: indices for the minimum and maximum respectively and array argmax Carr) where the F6 F7 F8 F5 4 0
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution