PyArrow不在羽毛或拼花地板上书写

2024-04-29 15:01:10 发布

您现在位置:Python中文网/ 问答频道 /正文

因此,查看write_feather的文档,我应该能够编写如下箭头表

import pyarrow as pa
import pyarrow.feather as fe


fe.write_feather(
  pa.Table.from_arrays([ pa.array([1,2,3]) ], names=['value']), 'file.feather'
)

但我得到了以下错误:

  File "pyarrow/feather.py", line 89, in write
    if not df.columns.is_unique:
AttributeError: 'list' object has no attribute 'is_unique'

拼花地板文件的编写似乎和预期的一样,所以我认为可能存在缺陷。有什么想法吗


Tags: from文档importisastable箭头array
1条回答
网友
1楼 · 发布于 2024-04-29 15:01:10

这里的问题是pyarrow.feather.write_feather在您使用的pyarrow版本中需要的是pandas.DataFrame,而不是pyarrow.Table。如果您直接想要编写pyarrow.Table,您需要升级到更新的版本,因为这个支持是最近才添加的

相关问题 更多 >