I have an array like this
sample = np.array([[9.99995470e-01],
[9.99992013e-01],
[1.00000000e+00],
[1.00000000e+00],
[1.00000000e+00],
[1.00000000e+00],
[9.99775827e-01],
[9.99439061e-01],
[9.98361528e-01],
[9.96853650e-01],
[1.00000000e+00],
[1.00000000e+00],
[1.00000000e+00],
[1.00000000e+00],
[1.00000000e+00],
[1.00000000e+00],
[9.99999762e-01]])
I want to get the max index where the values = 1 and it occurs consecutively more than 5 times. So the output should be index no 15.
I wonder if there is a simple function to solve this