title: Iterate though rows in a dataframe to find index, values in a column in jupyter and print the report in csvfile
body: <p>I would like to check if there are any values in Column 'Weight' that are less than 90. If yes, I would like to store the index and values in a variable, so I can print it out in csvfile. I used the following code but I am getting wrong output.Please help.</p>
  
  <pre><code>import csv
  import pandas as pd
  
  for index, row in df.iterrows():
      if row['Weight'] &lt; 90:
         result = index, row['Weight']
  
  res = [result]
  csvfile = "&lt;Report&gt;"
  
  with open(csvfile, "w") as output:
      writer = csv.writer(output, lineterminator='\n''\n')
      for val in res:
          writer.writerow([val])  
  </code></pre>