Answers for "returns the maximum value occurring in the array A between position i and j."

1

how to get index of max n values in an array

In [1]: import numpy as np

In [2]: arr = np.array([1, 3, 2, 4, 5])

In [3]: arr.argsort()[-3:][::-1]
Out[3]: array([4, 3, 1])
Posted by: Guest on July-04-2020

Code answers related to "returns the maximum value occurring in the array A between position i and j."

Browse Popular Code Answers by Language