python filter and list and apply "filtered indices" to another list
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/10274774/python-elegant-and-efficient-ways-to-mask-a-list">Python: Elegant and efficient ways to mask a list</a>  </p>
</blockquote>



<p>I have two equal sized lists, something like:</p>

<pre><code>a=["alpha","beta","kappa","gamma","lambda"]
b=[1,2,None,3,4,5]
</code></pre>

<p>What I would like to do is identify and delete the none element in list [b] and then remove the corresponding element in list [a]. Here, for example, I would like to delete none and "kappa".</p>

<p>I am aware of:</p>

<p>filter(bool,b)</p>

<p>which would remove the None elements from [b], but, how do I go about deleting the corresponding entry in list[a]?</p>

<p>I tried zip, something like (the idea was to pack and unpack):</p>

<pre><code>a=["a","b","c","d","e"]
b=[1,2,None,3,4]
c=zip(a,b)
d=filter(bool,c)
</code></pre>

<p>..but this does not work. [d] still has the none elements.</p>

<p>I would appreciate any pythonic way to achieve this.</p>
