我想在 python 中找到 3d 数组的最大值。我试过
image_file1 = open("lena256x256.bmp","rb")
img_i = PIL.Image.open(image_file1)
pix = numpy.array(img_i);
maxval= max(pix)
但我收到一个错误
File "test.py", line 31, in <module>
maxval= max(pix)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
我无法在这里发现我的错误,请帮助我。