I have a np.array similar to this one :
A = np.array([-1,-0.5,0.5,1,2,-2,-0.25,2,5])
I would like to get the indices where the array passes from negative to positive, but not the other way around (which would be achieved using np.sign methods). Hence, my desired output would be only :
ind = [1,6]
So far I tried things similar to this answer, but then I also index 4 which I do not want. My real array is rather large (about 10k elements) and the occurrence of sign changes is not regular. Thank you for your help !