I have a problem in printing array indices with the value I want to find. I'm getting just the first indices and then not the others.
I have tried with the np.where function but It won't work so I had to make a loop manually.
Here's the code:
g = 0.34
while g <= 0.97:
idx = []
for i in range (0, y2.size):
if y2[i] == g:
idx.append(i)
print(idx)
g = g + 0.01
This is what I have:
[92, 376]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
.....
The array has 500 values from 0.34 to 0.97. Same output with np.where(y2 == g) without the loop.