我想要做一个直方图图,在导入名为graphing的库之后,即使它已经安装,它也会给我一个错误。
import graphing
graphing.histogram(dataset, label_x='Pclass', label_y='Survived', histfunc='avg', include_boxplot=True)这是错误信息。
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_15336\3609384830.py in <module>
1 import graphing
2
----> 3 graphing.histogram(dataset, label_x='Pclass', label_y='Survived', histfunc='avg', include_boxplot=True)
AttributeError: module 'graphing' has no attribute 'histogram'你对如何处理这件事有什么建议吗?谢谢
发布于 2022-11-27 06:00:36
错误消息告诉您Python已经成功导入了graphing包,但是包没有名为histogram的属性/函数。
一些可能的解释是:
hist而不是histogram)。graphing.<submodule>.histogram.graphing包。您可以使用诸如graphing.__path__ (它告诉您包是从哪里加载的)之类的变量来帮助解决这个问题。https://datascience.stackexchange.com/questions/116444
复制相似问题