The list contain single element with the array values. How can i find the maximum value from list? list is [array([[ 4, 5, 6], [10, 11, 12]])]. Find below code for reference.
import numpy
a=np.arange(1,13).reshape(2,2,3)
pt=[np.array([0,1]),np.array([1,1])]
list=[]
list.append(a[pt[0],pt[1]])
CodePudding user response:
You can find the max of a numpy array with the numpy max function:
m = np.max(list[0])
CodePudding user response:
first import numpy as np because of line 2, when you called the numpy module as np. this is the code that I find a solution for you, there are more elegant answers for sure
holder = 0
for x in a:
for y in x:
for z in range(len(y)):
if holder < y[z]:
holder = y[z]
print(holder)
