小编xxg*_*yxx的帖子

Pandas df.to_stata():“DataFrame”对象没有属性“dtype”

到目前为止,pandas 函数df.to_stata()对我的数据集运行得很好。

我正在尝试使用以下代码将包含 29,778 行和 37 行的数据框导出到 Stata 文件:

df.to_stata("Stata_File.dta", write_index=False, version=118)
Run Code Online (Sandbox Code Playgroud)

但是,我收到以下错误消息:

AttributeError: 'DataFrame' object has no attribute 'dtype'
Run Code Online (Sandbox Code Playgroud)

我真的很感激任何帮助如何解决这个问题。

python dataframe stata pandas

6
推荐指数
1
解决办法
1366
查看次数

标签 统计

dataframe ×1

pandas ×1

python ×1

stata ×1