I want to write this code as pythonic. My real array much bigger than this example.
( 5+10+20+3+2 ) / 5
print(np.mean(array,key=lambda x:x[1])
You could use map:
map
np.mean(list(map(lambda x: x[1], array)))