-3

So I am trying to use this Python code for a spectrograph. I haven't done much Python and have no clue how to fix this issue. As you can see in the image it says that it cant find the file, from what i understand, where its searching for it.Screenshot of the code

I first tried fixing the problem by finding out how to move the file to where its looking for it using Shutil but i ran into the problem "SyntaxError: Unicode error" which i did not expect, probably because of my limited knowledge of python.Screenshot of error

  • 3
    Welcome to StackOverflow. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [Why you should not upload images of code/data/errors when asking a question](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-errors-when-asking-a-question/285557#2), but include the code directly into your question. – Manfred Dec 31 '22 at 18:30
  • The second error is due to a problem with the encoding. You should try to find out which is the encoding of the original file and set the optional parameter `encoding` from `read_csv` to that. – Ignatius Reilly Dec 31 '22 at 18:35
  • Does this answer your question? [UnicodeDecodeError when reading CSV file in Pandas with Python](https://stackoverflow.com/questions/18171739/unicodedecodeerror-when-reading-csv-file-in-pandas-with-python) – Ignatius Reilly Dec 31 '22 at 18:38

1 Answers1

0

Try this

You have to convert the simple string to raw string.

shutil.move("Spectrograph_data.csv", r"C:Users\...")

Or replace '\' with "\\".

codester_09
  • 5,622
  • 2
  • 5
  • 27