Loading

`matplotlib.mlab` has no attribute ` normpdf`

问题:

在使用matplotlib.mlab.normpdf时出现错误:

matplotlib.mlab has no attribute normpdf

原因:

mlab中normpdf属性已经移除了,报错信息:

module 'matplotlib.mlab' has no attribute 'normpdf'

解决办法:

from scipy.stats import norm

使用norm.pdf代替mormpdf

posted @ 2021-05-27 21:40  紫曜花  阅读(411)  评论(0编辑  收藏  举报