我试图重新索引一个数据帧,它在我的旧笔记本电脑上工作,但现在我有一些麻烦重新索引的df在我的另一台笔记本电脑。 我收到以下错误消息:
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
此行有错误:
new_df=df.reindex(df.index.repeat(df.U_REVIEW.str.len()))
我试着在代码行的末尾加上:
.astype('int32' )
.astype(numpy.int32)
但我还是有同样的错误。 其他人知道如何解决这个问题吗
目前没有回答
相关问题 更多 >
编程相关推荐