IPython Notebook: What is the default encoding?

后端 未结 1 818
迷失自我
迷失自我 2021-02-01 17:55

I have created a package using the encoding utf-8.

When calling a function, it returns a DataFrame, with a column coded in utf-8.

When using IPytho

相关标签:
1条回答
  • 2021-02-01 18:14

    I had the same problem recently, and indeed setting the default encoding to UTF-8 did the trick:

    import sys
    reload(sys)
    sys.setdefaultencoding("utf-8")
    

    Running sys.getdefaultencoding() yielded 'ascii' on my environment (Python 2.7.3), so I guess that's the default.

    Also see this related question and Ian Bicking's blog post on the subject.

    0 讨论(0)
提交回复
热议问题