title: Trying to understand python csv .next()
body: <p>I have the following code that is part of a tutorial</p>
  
  <pre><code>import csv as csv
  import numpy as np
  
  csv_file_object = csv.reader(open("train.csv", 'rb'))
  header = csv_file_object.next()
  
  data = []
  for row in csv_file_object:
      data.append(row)
  data = np.array(data)
  </code></pre>
  
  <p>the code works as it is supposed to but it is not clear to me why calling <code>.next()</code> on the file with the variable <code>header</code> works. Isn't csv_file_object still the entire file? How does the program know to skip the header row when <code>for row in csv_file_object</code> is called since it doesn't appear the variable header is ever referenced once defined?  </p>