不能在Python的缓冲区中包含dtype“M”

2024-10-06 12:39:51 发布

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

下面的一行显示了错误:“cannotincludedtype'm'in a buffer”(无法在缓冲区中包含数据类型“m”)。在

for i in range(len(rebalance_dates)):
    new_table.ix[rebalance_dates[i]:rebalance_dates[i+1]]= np.round((final_data.ix[rebalance_dates[i]),0)

有两个表,“new_table”和“final_data”,使用它们的索引作为日期时间,如“2016-01-01”。我猜这个错误发生在循环datetime索引时。在

删除for循环语句并将其更改为时,不会出现错误

^{pr2}$

想知道如何修复这个问题,以运行带有datetime索引的循环语句。谢谢。在


Tags: innewfordatadatetimebuffer错误table