Ngl.ind
Gets the indices of a Python list where the list values are true.
Prototype
tindex = Ngl.ind(plist)
Arguments
plistA Python list, tuple, or one-dimensional NumPy array.
Return value
tindexA list of integer indices where plist is True, that is, non-zero.
Description
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.
Examples
The following script:
import Ngl plist = [False, True, True, False, False, True] tlist = Ngl.ind(plist) print tlist Ngl.end()produces:
[1, 2, 5]