title: TypeError: next expected at least 1 arguments, got 0 I am trying to iterate through csv file
body: <p>I have the following code to iterate through a csv file.  Iterate using the last column of in the csv file, column 11</p>
  
  <p>I get the following error:</p>
  
  <pre><code>TypeError: next expected at least 1 arguments, got 0
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>    from operator import itemgetter
  import os
  import csv
  
  reader = csv.reader(open('file1.csv','rb'))
  #header = reader.next()
  header = next().reader
  data = list(reader)
  reader = None
  data.sort(key=itemgetter(11))
  
  writer = csv.writer(open('2.csv', 'wb'))
  writer.writerow(header)
  writer.writerows(data)
  </code></pre>
  
  <p>I think it is complaining about the header.</p>