Good afternoon, Can you please tell me why the error 'ascii' codec can't encode characters in position 23-25: ordinal not in range (128) appears?

input_1 = ('C://Users/54292/Desktop/My folder/1_Выгрузка GMO.csv') df = pd.read_csv(input_1, sep=';') 

I have already opened this file with this name and there were no problems. Now changed the IDE and the problem appeared. I work on Windows7, Python3, pandas 0.19.1.

To check, I changed the entire Cyrillic alphabet to Latin on the way and added an explicit encoding. It turned out like this:

 input_1 = 'C:/Users/54292/Desktop/My folder/1_GMO.csv' df = pd.read_csv(input_1, sep=';', encoding='utf-8') 

After that, an error occurred:

FileNotFoundError: File b'C: / Users / 54292 / Desktop / My folder / 1_GMO.csv 'does not exist

  • you have all the strings like - default byte-strings ... - MaxU
  • @MaxU, but how can you deal with this? - Denis Novik
  • And what is your IDE? Can see the settings? - MaxU
  • @MaxU, Anaconda on Microsoft Azure ML on which the error pops up. Before that there was Anaconda, downloaded and installed from the official site, everything worked fine on it until I killed it with an update yesterday. Now it does not start at all, I wrote about this in this topic ru.stackoverflow.com/questions/625085/… . - Denis Novik
  • one
    @MaxU, reinstalled Anaconda and installed several modules that were indicated in the recipes. It all worked! Thank! - Denis Novik

1 answer 1

Try to explicitly specify the encoding:

 df = pd.read_csv(input_1, sep=';', encoding='utf-8')