python踩坑第er天
Q: TypeError: ‘float’ object is not subscriptable;
A: 原本还以为是下标类型不对,搞了好久,后边发现,是 维度不对,对一维数组调用二维index,,出现好几次了,下次注意!
Q:ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
A:这个也是 还以为是啥,其实也是,判断使用的变量是多维的,但就写成了维度小的,就出错,即使用维度和初始化不匹配。