我正在获取一个谷歌表作为熊猫数据框,然后在 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')
我在最后一行代码中遇到错误,即在上传回 df 时。