title: Filter list using Boolean index arrays
body: <p>How can I use boolean inddex arrays to filter a list without using numpy?</p>
  
  <p>For example:</p>
  
  <pre><code>&gt;&gt;&gt; l = ['a','b','c']
  &gt;&gt;&gt; b = [True,False,False]
  &gt;&gt;&gt; l[b]
  </code></pre>
  
  <p>The result should be:</p>
  
  <pre><code>['a']
  </code></pre>
  
  <p>I know numpy support it but want to know how to solve in Python.</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; l = np.array(['a','b','c'])
  &gt;&gt;&gt; b = np.array([True,False,False])
  &gt;&gt;&gt; l[b]
  array(['a'], 
        dtype='|S1')
  </code></pre>