C:\Users\HP\数据.csv is not UTF-8 encoded
时间: 2023-09-10 22:04:47 浏览: 248
If you are trying to read a CSV file named "数据.csv" using Python and it is showing the error "C:\Users\HP\数据.csv is not UTF-8 encoded", it means that the file is not encoded in UTF-8 format which is the default encoding used by Python.
To resolve this issue, you can try specifying the encoding of the file explicitly while reading it using the `encoding` parameter. For example, if the file is encoded in GBK format, you can use the following code to read it:
```python
import pandas as pd
df = pd.read_csv('C:/Users/HP/数据.csv', encoding='GBK')
```
Replace `GBK` with the correct encoding of your file. If you are not sure about the encoding of the file, you can try opening it in a text editor that supports multiple encodings and check the encoding used by the file.
阅读全文