title: Extracting rows from an extremely large (48GB) CSV file based on condition
body: <p>I have an extremely large CSV file which has more than 500 million rows. </p>
  
  <p>But <strong>I only need a few thousand rows from it based on a certain condition.</strong> 
  I am at the moment using:</p>
  
  <pre><code>with open('/home/Documents/1681.csv', 'rb') as f:
      reader = csv.DictReader(f)
      rows = [row for row in reader if row['flag_central'] == 1]
  </code></pre>
  
  <p>Here the condition is that if the <code>flag_central == 1</code>, I need the row. </p>
  
  <p>However, since the file is extremely huge, I am not able to perform the above code. I believe it is because of the <code>for</code> loop I am using, which is causing this trouble. </p>
  
  <p>Is there anyway I can extract these certain rows from the CSV file based on the above condition?</p>