【发布时间】:2014-03-24 14:20:42
【问题描述】:
我正在将 scikit 库中的内置 boston 数据集加载为:
from sklearn.datasets import load_boston
bdata = load_boston()
我想提取第一列中的所有值,这称为 CRIM。我写了这样一行:
plt.scatter(bdata.CRIM,bdata.target,color='blue')
但我收到一个错误,因为“AttributeError: 'Bunch' object has no attribute 'CRIM'”
如何访问标题为“CRIM”的列的元素?
【问题讨论】:
标签: python-3.x numpy scikit-learn scikits