0

I'm using Python 2.7 and I have a 2d array like so:

  1. 5.854, 7.225, 4.458, 1.834, 0.566, 0.14, 0.029, 0.005, 0.001, 0.0
  2. 9.39, 11.588, 7.15, 2.941, 0.907, 0.224, 0.046, 0.008, 0.001, 0.0
  3. 7.53, 9.293, 5.734, 2.359, 0.728, 0.18, 0.037, 0.007, 0.001, 0.0
  4. 4.026, 4.968, 3.066, 1.261, 0.389, 0.096, 0.02, 0.003, 0.001, 0.0
  5. 1.614, 1.992, 1.229, 0.506, 0.156, 0.039, 0.008, 0.001, 0.0, 0.0

And I want to get the indices of the four highest values in the array.

So list(map(max, ge)) gets me the highest values but I need the indices, so for the above data that would be [1, 1], [1, 0], [2, 1], [0, 1] and I'm not sure how to achieve this?

garyk1968
  • 121
  • 3
  • 8

0 Answers0