原因分析: 使用df.index.duplicated() 查看是否又重复的索引,若有返回”True“,则表明有重复索引 解决方案: 删掉原来的索引直接重建新的dataframe.reset_index(drop=True)使用 dataframe.reindex()重新定义所需要的索引值