I would like to put the max number(s) to a new array, I\'ve tried every thing that I can think of and none seem to work....(adding to an empty result array, concat, etc)
Just apply max
to every sublist:
Python 2: map(max, lists)
Python 3: list(map(max, lists))
Of course the latter only works if you don't shadow the built-in list
function with your variable (which is a bad idea anyway, so I used the name lists
instead).
>>> lists = [[21, 34, 345, 2], [555, 22, 6, 7], [94, 777, 65, 1], [23, 54, 12, 666]]
>>> map(max, lists)
[345, 555, 777, 666]