Issue
trying to import a csv file from my desktop
df = pd.read_csv('C:\Users\u1703025\Desktop\Debts.csv',sep =',')
Getting this error
runfile('C:/Users/u1703025/.spyder-py3/temp.py', wdir='C:/Users/u1703025/.spyder-py3')
File "C:\Users\u1703025\.spyder-py3\temp.py", line 2
df = pd.read_csv('C:\Users\u1703025\Desktop\Debts.csv',sep =',')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Solution
Just put r
before path
pd.read_csv(r'C:\Users\u1703025\Desktop\Debts.csv',sep =',')
Answered By - Bhargav - Retarded Skills
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.