0

Good afternoon.

I'm having some problems on opening my database (csv file) and read this on my algorithm test.

Someone could help me on this? Here is my algorithm:

algorithm

Thanks for any help...

DesiChris
  • 1
  • 3

2 Answers2

2

That should work:

pandas.read_csv ("C:\\Users\\DESICHRIS\\Desktop\\ATUAL TESE DESIREE\\em andamento\\entrada pyhton\\entrada.csv", encoding = "ISO-8859-1")

by adding encoding = "ISO-8859-1" will solve your problem

Tony
  • 557
  • 1
  • 4
  • 17
0

I think this error occurs because you are using a normal string as a path. Furthermore there are already other post which cover this topic. For example: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Try this: With / and not \

import pandas as pd

path = 'C:/Users/Marti/Desktop/Admission_Predict.csv'

df = pd.read_csv(path,encoding= 'utf-8')

print(df)
Cyvher
  • 41
  • 1
  • 8
  • >>> read_csv ("C:\Users\DESICHRIS\Desktop\ATUAL TESE DESIREE\em andamento\entrada pyhton\entrada.csv") File "", line 1 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape – DesiChris Jan 24 '19 at 19:24