title: Pandas: Apply filter on a subset of columns
body: <p>Lets say I have data like this:</p>
  <pre><code>df = pd.DataFrame({'category': [&quot;blue&quot;,&quot;blue&quot;,&quot;blue&quot;, &quot;blue&quot;,&quot;green&quot;], 'val1': [5, 3, 2, 2, 5], 'val2':[1, 3, 2, 2, 5]})
  print(df)
  
    category  val1  val2
  0     blue     5     1
  1     blue     3     3
  2     blue     2     2
  3     blue     2     2
  4    green     5     5
  </code></pre>
  <p>I want to get the rows where any value is &gt; 3. For my example here that has only two columns I can just do</p>
  <pre><code>df.loc[(df['val1'] &gt; 3) | (df['val2'] &gt; 3)]
  
      category    val1    val2
  0   blue    5   1
  4   green   5   5
  </code></pre>
  <p>Now let's say I have a dataset with a large amount of (numeric) columns, and I want to get all rows where the value of any of the numeric columns meets a condition (like for example being &gt; 3). Is there a way to check a condition over multiple columns without having to chain them with <code>|</code> ?</p>
  <p>So for example let's say I have a dataframe with n columns named val1 to valn and I want all rows where any of the values in val1 to valn is &gt; 3. Is there a better way / shorter way of doing it than</p>
  <pre><code>df.loc[(df['val1'] &gt; 3) | (df['val2'] &gt; 3) | ... | (df['valn'] &gt; 3)]
  </code></pre>
  <p>?</p>