0

Why do I receive an error for the all function in my function?

import numpy as np
A = np.matrix([[.6+1j,.5], [.6,.5]])
def isNormalcomplex(A):
    if (all([email protected]() == A.T.conj()@A)):
        print("The matrix is normal")
    else:
        print("The matrix is Non-normal")
isNormalcomplex(A)

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

mkrieger1
  • 19,194
  • 5
  • 54
  • 65

0 Answers0