两个series 类型的数据 truth 和 pred 比较时 truth == pred 出现
ValueError: Can only compare identically-labeled Series objects 的问题

原因 truth 是从csv文件中提取出来的,index即行号,不连续,而pred是连续的,所以比较时会出现问题
truth 数据如下所示
ValueError: Can only compare identically-labeled Series objects 问题解决

pred如下所示
ValueError: Can only compare identically-labeled Series objects 问题解决
可见二者索引不同

解决方法
使用 .reset_index(drop=True)
outcomes = outcomes.reset_index(drop=True)
问题解决

相关文章:

  • 2021-05-09
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2021-10-18
  • 2021-10-19
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
相关资源
相似解决方案