list indices must be integers or slices, not tuple 解决方案

解决方案:

用numpy里的array转化下,转成元组 :  dataSet=np.array(dataSet)

或者也可以将dataSet转化为矩阵:mat(dataSet),两者都可行

猜你喜欢

转载自blog.csdn.net/WJWFighting/article/details/81488554