saving . . . saved SYNTAX ERROR WHILE CHANGING THE PATH OF THE SAVING PLOT has been deleted. SYNTAX ERROR WHILE CHANGING THE PATH OF THE SAVING PLOT has been hidden .
SYNTAX ERROR WHILE CHANGING THE PATH OF THE SAVING PLOT
Title
Question
IT IS SHOWING ERROR AS BELOW SHOWN, HOW CAN I SOLVE IT.

In [12]: savefig("C:\User\PRADIP\Desktop\sine.png")
  File "<ipython-input-12-8e4fe73ad2d9>", line 1
    savefig("C:\User\PRADIP\Desktop\sine.png")
                                             ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Python-3.4.3 Saving-plots 02-03 min 20-30 sec 26-05-21, 3:23 p.m. pradip25779@gmail.com

Answers:

SYNTAX ERROR WHILE CHANGING THE PATH OF THE SAVING PLOT
IT IS SHOWING ERROR AS BELOW SHOWN, HOW CAN I SOLVE IT.

In [12]: savefig("C:\User\PRADIP\Desktop\sine.png")
  File "<ipython-input-12-8e4fe73ad2d9>", line 1
    savefig("C:\User\PRADIP\Desktop\sine.png")
                                             ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
27-05-21, 7:10 a.m. naveenkrg05@gmail.com
Add “\\” in the path instead of “\” This should resolve the issue.
25-10-21, 7:23 p.m. aditya94palaparthy@gmail.com

Login to add comment


Remove all the "\" with "\\" in the path

09-11-24, 12:20 p.m. nagar.abhi.nagar@gmail.com


Log-in to answer to this question.