最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Why am I getting a TypeError with sns.pairplot in my Diabetes Prediction Project, and should I suppress warnings? - Sta

programmeradmin0浏览0评论

GeeksforGeeks has many project to practice and one of them is this tutorial on a diabetes dataset

In the tutorial, they provide this code that works for them but not for me

sns.pairplot(data, hue='Outcome' , data = data) 
plt.show()

TypeError: pairplot() got multiple values for argument 'data'

ChatGPT suggested this solution, that only displays a warning on my device:

sns.pairplot(data, hue='Outcome')
plt.show()

Should I suppress the warnings?

GeeksforGeeks has many project to practice and one of them is this tutorial on a diabetes dataset

In the tutorial, they provide this code that works for them but not for me

sns.pairplot(data, hue='Outcome' , data = data) 
plt.show()

TypeError: pairplot() got multiple values for argument 'data'

ChatGPT suggested this solution, that only displays a warning on my device:

sns.pairplot(data, hue='Outcome')
plt.show()

Should I suppress the warnings?

Share Improve this question edited Feb 6 at 12:52 Daraan 3,7907 gold badges22 silver badges45 bronze badges asked Feb 6 at 11:54 ZERO_BRAINZERO_BRAIN 134 bronze badges 3
  • 3 Possible duplicates: A, B If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. – Daraan Commented Feb 6 at 12:49
  • 3 If you got a warning please state which one you are getting. – Daraan Commented Feb 6 at 12:50
  • This question is similar to: How to fix: TypeError: relplot() got multiple values for argument 'x' when plottling a line plot with seaborn. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. – dimakin Commented Feb 6 at 20:33
Add a comment  | 

1 Answer 1

Reset to default 1

Do not add data=data in the arguments if data passed as the first argument is a DataFrame (df).

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论