title: Python pandas DataFrame from first and last row of csv
body: <p>All - </p>
  
  <p>I am looking to create a pandas DataFrame from only the first and last lines of a very large csv. The purpose of this exercise is to be able to easily grab some attributes from the first and last entries in these csv files. I have no problem grabbing the first line of the csv using:</p>
  
  <pre><code>pd.read_csv(filename, nrows=1)
  </code></pre>
  
  <p>I also have no problem grabbing the last row of a text file in various ways, such as:</p>
  
  <pre><code>with open(filename) as f:
      last_line = f.readlines()[-1]
  </code></pre>
  
  <p>However, getting these two things into a single DataFrame has thrown me for a loop. Any insight into how best to achieve this goal?</p>
  
  <p>EDIT NOTE: I am trying to achieve this task without loading all of the data into a single DataFrame first as I am dealing with pretty large (>15MM rows) csv files.</p>
  
  <p>Thanks!</p>