.argmin() .argmax() 计算最大、小值所在位置的索引(针对自动索引的)(适用于Series类型:)

.idxmin() .idxmax() 计算最大、小值所在位置的索引(针对自定义索引的)(适用于Series类型:)

这几个函数都是适用的 不过 最好先把数据类型都打印出来

print(results_table.dtypes)

结果:

C_parameter float64

Mean recall score

object dtype: object 所以要把object类型转换为float64。用astype(flost64)完成 就像这样,然后就不报错了。

TypeError: reduction operation 'argmin' not allowed for this dtype

 

相关文章:

  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-05-13
  • 2021-06-04
  • 2022-01-18
  • 2022-03-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-08
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案