title: How can provide dynamically varying OR conditions for filtering dataframe
body: <p>I have a <code>dataframe</code> and I use mutiple conditions to filter it.The code is kind of like below (recency.py).</p>
  
  <pre><code>def recency(config):
      i = config.exclude_list
  
      sales = pd.read_excel(config.input_path + "klm sales UPD.xlsx")
  
  
      df_exclude = sales[(sales["Product"].str.contains(i[0])==True)
                       | (sales["Product"].str.contains(i[1])==True)                     
                       | (sales["Customer"].str.contains(i[2])==True)
                       | (sales["Customer"].str.contains(i[3])==True)
                       | (sales["Customer"].str.contains(i[4])==True)
                       | (sales["Customer"].str.contains(i[5])==True)
                       | (sales["Customer"].str.contains(i[6])==True)
                       | (sales["Remarks"].str.contains(i[7])== True)                   
                       | (sales["Net Amount"]&lt;10)]
  </code></pre>
  
  <p>Here is the config class (config.py):</p>
  
  <pre><code>class config:
  
      input_path = "/home/ram/Downloads/Data_Science/"
      exclude_list = ["SCRAP ","GFT","B-MART HOME APPLIANCES","4 ELECTRONICS &amp; APPLIANCES","DISCOUNT CORNER","CASH CUSTOMER","CASH BILL","GIFT"]
  </code></pre>
  
  <p>And here is the main file(main.py):</p>
  
  <pre><code>from config import config
  from Recency import recency
  recency(config)
  </code></pre>
  
  <p>This config is a python file where I have defined a class(named config) with <code>exclude_list</code> and this is what I send to the function(recency) via a main program.The problem here is I have included 8 items in the excluded list and this might change n future. So I might need to make changes to <code>recency function</code>(receny.py), such that when  create another <code>config</code> file which contains more (or less) than 8 items in excluded list,I will be able to use the same recency function to get df_exclude.What possible ways I can do this in python?</p>
  
  <p>If anything is not clear in this question,please let me know in the comments.</p>