How to read UTF-8 files with Pandas?

后端 未结 3 656
傲寒
傲寒 2020-12-14 08:32

I have a UTF-8 file with twitter data and I am trying to read it into a Python data frame but I can only get an \'object\' type instead of unicode strings:

#         


        
3条回答
  •  -上瘾入骨i
    2020-12-14 09:00

    Use the encoding keyword with the appropriate parameter:

    df = pd.read_csv('1459966468_324.csv', encoding='utf8')
    

提交回复
热议问题