title: For loop through a function an DataFrame Python
body: <p>I write a function to remove outliers from each column in a table:( i attached a photo of the table)</p>
  
  <p><a href="https://i.stack.imgur.com/5a57B.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>The function to remove the outliers is:</p>
  
  <pre><code>def remove_outliers(df_in, col):
  
      q1 = df_in[col].quantile(0.25)
      q3 = df_in[col].quantile(0.75)
      iqr = q3-q1
      lower_bound = q1-1.5*iqr
      upper_bound = q3+1.5*iqr
      df_out = df_in.loc[(df_in[col] &gt; lower_bound) &amp; (df_in[col] &lt; upper_bound)]
      return df_out
  </code></pre>
  
  <p>Now i would like to make a "for loop" or any other loop, that the code run through each column of the table an do the function of removing the outliers and get a new table without outliers.</p>
  
  <p>Could someone help me?</p>
  
  <p>Thanks</p>
  
  <p>Muhrez</p>