Encoding error reading stata file,read_stata() does not accept encoding argument python

Viewed 526

first I tried simply reading the file

import pandas as pd
my_data = pd.read_stata('filename.dta')

and it returned the following error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 68: invalid continuation byte

I tried adding a encoding argument such as 'latin', 'iso8859-1' but it then returns the following error

TypeError: read_stata() got an unexpected keyword argument 'encoding'

checking the documentation for pandas 1.0.1 says that read_stata() does not have support for an encoding argument

0 Answers
Related