刚用python,想用matplotlib画一个ln(x)的图,出现下面的错误,请问怎么解决?
import numpy
import matplotlib.pyplot as plt
import math
x = np.linspace(0,1,50)
y=math.log(x,math.e)
plt.plot(x,y)
plot.show
Traceback (most recent call last):
File "D:/python数据/图1.py", line 5, in <module>
y=math.log(x,math.e)
TypeError: only size-1 arrays can be converted to Python scalars