我将尝试使用以下代码将pandas对象保存为parquet格式:
LABL = datetime.now().strftime("%Y%m%d_%H%M%S")
df.to_parquet("/data/TargetData_Raw_{}.parquet".format(LABL))
这让我产生了错误:
ArrowTypeError: ("Expected bytes, got a 'float' object", 'Conversion failed for column Pre-Rumour_Date with type object')
pandas的数据类型如下:
0
Announced_Date object
Completed_Date object
Pre-Rumour_Date object
object
Lapsed_Date object
Target_Company object
Bidder_Company object
Seller_Company object
Deal_Value_USD(_m) object
Exit_Type object
Buy_Type object
Sell_Stake_(%) object
Buy_Stake_(%) object
Months_Held object
Private_Equity_House object
ADATE datetime64[ns]
dtype: object
TypeError:Object of type 'int64' is not JSON serializable
。 - delalmaSeries.astype()
将您的“object”列转换为显式类型。 - gshpychka