首页 > 其他分享> > 成功解决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
作者:互联网
成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
目录
解决问题
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():
print('data_x等价于data_z')
标签:ambiguous,Use,ValueError,array,data,any,more 来源: https://blog.51cto.com/u_14217737/2912430