Python Forum
(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \
#1
HI there,
I have follow problem:
import pandas as pd

subway_df = pd.read_csv('C:\Users\DSule\Desktop\python\nyc.csv')
 File "<ipython-input-25-80cb9d4c408e>", line 3
    subway_df = pd.read_csv('C:\Users\DSule\Desktop\python\nyc.csv')
                           ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I tried to solve this problem with three different solutions:
- \\
- r
- "nyc.csv"

But nothing works for me... Confused
I know, there are already similiar questions in this forum. But if you take a closer look to this questions, they are not answered Dodgy
Feel frustraited Cry

I use Python 3
And I installed Jupyter with anaconda
Reply


Messages In This Thread
(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \ - by Jack_Sparrow - May-11-2018, 09:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fatal Python error: initfsencoding: unable to load the file system codec gauravbhardwajee 12 28,216 Apr-30-2020, 07:45 PM
Last Post: barrpath

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020