首页 > 解决方案 > 模块'pandas'没有属性'corr'

问题描述

correlation_matrix = pd.corr()
# cannot = True to print the values inside the square
sns.heatmap(data=correlation_matrix, annot=True)

尽管使用了头文件,但它仍显示错误

标签: pythonpandasgoogle-colaboratory

解决方案


我不认为熊猫有 corr(),它应该是更像 df.corr() 的数据帧也许这会有所帮助https://datatofish.com/correlation-matrix-pandas/


推荐阅读