python - 模块'pandas'没有属性'corr'
问题描述
correlation_matrix = pd.corr()
# cannot = True to print the values inside the square
sns.heatmap(data=correlation_matrix, annot=True)
尽管使用了头文件,但它仍显示错误
解决方案
我不认为熊猫有 corr(),它应该是更像 df.corr() 的数据帧也许这会有所帮助https://datatofish.com/correlation-matrix-pandas/
推荐阅读
- objective-c - OpenGLES 已弃用,在为 Mac Catalyst 构建时不可用
- swift - 如何通知消费者服务状态已更改
- php - 表单验证抛出参数 1 传递给 App\Http\Controllers\Controller::validate() 必须是 Illuminate\Http\Request 的实例,给定整数
- c# - 如何根据 ID 组合查询 linq
- bash - 从带有空格的路径中获取文件夹的名称
- winrm - PyWinRM Plugib - 执行内联 powershell 脚本返回不需要的 #< CLIXML 输出流
- php - php帖子是空白的。/ 注意:未定义的索引:
- python - 使用 python 读取文本文件、处理内容并以电子邮件的形式发回
- python - Pandas 数据框使用列名映射行值
- python - 在 Python pandas 中搜索包含任意四个连续数字的字符序列