我有这样的Python代码:
import Regression as t
import matplotlib.pyplot as plt
NN = t.Neural_Network()
yHat = NN.forward(t.X)
y2 = np.vectorize(t.y)
y3 = np.vectorize(yHat)
plt.bar([0,1,2],y2, width = 0.35, alpha=0.8)
plt.bar([0.35,1.35,2.35],y3, width = 0.35, color='r', alpha=0.8)
plt.grid(1)
plt.legend(['y', 'yHat'])
我会为两个numpy数组值打印条形图,但错误显示为这样