且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TypeError:只有长度为1的数组可以转换为Python标量点积

更新时间:2021-08-08 18:24:15

x是一个numpy数组,Python的内置float函数无法处理.试试:

x is a numpy array, which Python's builtin float function can't handle. Try:

hypothesis = np.dot(x.astype(float), theta)