`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

原文地址:https://www.cnblogs.com/augustine0654/p/14819907.html