1
votes

I recently download the PISA 2012 Student database from PISA. I follow the instructions and successfully read it on SAS. Then I exported as CSV to read it in Python 3, using proc export, but I keep getting this error when trying to read it in python pandas: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 24: invalid start byte. What can I do?

pisa2012_Col=pd.read_csv('Pisasubset2012Col.csv')

2

2 Answers

0
votes

Try using

pisa2012_Col=pd.read_csv('Pisasubset2012Col.csv', encoding = "ISO-8859-1")

Since read_csv has an encoding option to deal with files in different formats (See python docs)

0
votes

Thank you both. It seems to work. I read it successfully and until know, variables are responding fine to my calculations. Seems SOLVED.