title: Filter pandas dataframe columns based on value for columns in a list
body: <p>I have a dataframe df defined as below :</p>
  <pre><code>df = pd.DataFrame()
  df[&quot;A&quot;] = ['True','True','True','True','True']
  df[&quot;B&quot;] = ['True','False','True','False','True']
  df[&quot;C&quot;] = ['False','True','False','True','False']
  df[&quot;D&quot;] = ['True','True','False','False','False']
  df[&quot;E&quot;] = ['False','True','True','False','True']
  df[&quot;F&quot;] = ['HI','HI','HI','HI','HI']
  </code></pre>
  <pre><code>&gt;&gt; df
  
        A      B      C      D      E   F
  0  True   True  False   True  False  HI
  1  True  False   True   True   True  HI
  2  True   True  False  False   True  HI
  3  True  False   True  False  False  HI
  4  True   True  False  False   True  HI
  </code></pre>
  <p>and a list</p>
  <pre><code>lst = [&quot;A&quot;,&quot;C&quot;]
  </code></pre>
  <p>I would like to filter the rows in df based on the values being <code>'True'</code> for the columns in <code>lst</code>.
  That is, I would like to get my resultant dataframe as :</p>
  <pre><code>      A      B     C      D      E   F
  1  True  False  True   True   True  HI
  3  True  False  True  False  False  HI
  </code></pre>
  <p>Instead of looping through the column names from the list and filtering it, is there any better solution for this?</p>