新手在这里。。。我有一个给定的np数组(这里是“result”),想检查它是否存在于一个列表中(这里是“codewords”)
for message in messages:
result = message.dot(G) % size_of_alphabet
if result not in codewords:
codewords.append(result)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
我已经尝试了any()的一些组合,但没有任何效果:/
也许你能更好地解释一下你想从这里得到什么:
相关问题 更多 >
编程相关推荐