#Read a *.txt file using the read_table() function in the Pandas library
data = pd.read_table(r'D:\New\test.txt',delimiter=',',encoding = 'UTF-8')
print(data)
Title defect Solution: add “R” before the path to solve it.
python D:\New\MyTest.py
name date id
0 jianghu 20210201 00001
1 jianghu1 20210202 00002
2 jianghu2 20210203 00003
Read More:
- [Solved] SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 6-7: malformed
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- Python Error: SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3:
- [Solved] SyntaxError: (unicode error) ‘utf-8’ codec can’t decode byte 0xbe in position 0
- [Solved] UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xbf in position 7: invalid start byte
- How to Solve Pytorch DataLoader Loading Error: UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe5 in position 1023
- [Solved] git review Error: UnicodeDecodeError: ‘gbk‘ codec can‘t decode
- [Solved] Grid Search Error (GridSearchCV): ‘ascii‘ codec can‘t encode characters in position 18-20: ordinal not in r
- Django CSV file Error: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb5 in position 0: invalid start
- [Exception]’ascii’ codec can’t decode byte 0xe8 in position 2: ordinal not in range(128)
- [Solved] RuntimeError: function ALSQPlusBackward returned a gradient different than None at position 3, but t
- can‘t multiply sequence by non-int of type ‘numpy.float64‘
- AttributeError: can‘t set attribute [How to Solve]
- [Solved] Can‘t pickle local object ‘_createenviron.<locals>.encodekey‘
- [Solved] flask db migrate execute error: ERROR [flask_migrate] Error: Can‘t locate revision identified by ‘8d1ad59dc71a‘
- [Solved] YOLO v5 Error: AttributeError: Can‘t get attribute SPPF on module models
- Flask Database Migration Error: ERROR [flask_migrate] Error: Can‘t locate revision identified by ‘a1c25fe0fc0e‘
- SyntaxError: Non-ASCII character ‘\xe5‘ in file [How to Solve]
- Typeerror in Python regular expression: expected string or bytes like object