0
I am trying to import data using pandas, but I always get the following error:
File "<ipython-input-15-fb05c39e0291>", line 1
temperaturasDasCidades = pd.read_csv("C:\Users\lopes\Desktop\brutos\temperatura_global\city_temperature.csv", sep=";", encoding='ISO-8859-1')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
The encoding and separator are correct, as well as the path where my csv file for reading the data is also. I have tried to duplicate the counterbars or invert them to bars, as well as tried to put the r
at first to turn into a raw string
.
Is the file really in csv format? Or you just changed the extension?
– Roger Regor
you can put here the first 10 files?
– Lucas
It seems that the error is in the call. Instead of
C:\Users\lopes\...
useC:\\Users\\lopes\\...
"escaping" the counter-bar.– Paulo Marques
Roger, the file is in csv format even
– Marco Aurélio Lopes Júnior
It worked, Paul, thank you
– Marco Aurélio Lopes Júnior