SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UX
程序员文章站
2022-06-15 13:41:13
...
当输入的路径如此是
f_train=open('C:\Users\Administrator\PycharmProjects\天池\ccf_offline_stage1_train.csv')
若出现错误:SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape
是因为程序认为”\u“是转义字符,因此出错,改为“\\u”
上一篇: 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
推荐阅读
-
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
-
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
-
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
-
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
-
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