【发布时间】:2019-07-15 09:51:04
【问题描述】:
我正在尝试解决来自 Kaggle 的“房价”挑战,但我被困在我的相关矩阵上,因为它根本没有显示我想要的所有列。最初,显然是因为列数较多,所以我这样做了:
df = df_data[['SalePrice', 'MSSubClass', 'MSZoning', 'LotFrontage', 'LotArea', 'Street', 'Alley', 'LotShape', 'LandContour', 'Utilities']].copy()
corrmax = df.corr()
f, ax = plt.subplots(figsize=(16,12))
sns.heatmap(corrmax, annot = True)
然后,由于某种原因,结果是只有 SalePrice、MSSubClass、LotFrontage 和 LotArea 的热图。谁能帮帮我?
【问题讨论】:
-
也许您的某些列不是数字的?试试
print(df.dtypes)看看。 -
哎哟!他们不是!既然你这么说,那就太傻了!哈哈!谢谢!
标签: python pandas seaborn heatmap