我试图在一个主键上连接两个数据框。
master_characteristics_data = master_characteristics_data.join(all_cs_meter_runs,on='METER_NUMBER', lsuffix='_fl', rsuffix='_cs')
但是我收到错误消息:
File "C:\Users\cmorris\AppData\Local\conda\conda\envs\Python 3.6 - Server Version\lib\site-packages\pandas\core\reshape\merge.py", line 986, in _maybe_coerce_merge_keys
raise ValueError(msg)
ValueError: You are trying to merge on object and int64 columns. If you wish to proceed you should use pd.concat
但是,当我打印列数据类型时,我没有int64列:
print(master_characteristics_data.dtypes)
print(all_cs_meter_runs.dtypes)
它们都被列为“对象”类型。我不明白为什么熊猫从其中一列中收到int64类型。