数字
2018-12-24 本文已影响0人
minlover
遇到一个程序在定义计数器时,counter = 0.
就试了下加不加点的区别

但是这个程序这么用会报错:
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
这是因为索引不能用浮点数。
遇到一个程序在定义计数器时,counter = 0.
就试了下加不加点的区别
但是这个程序这么用会报错:
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
这是因为索引不能用浮点数。