index of all true boolean in a list code example
Example 1: python index where true
>>> import numpy as np
>>> states = [False, False, False, False, True, True, False, True, False, False, False, False, False, False, False, False]
>>> np.where(states)[0]
array([4, 5, 7])
Example 2: indices of true boolean array pyton
np.where(A)