Encoding error when reading csv file containing pandas dataframe
<p>I used <code>df.to_csv()</code> to convert a dataframe to csv file. Under python 3 the <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html#pandas.read_csv" rel="nofollow noreferrer">pandas doc</a> states that it defaults to utf-8 encoding.</p>
<p>However when I run <code>pd.read_csv()</code> on the same file, I get the error:</p>
<pre><code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xae in position 8: invalid start byte
</code></pre>
<p>But using <code>pd.read_csv()</code> with <code>encoding=&quot;ISO-8859-1&quot;</code> works.</p>
<p>What is the issue here and how do I resolve it so I can write and load files with consistent encoding?</p>