I have an array T
. I am printing all values which meet the criterion: T<5
. However, I don't know how to print the corresponding indices of values meeting this criterion. I present the expected output.
import numpy as np
T=np.array([4.7,5.1,2.9])
T1=T[T<5]
print([T1])
The expected output is
J=[0,2]