但python以前不太好用

2024-09-30 12:23:18 发布

您现在位置:Python中文网/ 问答频道 /正文

ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long long'

这些东西得到的代码与之前运行良好的代码完全相同

有一个栏目叫买家。下面的代码用于收集buyer列中具有'st'值的行。现有的df是已经存在的df,我为st_only_existing_df创建了一个变量。在

^{pr2}$

所以从新下载的数据(st_essential_数据框序号)对于st_only_existing_df,我比较了ordernum,如果在新下载的数据中没有数据,那么我将canceled消息放入orderstatus。在

    canceled_df = st_only_existing_df[~st_only_existing_df.ordernum.isin(st_essential_df.ordernum)]
     for index, row in canceled_df.iterrows():

         odrnum = row['ordernum']
         c.execute("update collection set orderstatus='canceled' where ordernum=?", (odrnum,))
         conn.commit()

上面的代码运行得很好。但现在不是了。我不知道它为什么返回“long long”。在

事实上,我需要从许多不同的买家那里下载订单数据。其中之一是“我们”。在处理“we”数据导入代码时,我发现了相同的错误。但它消失了。 在我成功地从'we'数据输入到sqlite3之后,db file得到了'we'数据,突然,st db input就不工作了。 我不认为那会有什么不同,但是。。。。在

有人能给我点线索吗?在


Tags: 数据代码onlydflongrowwest

热门问题