合并“ numpy.int64”和“ pandas.core.series.Series”

时间:2020-01-15 01:29:34

标签: python pandas

我正在尝试在一个关键列上合并2个数据帧。 但是,

>>>type(df1.key[0])
numpy.int64

>>>type(df2.key[0])
pandas.core.series.Series

这将导致错误消息

"You are trying to merge on int64 and object columns"

我试图在merge()之前运行它

    pd1.key.astype(int)
    pd2.key.astype(int)

但是它不起作用,并且错误消息仍然存在...

0 个答案:

没有答案
相关问题