TypeError:+不支持的操作数类型:“ int”和“ vectorize”

时间:2019-02-12 05:21:35

标签: python numpy matplotlib

我有这样的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数组值打印条形图,但错误显示为这样

0 个答案:

没有答案