title: Indexing a Boolean Array with another Boolean Array in Python
body: <p>I have a dataset with two Boolean arrays. </p>
  
  <p>The first boolean array indicates which data points have an error attached to them and is used to specify whether or not to turn on the error in an MCMC routine. The second array indicates whether or not each data point has a measured length. </p>
  
  <p>How can I index the <code>Boolean_error</code> array by the <code>Has_length</code> array, so that I will have a list comprised of objects with <code>Has_length == True</code> with either <code>Boolean_error == True</code> or <code>Boolean_error == False</code>?</p>
  
  <p>Here's an example of what I'm trying to do:</p>
  
  <pre><code>Boolean_error = [False True False True True False True False False False False False]
  Has_length = [True True True True False True True True True True True False]
  
  print Boolean_error[Has_length]
  
  &gt;&gt;&gt; [False True False True False True False False False False]
  </code></pre>