1. File not found
Error: [Errno 2] No such file or directory: 'C:\\Users\\ssw0926\\Desktop.chengji.csv'
1. Wrong file path
Methods to avoid errors: do not manually enter the file address, select copy.
Select the file to be read, press shift and right mouse button, and copy file address will appear.
2. Remember to add the escape character R
For example:
df=pd.read_csv(r”C:\Users\ssw0926\Desktop\chengji.csv”,encoding=”utf-8″)
2. When the file contains Chinese, it is easy to have character coding problems.
1. Error message:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte
Solution: try to transform encoding. For example, change encoding = “UTF-8” to encoding = “GB2312” or other codes.
Read More:
- How to Solve jupyter notebook Read CSV files Error
- [Solved] Python Pandas Read Error: OSError: initializing from file failed
- How to Solve Python ImportError: cannot import name UnrewindableBodyError
- Python: How to Delete Empty Files or Folders in the Directory
- Pandas read_csv pandas.errors.ParserError: Error tokenizing data
- Python: How to Reshape the data in Pandas DataFrame
- Python: How to Solve error While importing windpy
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- PyCharm: How to Solve Tensorflow_datasets Import Error
- Pychart: How to Solve myspyder.items import myitem Error
- How to Solve Error “ImportError: cannot import name imsave“
- How to Solve Pychart configuration import torch error
- How to Solve M1 chip import numpy Error
- VScode: How to Solve Pylance Error (pip Library Files Installed)
- How to Solve Python picamera and raspistill error
- [Mac M1] How to Solve import wordcloud Error: ModuleNotFoundError: No module named ‘wordcloud‘
- How to Fix pandas.errors.ParserError Error tokenizing data C error Buffer overflow caught
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- How to Solve Python3.9 Install pycrypto Error
- Python Import Error: SystemError: Parent module ‘‘ not loaded, cannot perform relative import