我已经尝试阅读文档,但我仍然感到困惑。pyarrow 表是否能够进行 groupbys 并具有所有美妙的 pandas 功能?
import pyarrow as pa
import pandas as pd
df = pd.DataFrame({"a": [1, 2, 3]})
table = pa.Table.from_pandas(df)
但现在是虎头蛇尾:
table["a"]
# ---------------------------------------------------------------------------
# TypeError Traceback (most recent call last)
# <ipython-input-18-fb884245e2de> in <module>()
# ----> 1 table["a"]
# table.pxi in pyarrow.lib.Table.__getitem__()
# TypeError: an integer is required
table[0]
# <pyarrow.lib.Column object at 0x111306330>
# chunk 0: <pyarrow.lib.Int64Array object at 0x11728d1d8>
# [
# 1,
# 2,
# 3
# ]
c = table[0]
c[c>2]
# ---------------------------------------------------------------------------
# TypeError Traceback (most recent call last)
# <ipython-input-16-cc54312229de> in <module>()
# ----> 1 c[c>2]
#
# TypeError: '>' not supported between instances of 'pyarrow.lib.Column' and 'int'
pyarrow 是一个更适合熊猫内部的库还是什么?