'utf-8' codec can't decode byte 0xe9 in position 3114: invalid continuation byt
时间: 2023-10-19 11:08:05 浏览: 184
这个错误是由于在使用utf-8编码打开文件时,遇到了无效的继续字节导致的。解决这个问题的方法是将编码改为ISO-8859-1。具体的代码如下:
movies = pd.read_table('../../dataset/ml-1m/movies.dat', sep='::', header=None, engine='python', encoding='ISO-8859-1').to_numpy()
通过将编码改为ISO-8859-1,可以成功解决这个错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 2: invalid continuation byte-...](https://download.csdn.net/download/weixin_42204453/15589184)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [解决‘utf-8‘ codec can‘t decode byte 0xe9 in position 3114: invalid continuation byte 错误](https://blog.csdn.net/qq_38253837/article/details/115146860)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文