title: Read all but last line of CSV file in pandas
body: <p>I have CSV files which I read in in pandas with:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import pandas as pd
  import sys
  
  filename = sys.argv[1]
  df = pd.read_csv(filename)
  </code></pre>
  
  <p>Unfortunately, the last line of these files is often corrupt (has the wrong number of commas).  Currently I open each file in a text editor and remove the last line.</p>
  
  <p>Is it possible to remove the last line in the same python/pandas script that loads the CSV to save having to take this extra non-automated step?</p>