0

import pandas as pd arquivo = pd.ExcelFile('C:\Users\Carol\Documents\MLPy\classificacao.xlxs') ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Does anybody know the problem?

import pandas as pd arquivo = pd.ExcelFile('C:\Users\Carol\Documents\MLPy\classificacao.xlxs')

  • Does this answer your question? ["Unicode Error "unicodeescape" codec can't decode bytes... Cannot open text files in Python 3](https://stackoverflow.com/questions/1347791/unicode-error-unicodeescape-codec-cant-decode-bytes-cannot-open-text-file) – Kabilan Mohanraj Jan 26 '22 at 17:50
  • Essentially, your path should look like this `'C:\\Users\\Carol\\Documents\\MLPy\\classificacao.xlxs')'` – Kabilan Mohanraj Jan 26 '22 at 17:51

1 Answers1

0

import pandas as pd arquivo = pd.read_csv('C:/Users/Carol/Documents/MLPy/bloodp.csv',encoding='unicode_escape',engine='python',on_bad_lines='skip')

those arguments solved my problem :)

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 27 '22 at 00:29