title: How can I tell whether a numpy boolean array contains only a single block of `True`s?
body: <p>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 <code>True</code>s, e.g.</p>
  
  
  
  <pre><code>array([False, False, False, True, True, True, False, False, False], dtype=bool)
  </code></pre>
  
  <p>i.e. where the sequence <code>...,True, False, ..., True...</code> never occurs?</p>