How to display Chinese characters inside a pandas dataframe?

前端 未结 3 1666
悲&欢浪女
悲&欢浪女 2021-01-03 04:26

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.

3条回答
  •  情话喂你
    2021-01-03 05:09

    I just remembered that the source dataset was created using encoding='GBK', so I tried again using

    data06_16 = pd.read_csv("../data/stocks1542monthly.csv", encoding="GBK")
    

    Now, I can see all the Chinese characters.

    Thanks guys!

提交回复
热议问题