title: newline character missing in last line of pandas.to_csv
body: <p>I use the following code segment to read and store data. Note the <code>fname.write('\n')</code> that is required to add a newline character to the last line. Is this a feature or a bug?</p>
  
  <p>At least this does not look very robust to me. Trying to read the data line-by-line by explicitly searching for <code>\n</code> will fail at the last line.</p>
  
  <pre><code>data = pd.read_csv(file, sep=r'\s+', header=None,
                     names=['2Theta', 'counts', 'sigma'])
  .
  .
  with open('{}/cycle_{:04d}.xye'.format(directory, int(idx)), 'w') as fname:
      fname.write('# ')
      data.to_csv(fname, sep='\t', float_format='%18.12f',
                  index=None, header=True,
                  cols=['2Theta', 'counts', 'sigma'])
      fname.write('\n')
  </code></pre>