天天看点

成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or

解决问题

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

解决思路

值错误:包含一个以上元素的数组的真值是不明确的,要使用a.any()或a.all()

解决方法

   if data_z==data_x:

       print('data_x等价于data_z')

改为

   if data_z.all()==data_x.all():

继续阅读