If I have a numpy array containing booleans, say the output of some math comparison, what's the best way of determining whether that array contains only a single contiguous block of True
s, e.g.
array([False, False, False, True, True, True, False, False, False], dtype=bool)
i.e. where the sequence ...,True, False, ..., True...
never occurs?