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 \
#3
Thank you!
I tried all of them. Here are results:

#Input1: 
import pandas as pd
subway_df = pd.read_csv(r'C:\Users\DSule\Desktop\python\nyc.csv')
#Output1
NO output/No reaction
#Input2
import pandas as pd
subway_df = pd.read_csv('C:/User/DSule/Desktop/python/nyc.csv')
#Output2
File b'C:/User/DSule/Desktop/python/nyc.csv' does not exist
#Input 3
import pandas as pd
subway_df = pd.read_csv('C:\\Users\\DSule\\Desktop\\python\\nyc.csv')
#Output 3
NO output/No reaction
Any other ideas?
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fatal Python error: initfsencoding: unable to load the file system codec gauravbhardwajee 12 28,372 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