title: Ignore eof character when reading csv to dataframe
body: <p>I have a csv file that I believe originated on Windows and has some line &amp; file endings that I'm not used to. Between lines it has what show up in python as <code>'\r\n'</code>, and at the very end it has <code>'\r\n\x1a'</code> (when read in binary mode).</p>
  
  <p>When I try to read with <code>pd.read_csv()</code>, it gives me an extra row with the first entry being <code>'\x1a'</code> and the rest as NaN.</p>
  
  <pre><code>In [1]: import pandas as pd
  In [2]: from StringIO import StringIO
  In [3]: s = StringIO('a,b\r\n1,2\r\n3,4\r\n\x1a')
  In [4]: df = pd.read_csv(s)
  In [5]: df
  Out[5]:
     a   b
  0  1   2
  1  3   4
  2   NaN
  </code></pre>
  
  <p>Is this file ending common enough that there's a built in option to ignore it in pandas? If not, any suggestions for not reading the EOF character into the dataframe or is the best way to manually test for it and drop the row after reading?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>My tentative solution is to apply this function after reading:</p>
  
  <pre><code>def strip_eof(df):
      "Drop last row if it begins with '\x1a' ends with NaN's"
      lastrow = df.iloc[-1]
      if lastrow[0] == '\x1a' and lastrow[1:].isnull().all():
          return df.drop([lastrow.name], axis=0)
      return df
  </code></pre>