【发布时间】:2020-09-28 16:31:11
【问题描述】:
我无法打开任何 Parquet 桌子,除非它们是空的,写作似乎有效。没有追溯,没有返回。 Pyarrow 1.0.1,Python 3.8.5 (Win10) 上的 Pandas 1.1.2。在错误报告之前我遗漏了什么明显的东西吗? pyarrow-feather 可以正常工作。
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
df = pd.DataFrame([11, 22, 33], columns=['col'])
pout = pa.Table.from_pandas(df)
pq.write_table(pout, 'example.parquet')
# Alternative
#pout = df.to_parquet('example.parquet')
tab = pq.read_table('example.parquet')
df = tab.to_pandas()
# Alternative
#df = pd.read_parquet('example.parquet')
print(df)
【问题讨论】:
-
@mikksu 是的,两者都试过了,这就是为什么它们仍在示例中(已注释掉)。