import matplotlib
fig = matplotlib.pyplot.figure()
我使用这种导包的方法是不能用的,会报**AttributeError: 'module' object has no attribute 'pyplot'**错误。
import matplotlib.pyplot as plt
fig = plt.figure()
这种是正常的导包。
pyplot是matplotlib的子模块,所以Python是不可以只导入母包么?
但是为什么numpy只需要import numpy就可以用了呢?