UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 11: ordinal not in range(128)
2016-04-17 16:56
375 查看
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">在用python画决策树时,运行显示UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 11: ordinal not in range(128)这个错误,应该是ascii和unicode编码冲突导致,解决方法是添加下面3行代码:</span>
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
相关文章推荐
- Python处理错误三种方式
- 电工助手 V1.3.1
- inotify配合rsync实现文件同步
- 笔记:Java二进制Class文件结构<未完待续>
- POJ 3253Fence Repair
- 虚拟机中的ubuntu(Linux系统)进行扩容
- 最后
- LeetCode-338. Counting Bits
- recycleView 遇到IndexOutOfBoundsException 及解决
- Linux 时间定时同步操作
- MapReduce的过程(2)
- VB中几种循环结构
- MapReduce的过程(2)
- Andoird Studio 错误: 非法字符: '\ufeff' 解决方案。
- 使用supervisor提高nodejs开发效率
- 团队目标和细节估计
- spring bean之间的关系:继承;依赖
- POJO(PO)与javaBean的比较、以及DTO的说明
- 支付宝当面付之扫码支付“无效签名”
- (4.5.4.1)android studio进行Unit测试和ActivityInstrumentationTestCase2测试