CanopyByPython icon indicating copy to clipboard operation
CanopyByPython copied to clipboard

在随机获取索引下表的时候有时会出现数组越界的情况

Open hzr1140521792 opened this issue 7 years ago • 1 comments

return random.randint(0, len(self.dataset) - 1)在dataset的长度等于1时就会出现random.randin(0,0)的情况,代码会报错,建议将len(self.dataset) != 0:判断条件改为len(self.dataset)>1

hzr1140521792 avatar Dec 04 '17 02:12 hzr1140521792

谢谢提示!

AlanConstantine avatar Mar 24 '18 04:03 AlanConstantine