Skip to main content
edited tags
Link
eyllanesc
  • 245.5k
  • 19
  • 204
  • 282
Source Link
Zanam
  • 4.8k
  • 18
  • 78
  • 169

Finding index of largest negative and smallest positive element in array

I have an array as follows:

import numpy as np    
Arr = np.array([-10, -8, -8, -6, -2, 2, 4, 19])

How do I find the index of largest negative and smallest positive number?

i.e in the above example index of -2 and 2.