title: Pandas exclude rows based on dynamic condition set from configuration file
body: <p>As title suggest, I have a rule engine in xml format which contains column name and values to exlcule.</p>
  <pre><code> &lt;ExclusionSet&gt;
      &lt;Exclude Excl=&quot;Col1:A&quot; Count=&quot;1&quot;/&gt;
      &lt;Exclude Excl=&quot;Col2:BB,BBB&quot; Count=&quot;1&quot;/&gt;
      &lt;Exclude Excl=&quot;Col3:A1B&quot; Count=&quot;1&quot;/&gt;
      &lt;Exclude Excl=&quot;Col1:A2&quot; Excl=&quot;Col2:BC&quot; Count=&quot;2&quot;/&gt;
   &lt;/ExclusionSet&gt;
  
  </code></pre>
  <p>based on the above condition I need to exclude rows. i.e. row where Col1 has value A, Col2 has value BB and value BBB, Col3 has value A1B.</p>
  <p>I was able to get a working code for the single condition (first 3) but unable to figure out how to implement last condition (with more than one condition)</p>
  <pre><code>def exclusionEngine(config,df):
  
      #parsing xml
      xml_map = minidom.parse(config)
      value_map = xml_map.getElementsByTagName('Exclude')
      exclusion_df = pd.DataFrame()
  
      #iterating conditions
      for atrb in value_map:
          #not using Count any where but thought it might be useful for multiple conditions.
          rule_count = atrb.attributes['Count'].value
          for count in range(1,int(rule_count)+1):        
              #column name
              col = atrb.attributes['Excl'].value.split(':')[0]
              # value(s) as a list
              value = list(atrb.attributes['Excl'].value.split(':')[1].split(','))
              
              #creating filter for exclusion ; if there is way to implement multiple filters dynamically or create a list of filters and apply it.
              filter1 = df[col].isin(value)
          
          df = df.loc[~(filter1)]
             
      return df
  </code></pre>
  <p>expecting something as follows but dynamic as there could be more conditions or less.</p>
  <pre><code>df = df.loc[~(filter1 &amp; filter2)]
  </code></pre>
  <p>EDIT:
  To simplify the ask here, is it possible to evaluate multiple conditions dynamically ?</p>
  <pre><code>&lt;Exclude Excl=&quot;Col1:A2&quot; Excl=&quot;Col2:BC&quot; Count=&quot;2&quot;/&gt;
  </code></pre>