我试图在 python 中使用熊猫 concat() 两个镶木地板文件。
它可以工作,但是当我尝试将数据框写入并保存到镶木地板文件时,它显示错误:
ArrowInvalid: Casting from timestamp[ns] to timestamp[ms] would lose data:
Run Code Online (Sandbox Code Playgroud)
我检查了文档。的熊猫,它在写入镶木地板文件时默认以毫秒为单位的时间戳语法。
连接后如何使用使用过的模式将镶木地板文件变白?
这是我的代码:
import pandas as pd
table1 = pd.read_parquet(path= ('path.parquet'),engine='pyarrow')
table2 = pd.read_parquet(path= ('path.parquet'),engine='pyarrow')
table = pd.concat([table1, table2], ignore_index=True)
table.to_parquet('./file.gzip', compression='gzip')
Run Code Online (Sandbox Code Playgroud)