cols = corrmat.nlargest(k, ‘SalePrice’)[‘SalePrice’].index
cm = np.corrcoef(df_train[cols].values.T)
sns.set(font_scale=1.25)
hm = sns.heatmap(cm, cbar=True, annot=True, square=True, fmt=’.2f’, annot_kws={‘size’: 10}, yticklabels=cols.values, xticklabels=cols.values)
运行总是出错,显示KeyError: ‘SalePrice’,应该怎么解决呢?
KeyError: 'SalePrice'
最新推荐文章于 2024-06-02 00:30:12 发布