🛠️ Scheduled Maintenance | We’ll be undergoing scheduled maintenance and upgrades between 00:00 PST Jan 26th until 00:00 PST Jan 28th. There may be brief interruption of services in that period. We apologize for the inconvenience.

×
The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

why is my jupyter notebook not executing the csv file as show in the video

why is my jupyter notebook not executing the csv file as show in the video

0
Votes
1
Answer
 data=pd.read_csv('C:\Users\admin\Desktop\1.01.Simple_linear_regression.csv')
File
"<ipython-input-29-05428c3bab10>", line 1 data=pd.read_csv('C:\Users\admin\Desktop\1.01.Simple_linear_regression.csv') ^ data
SyntaxError
: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
1 Answer

365 Team
0
Votes

Hi Falki,
This error occurs because you are using a normal string as a path. You can use one of the three following solutions to fix your problem:
1: Just put r before your normal string it converts normal string to raw string:

pandas.read_csv(r'C:\Users\admin\Desktop\1.01.Simple_linear_regression.csv')

2: Alternatively, you need to inverse the slashes and write:

pandas.read_csv(C:/Users/admin/Desktop/1.01.Simple_linear_regression.csv')

Best,
Iliya