Find min in Numpy matrix in Python by R4R Team

Example-

matrix is
[[1 4]
[5 1]]

then min is 1

Syntax-

numpy.array(list).min()


program-

#import numpy
import numpy as np

l=[[1,2,3],[4,5,1],[1,1,1]]
arr1=np.array(l)
print("nArray is :n",arr1)

print("Minimum number is :",arr1.min())


output-

Array is :
[[1 2 3]
[4 5 1]
[1 1 1]]
Minimum number is : 1




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!