我获取一个google表单作为pandas数据帧,然后在df中添加一列,然后将其上传回来。我面临这个错误:
Object of type 'int64' is not JSON serializable
代码如下:
#reading and writing on google sheets
gc = pygsheets.authorize(service_file="/Projects/big_query_funnel_v1/input/AppFunnelgs-e1968da.json")
sheet=gc.open('Daily Drop Offs Summary')
wks = sheet.worksheet_by_title('New_Funnel')
#converting to pandas df
ds = wks.get_as_df()
#making a new column
ds.insert(loc=1, column=str(dates), value=edf.vals)
print(ds.head())
wks.set_dataframe(ds, 'A1')
我得到的错误在最后一行代码,即当上传回测向。你知道吗
以下工作(不修改逻辑):
软件包版本:
Json不理解numpy整数,所以在上传回googlesheets之前,需要将数据帧转换为string或int。你知道吗
相关问题 更多 >
编程相关推荐