I don't have any idea with this error,
import NumPy as np
X = np.array([[1,2,3],
[4,5,100],
[-1,2,100],
[3,8,9232020]])
print(X)
print('\n Dimension of the array is:')
print(X.shape)
def getMax(X):
this_max=X[0]
for e in X:
if e > this_max:
this_max=e
return this_max
x_max=getMax(X)
print('x_max',x_max)
print('x_max', np.max(X))
the error is "if e > this_max:", and it is telling me the truth value of an array with more than one element is ambiguous. Use a.any() or a.all(), I don't know how to fix it.