执行以下语句时
amazon_df=pd.read_csv(DATA_PATH+r"Amazon.csv")
报错:UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa0 in position 37: invalid start byte
解决:amazon_df=pd.read_csv(DATA_PATH+r"Amazon.csv",‘utf-8’)
警告:ParserWarning: Falling back to the ‘python’ engine because the ‘c’ engine does not support regex separators (separators > 1 char and different from ‘s+’ are interpreted as regex); you can avoid this warning by specifying engine=‘python’.
解决:amazon_df=pd.read_csv(DATA_PATH+r"Amazon.csv",engine=‘python’)
最后
以上就是寂寞诺言最近收集整理的关于python使用read_csv时出现警告和解码错误的全部内容,更多相关python使用read_csv时出现警告和解码错误内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复