Python-numpy逻辑报错:The truth value of an array with more than one element is ambiguous. Us
报错代码:importnumpyasnumpy
a=np.zeros(3)
a[0]=0;a[1]=1;a[2]=2
ifa==[1,2,3]:
print"OK"
else:
print"NOTOK"
Traceback(mostrecentcalllast):
File"",line1,in
ifa==[1,2,3]:
ValueError:Thetruthvalueofanarraywit