本文介绍了TypeError:使用seaborn pairplot时,"DataFrame"对象不是可调用错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是python和机器学习的新手,尝试学习该主题,我正在学习在线课程,我已经在jupyter笔记本中导入了数据集,并尝试在其上执行以下python脚本

i'm new to python and machine learning and try to learn the subject , i'm following an online course ,i have imported a dataset in jupyter notebook and try to execute following python script on it

#creating a scatter plot matrix
%matplotlib inline

import seaborn as sns
num_cols = ["Age","Height","Weight","Duration","Heart_Rate","Body_Temp","Calories"]
sns.pairplot(frame(num_cols),size=2)

我的数据集如下

但是当我运行代码时我得到了

but when i run the code i get

TypeError:"DataFrame"对象不可调用

TypeError: 'DataFrame' object is not callable

作为初学者,如果有人可以为此提供帮助,我将找不到解决方案 非常感谢.

As a begginer i can't find a solution for this if anyone can help on this very much appreciated.

谢谢.

推荐答案

我发现了问题,并认为这对初学者来说很有帮助,因为我错过了

i have found the issue , and thought this will help for a beginner i have missed square brackets in

sns.pairplot(frame(num_cols),size=2)

应该是

sns.pairplot(frame[num_cols],size=2)

这篇关于TypeError:使用seaborn pairplot时,"DataFrame"对象不是可调用错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 05:18