I'm trying to export a dataframe in Python as a Stata dta. This is a slimmed version of the code I'm using:
import pandas as pd
df_master = pd.read_stata(old_dta_location)
# Do some data manipulation.
df_master.to_stata(new_dta_location, {"final_date": "td"}, write_index = False)
I get the following error when I do this:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' in position 11: ordinal not in range(256)
I know there are other questions regarding unicode errors but as they are not related to Stata, options such as putting an argument like 'encoding = "utf8"' doesn't work.
How can I fix this?