dataFrame问题

现有数据结构为,调用 describe 输出如下
               eps  min_samples   n_clusters    outliners        scorecount  1161.000000  1161.000000  1161.000000  1161.000000  1161.000000
mean      0.065000     6.000000     7.664944    54.778639     0.448294
std       0.037254     2.583102    26.953035   185.646206     0.317491
min       0.001000     2.000000     1.000000     2.000000    -0.503024
25%       0.033000     4.000000     1.000000     2.000000     0.359631
50%       0.065000     6.000000     1.000000     6.000000     0.569632
75%       0.097000     8.000000     4.000000    23.000000     0.702620
max       0.129000    10.000000   488.000000  2084.000000     0.702620
的数据,我使用 result.loc[result['score'] == 0.702620]获取 score 最大值所在的行,返回的却是一个空的 dataFrame
Empty DataFrameColumns: [eps, min_samples, n_clusters, outliners, score]
Index: []
回答:
你看到的数字应该只是数字的前几位,所以判断不等。不建议你这么写,可以用 result.loc[result['score'].idxmax()] 代替。
以上是 dataFrame问题 的全部内容, 来源链接: utcz.com/p/938354.html

