Debug 路漫漫-12:Python: ValueError: 'userid' is both an index level and a column label, which is ambigu

啊,又遇到难题了 ==spa

 想要对两个 dataframe 作天然链接 merge,链接的key 为 “userid”,可是报错:ValueError: 'userid' is both an index level and a column label, which is ambiguous.blog

 

 

【解决过程】pandas

一、不知道是否是由于pandas版本问题,至少一样的代码在去年是能够跑得通的,今年却出现了这样的问题。方法

因而尝试使用Pycharm选择暗转pandas 0.9版本的,(当前Pycharm里面是0.25版本的),可是安装失败……im

尝试用控制台,亦失败……img

二、既然使用 merge 天然链接不了,那就使用暴力方法咯:co

搞出一列出来,而后拼接到df2上去。data

相关文章
相关标签/搜索