Find maximum number in Numpy Matrix by R4R Team

Example-

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

then max is 5

Syntax-

numpy.array(list).max()


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("Maximum number is :",arr1.max())


output-

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




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!