def argmax_list(matrix):
    m = matrix[0].copy()
idx = np.zeros(len(m), dtype=np.int)
for i, a in enumerate(matrix[1:], 1):
    mask = m < a
m[mask] = a[mask]
idx[mask] = i
return idx
Numpy max slow when applied to list of arrays