title: How to find specific rows in csv document in python
body: <p>What I'm trying to do is read into a csv document and find all values in the SN column > 20 and make a new file with only the rows with SN > 20. </p>
  
  <p>I know that I need to do:</p>
  
  <ol>
  <li>Read the original File</li>
  <li>Open a new file</li>
  <li>Iterate over rows of the original file </li>
  </ol>
  
  <p>What I've been able to do is find the rows that have a value of SN > 20</p>
  
  <pre><code>import csv
  import os
  
  os.chdir("C:\Users\Robert\Documents\qwe")
  
  with open("gdweights_feh_robert_cmr.csv",'rb') as f:
      reader = csv.reader(f, delimiter= ',')
      zerovar = 0
      for row in reader:
          if zerovar==0:
              zerovar = zerovar + 1
          else:
              sn = row [11]
              zerovar = zerovar + 1
              x = float(sn)
              if x &gt; 20:
                  print x
  </code></pre>
  
  <p>So my question is how do I take the rows with SN > 20 and turn it into a new file?</p>