python - 迭代存储由 SelectKBest 算法选择的特征的数组时出现 Keyerror 1 问题
问题描述
我收到了这个错误
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine._get_loc_duplicates()
KeyError: 1
while循环抛出一个数组
kbest_feature_corre
i = 0
while i < len(kbest_feature_corre):
print(kbest_feature_corre[i])
i += 1
数组看起来像这样
Specs Score
16 Predictor 17 inf
40 Predictor 41 inf
41 Predictor 42 inf
102 Predictor 103 inf
103 Predictor 104 inf
105 Predictor 106 inf
107 Predictor 108 inf
120 Predictor 121 inf
121 Predictor 122 inf
122 Predictor 123 inf
123 Predictor 124 inf
124 Predictor 125 inf
125 Predictor 126 inf
126 Predictor 127 inf
127 Predictor 128 inf
128 Predictor 129 inf
129 Predictor 130 inf
130 Predictor 131 inf
131 Predictor 132 inf
144 Predictor 145 inf
145 Predictor 146 inf
146 Predictor 147 inf
147 Predictor 148 inf
148 Predictor 149 inf
149 Predictor 150 inf
150 Predictor 151 inf
151 Predictor 152 inf
152 Predictor 153 inf
153 Predictor 154 inf
154 Predictor 155 inf
410 Predictor 411 113.389284
371 Predictor 372 107.523782
316 Predictor 317 105.745269
.. ... ...
我想打印数组的所有结果,我找不到这里出了什么问题:/数组存储了应用 SelectKBest 算法进行特征选择的结果。
解决方案
推荐阅读
- swift - Xcode CUI 目录错误
- c# - 在动态crm中将销售订单详细信息添加到销售订单
- python - sklearn:垃圾箱必须单调递增或递减
- javascript - 如何在节点应用程序中指定环境变量?
- javascript - 带有 fs 和 setInterval 的节点 js
- css - 将 prop 传递给样式化组件中的嵌套元素
- vue.js - 如何从 vue 应用程序生成包含所有节点模块的包?
- javascript - 删除然后添加子节点
- doctrine-orm - 如何使用 Doctrine DBAL、TYPO3 和 TypoScript 进行随机排序
- c++ - CPP Prime Generator SPOJ 筛