I have a long list (Table) consisting of "True"s and "False"s. I would like to identify the position in the list of the last entry that takes the value "False". Is there a way to do this?
1 Answer
You can use FirstPosition
on Reverse
d input list:
Length[list] + 1 - FirstPosition[False] @ Reverse[list]
Alternatively, use PositionIndex
:
Last @ PositionIndex[list][False]
or Position
:
Last @ Position[False][list]
or SequenceCases
:
SequenceCases[list, a:{___, False} :> Length[a]]
Last[Position[list,False,1]][[1]]
? $\endgroup$FirstPosition
but noLastPosition
. $\endgroup$