title: How to use a conditional statement based on DataFrame boolean value in pandas
body: <p>Now I know how to check the dataframe for specific values across multiple columns. However, I cant seem to work out how to carry out an if statement based on a boolean response.</p>
  
  <p>For example:</p>
  
  <p>Walk directories using <code>os.walk</code> and read in a specific file into a dataframe.</p>
  
  <pre><code>for root, dirs, files in os.walk(main):
          filters = '*specificfile.csv'
          for filename in fnmatch.filter(files, filters):
          df = pd.read_csv(os.path.join(root, filename),error_bad_lines=False)
  </code></pre>
  
  <p>Now checking that dataframe across multiple columns. The first value being the column name (column1), the next value is the specific value I am looking for in that column(banana). I am then checking another column (column2) for a specific value (green). If both of these are true I want to carry out a specific task. However if it is false I want to do something else.</p>
  
  <p>so something like:</p>
  
  <pre><code>if (df['column1']=='banana') &amp; (df['colour']=='green'):
      do something
  else: 
      do something
  </code></pre>