-
-
Couldn't load subscription status.
- Fork 19.2k
Closed
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasIO Stataread_stata, to_stataread_stata, to_stataUnicodeUnicode stringsUnicode strings
Milestone
Description
It seems pandas in python3.5 causes issues due to encoding. For example the following generates a corrupt output file
import pandas as pd
df1 = pd.DataFrame(np.array([1,2,3,4]), columns=['var1'])
df1.to_stata('corrupt.dta', write_index=False, encoding='utf8')while
df1.to_stata('not-corrupt.dta', write_index=False)generates a correct file. I imagine this may be due to use of encoding and the difference in the treatment between python 2 and python 3, which breaks compatibility of scripts across python versions. I guess it would be nice if it does not take this option into account on python 3, unless the error is caused by something else.
Metadata
Metadata
Assignees
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasIO Stataread_stata, to_stataread_stata, to_stataUnicodeUnicode stringsUnicode strings