AttributeError:模块"seaborn"没有属性"histplot" [英] AttributeError: module 'seaborn' has no attribute 'histplot'

查看:2155
本文介绍了AttributeError:模块"seaborn"没有属性"histplot"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 sns.histplot 进行绘图在Kaggle的Jupyter笔记本中的Titanic数据集上.

I'm trying to plot using sns.histplot on the Titanic Dataset in Kaggle's Jupyter Notebook.

这是我的代码:

sns.histplot(train, x = "Age", hue="Sex")

但是它抛出了我这个错误:

But it's throwing me this error:

 ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-11-d14c3b5a0670> in <module>
----> 1 sns.histplot(train, x = "Age", hue="Sex")

AttributeError: module 'seaborn' has no attribute 'histplot'

我已经确保要导入seaborn(使用sns.barplot的先前地块效果很好).

I have made sure to import seaborn (previous plots using sns.barplot worked fine).

我在Mac OS X 10.15.6和Seaborn版本0.11.0上运行.

I'm running on Mac OS X 10.15.6, and Seaborn version 0.11.0.

有人可以指出出了什么问题吗? 预先感谢.

Could somebody point out what went wrong? Thanks in advance.

推荐答案

我使用以下命令更新了seaborn模块:

I updated the seaborn module using:

pip install -U seaborn

它为我解决了这个问题.

and it resolved the issue for me.

这篇关于AttributeError:模块"seaborn"没有属性"histplot"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆