pandas读文件时中UnicodeDecodeError常用解决方案
如果我们遇到UnicodeDecodeError,一般而言是因为编码错误。所以尝试其他编码是个不错的选择。但一一尝试速度较慢,我们不妨使用chardet库和pandas读文件的其他机制解决问题。chardet库可以帮我们检测可能的编码。import pandas as pdimport numpy as npimport chardet# look at the first ten thousand bytes to guess the character encodingwith
原创
2022-03-03 18:06:00 ·
3240 阅读 ·
0 评论