python-AttributeError: module 'matplotlib' has no attribute 'contourf'
程序员文章站
2022-03-18 21:38:46
...
错误内容
Traceback (most recent call last):
File "C:/Users/雪山飞狐/Desktop/学习总结/ML100天/Code/Day_4.py", line 30, in <module>
plt.contourf(X1, X2, classifer.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape),
AttributeError: module 'matplotlib' has no attribute 'contourf'
解决方案
(1)重装
pip uninstall matplotlib
pip install matplotlib
(2)改变导入方式
import matplotlib as plt
改为
from matplotlib import pyplot as plt
上一篇: LR快速调出电影感的色调照片
推荐阅读
-
module ‘seaborn‘ has no attribute ‘scatterplot‘解决方案
-
AttributeError: module ‘community‘ has no attribute ‘best_partition‘ 问题解决方法
-
module ‘community‘ has no attribute ‘best_partition‘ [已解决]
-
【python】解决AttributeError: module ‘scipy.misc‘ has no attribute ‘toimage‘问题
-
【Tensorflow】Linux下Tensorflow报错:AttributeError: module ‘tensorflow‘ has no attribute ‘xxxx‘
-
AttributeError: 'module' object has no attribute 'main'
-
AttributeError: module 'sklearn' has no attribute 'linear_model'
-
'module' object has no attribute
-
pycharm安装 suds模块报错:AttributeError: module 'pip' has no attribute 'main'
-
python efficientdet AttributeError: module ‘gast‘ has no attribute ‘Num‘