title: How to select columns of a data frame not in a list of names in Python
body: <p>I want to subset the column index of a data frame, by keeping all of the columns that do NOT start with a certain string. Right now I can filter the column index for columns that start with a certain string, but I'd like to do the opposite and exclude column names that match a certain criterion.</p>
  
  <p>If trying to keep the columns</p>
  
  <p>If trying to keep column names that start with FR, I use this code, which works.</p>
  
  <pre><code>factor_list = df2.filter(like = 'FR_', axis=1).columns
  </code></pre>
  
  <p>Trying to exclude columns that start with "FR", I've tried many things including the following:</p>
  
  <pre><code>factor_list = df2.filter(like != 'FR_', axis=1).columns
  factor_list = ~df2.filter(like = 'FR_', axis=1).columns
  </code></pre>