title: How to ignore "not in index" error in python
body: <p>I have <code>col_list = [ &quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;,&quot;E&quot;]</code></p>
  <p>My dataframe has column <code>[ &quot;A&quot;,&quot;B&quot;,&quot;X&quot;,&quot;Y&quot;,&quot;Z&quot;]</code></p>
  <p>If I run below code I will obviously get error &quot;not in index&quot; as C,D,E is not there BUT I want code to ignore that and add if any column matches with column in list (here it should add A + B)</p>
  <pre><code>df = df[df[col_list].sum(axis=1) == 0]
  </code></pre>
  <p>I used intersection but it dropped X,Y,Z from dataframe so can't use that.</p>