我使用这个代码df = df.to_dta("file_name.dta")来保存stata文件。它给了我这个错误:
AttributeError: 'DataFrame' object has no attribute 'to_dta'有人知道在python中保存Stata .dta文件的正确代码是什么吗?
发布于 2020-06-20 08:07:32
方法名为.to_stata(),而不是.to_dta()。
发布于 2020-06-20 08:09:08
使用熊猫to_stata DataFrame方法。
df.to_stata("file_name.dta")阅读文档:https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_stata.html
https://stackoverflow.com/questions/62483222
复制相似问题