Possible Duplicate:
python max of list of arrays蟒蛇最大
我有这样的阵列的列表:
a = [array([ [6,2] , [6,2] ]),array([ [8,3],[8,3] ]),array([ [4,2],[4,2] ])]
我试图max(a)
返回以下错误:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
我想它返回如下列表或列表:
In: max(a)
Out: [[8,3],[8,3]]
我不想将内部数组转换为列表,因为列表的大小非常大。另外我有目的地创建这样的阵列操作。
而你从http://stackoverflow.com/questions/13227578/python-max-of-list-of-arrays接受的答案是不适合的? –
这篇文章帮助我得到了我需要的东西。 – Thiru