我正在尝试使用sns.histplotKaggle 的 Jupyter Notebook 中的 Titanic 数据集进行绘图。
这是我的代码:
sns.histplot(train, x = "Age", hue="Sex")
Run Code Online (Sandbox Code Playgroud)
但它给我这个错误:
---------------------------------------------------------------------------
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'
Run Code Online (Sandbox Code Playgroud)
我已确保导入 seaborn(以前使用的图sns.barplot工作正常)。
我在 Mac OS X 10.15.6 和 Seaborn 0.11.0 版上运行。
有人可以指出出了什么问题吗?提前致谢。