Numpy amin

from numpy import *

arr = array([[10,20,30,40,50],[11,22,33,4,5]])
print(arr)

print()

print(‘Smallest values across columns: ‘,amin(arr,axis=0))

print()

print(‘Smallest values across rows: ‘,amin(arr,axis=1))


Output

[[10 20 30 40 50]
[11 22 33 4 5]]

Smallest values across columns: [10 20 30 4 5]

Smallest values across rows: [10 4]

Published by Python programming examples for beginners

Abhay Gadkari is an IT professional having around experience of 20+ years in IT industry. He worked on web technologies and databases with Insurance and ERP projects.