How to display Chinese characters inside a pandas dataframe?
<p>I can read a csv file in which there is a column containing Chinese characters (other columns are English and numbers). However, Chinese characters don't display correctly. see photo below</p>

<p><a href="http://i.stack.imgur.com/nG6oN.png" rel="nofollow"><img src="http://i.stack.imgur.com/nG6oN.png" alt="enter image description here"></a></p>

<p>I loaded the csv file with <code>pd.read_csv()</code>. </p>

<p>Either <code>display(data06_16)</code> or <code>data06_16.head()</code> won't display Chinese characters correctly. </p>

<p>I tried to add the following lines into my <code>.bash_profile</code>:</p>

<pre><code>export LC_ALL=zh_CN.UTF-8
export LANG=zh_CN.UTF-8

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
</code></pre>

<p>but it doesn't help. </p>

<p>Also I have tried to add <code>encoding</code> arg to <code>pd.read_csv()</code>: </p>

<pre><code>pd.read_csv('data.csv', encoding='utf_8')
pd.read_csv('data.csv', encoding='utf_16')
pd.read_csv('data.csv', encoding='utf_32')
</code></pre>

<p>These won't work at all. </p>

<p>How can I display the Chinese characters properly? </p>

<p>I just remembered that the source dataset was created using <code>encoding='GBK'</code>, so I tried again using </p>

<pre><code>data06_16 = pd.read_csv("../data/stocks1542monthly.csv", encoding="GBK")
</code></pre>

<p>Now, I can see all the Chinese characters. </p>

<p>Thanks guys!</p>

python csv pandas encoding chinese-locale