- del(trainingSet[randIndex])
python3.x , 出现错误 'range' object doesn't support item deletion
原因:python3.x range返回的是range对象,不返回数组对象
解决方法:
把 trainingSet = range(50) 改为 trainingSet = list(range(50))
python3.x , 出现错误 'range' object doesn't support item deletion
原因:python3.x range返回的是range对象,不返回数组对象
解决方法:
把 trainingSet = range(50) 改为 trainingSet = list(range(50))