import pandas as pd
import matplotlib as plt
import numpy as np
x = np.linspace(0,10,10)
y = np.sin(x)
plt.plot(x,y)
(最近通话最近):
File "<ipython-input-18-d8b592bf313e>", line 1, in <module>
plt.plot(x,y)
AttributeError: module 'matplotlib' has no attribute 'plot'
答案 0 :(得分:0)
您需要导入matplotlib.pyplot
而不是matplotlib
import matplotlib.pyplot as plt
答案 1 :(得分:0)
您需要从matplotlib包中导入pyplot模块:
import matplotlib.pyplot as plt