title: Python: how to slice a csv file with respect to a column other than the first?
body: <p>I have a <code>csv</code> file which displays a number of columns and almost 500000 rows. I need to slice this file with respect to the second column, which displays the year, maintaining all the other columns:</p>
  
  <pre><code>COL1   COL2   COL3   COL4   COL5   COL6   COL7
  xxx    1986   xxx    xxx    xxx    xxx    xxx
  xxx    1992   xxx    xxx    xxx    xxx    xxx
  xxx    1998   xxx    xxx    xxx    xxx    xxx
  ...    ...    ...    ...    ...    ...    ...
  xxx    2015   xxx    xxx    xxx    xxx    xxx
  xxx    1984   xxx    xxx    xxx    xxx    xxx
  </code></pre>
  
  <p><strong>My question</strong>: how can I produce another <code>csv</code> file out of this, where the values in the second column are <code>&gt;=1992</code>?</p>
  
  <p>Desired output:</p>
  
  <pre><code>COL1   COL2   COL3   COL4   COL5   COL6   COL7
  xxx    1992   xxx    xxx    xxx    xxx    xxx
  xxx    1998   xxx    xxx    xxx    xxx    xxx
  xxx    2015   xxx    xxx    xxx    xxx    xxx
  </code></pre>
  
  <p>My attempt is this, but I got stuck at the point where I should insert an <code>if</code> linked to the second column, but I don't know how to do that:</p>
  
  <pre><code>from __future__ import division
  import numpy
  from numpy import *
  import csv
  from collections import *
  import os
  import glob
  
  directoryPath=raw_input('Working directory: ') #Indicates where the csv file is located
  for i,file in enumerate(os.listdir(directoryPath)): #Loops over the folder where the csv files are
      if file.endswith(".csv"): #Checks if they are csv files
          filename=os.path.basename(file) #Takes the complete path to the file
          filelabel=file #Takes the filename only
          strPath = os.path.join(directoryPath, file) #Retrieves the complete path to find the csv file
          x=numpy.genfromtxt(strPath, delimiter=',')[:,7] #I GOT STUCK HERE
  </code></pre>