Gets the indices of a Python list where the list values are true.
tindex = Ngl.ind(plist)
A Python list, tuple, or one-dimensional NumPy array.
A list of integer indices where plist is True, that is, non-zero.
This function takes a Python list, tuple, or one-dimensional NumPy array as its only argument and returns a list of indices where the values in the input are true.
The following script:
import Ngl plist = [False, True, True, False, False, True] tlist = Ngl.ind(plist) print tlist Ngl.end()produces:
[1, 2, 5]